From c386c3ed09c64028fa38989c49889e7623dc052a Mon Sep 17 00:00:00 2001 From: wiedi Date: Wed, 2 Apr 2014 17:25:44 +0000 Subject: Add hiredis-0.11.0 Hiredis is a minimalistic C client library for the Redis database. It is minimalistic because it just adds minimal support for the protocol, but at the same time it uses an high level printf-alike API in order to make it much higher level than otherwise suggested by its minimal code base and the lack of explicit bindings for every Redis command. Apart from supporting sending commands and receiving replies, it comes with a reply parser that is decoupled from the I/O layer. It is a stream parser designed for easy reusability, which can for instance be used in higher level language bindings for efficient reply parsing. Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis version >= 1.2.0. The library comes with multiple APIs. There is the synchronous API, the asynchronous API and the reply parsing API. --- databases/hiredis/DESCR | 19 +++++++++ databases/hiredis/Makefile | 19 +++++++++ databases/hiredis/PLIST | 7 ++++ databases/hiredis/buildlink3.mk | 12 ++++++ databases/hiredis/distinfo | 7 ++++ databases/hiredis/patches/patch-Makefile | 69 +++++++++++++++++++++++++++++++ databases/hiredis/patches/patch-fmacros.h | 14 +++++++ 7 files changed, 147 insertions(+) create mode 100644 databases/hiredis/DESCR create mode 100644 databases/hiredis/Makefile create mode 100644 databases/hiredis/PLIST create mode 100644 databases/hiredis/buildlink3.mk create mode 100644 databases/hiredis/distinfo create mode 100644 databases/hiredis/patches/patch-Makefile create mode 100644 databases/hiredis/patches/patch-fmacros.h diff --git a/databases/hiredis/DESCR b/databases/hiredis/DESCR new file mode 100644 index 00000000000..7c87122bc95 --- /dev/null +++ b/databases/hiredis/DESCR @@ -0,0 +1,19 @@ +Hiredis is a minimalistic C client library for the Redis database. + +It is minimalistic because it just adds minimal support for the +protocol, but at the same time it uses an high level printf-alike +API in order to make it much higher level than otherwise suggested +by its minimal code base and the lack of explicit bindings for +every Redis command. + +Apart from supporting sending commands and receiving replies, it +comes with a reply parser that is decoupled from the I/O layer. It +is a stream parser designed for easy reusability, which can for +instance be used in higher level language bindings for efficient +reply parsing. + +Hiredis only supports the binary-safe Redis protocol, so you can +use it with any Redis version >= 1.2.0. + +The library comes with multiple APIs. There is the synchronous API, +the asynchronous API and the reply parsing API. diff --git a/databases/hiredis/Makefile b/databases/hiredis/Makefile new file mode 100644 index 00000000000..3b7bc1b0cbc --- /dev/null +++ b/databases/hiredis/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/04/02 17:25:44 wiedi Exp $ + +VERSION= 0.11.0 +DISTNAME= v${VERSION} +PKGNAME= hiredis-${VERSION} +CATEGORIES= databases +MASTER_SITES= https://github.com/redis/hiredis/archive/ + +MAINTAINER= wiedi@frubar.net +HOMEPAGE= https://github.com/redis/hiredis/ +COMMENT= Minimalistic C client library for the Redis database +LICENSE= modified-bsd + +USE_TOOLS+= gmake +USE_LIBTOOL= yes +WRKSRC= ${WRKDIR}/hiredis-${VERSION} +MAKE_ENV+= DESTDIR=${DESTDIR} + +.include "../../mk/bsd.pkg.mk" diff --git a/databases/hiredis/PLIST b/databases/hiredis/PLIST new file mode 100644 index 00000000000..0906820de87 --- /dev/null +++ b/databases/hiredis/PLIST @@ -0,0 +1,7 @@ +@comment $NetBSD: PLIST,v 1.1 2014/04/02 17:25:44 wiedi Exp $ +include/hiredis/adapters/ae.h +include/hiredis/adapters/libev.h +include/hiredis/adapters/libevent.h +include/hiredis/async.h +include/hiredis/hiredis.h +lib/libhiredis.la diff --git a/databases/hiredis/buildlink3.mk b/databases/hiredis/buildlink3.mk new file mode 100644 index 00000000000..251ac738dd2 --- /dev/null +++ b/databases/hiredis/buildlink3.mk @@ -0,0 +1,12 @@ +# $NetBSD: buildlink3.mk,v 1.1 2014/04/02 17:25:44 wiedi Exp $ + +BUILDLINK_TREE+= hiredis + +.if !defined(HIREDIS_BUILDLINK3_MK) +HIREDIS_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.hiredis+= hiredis>=0.11.0 +BUILDLINK_PKGSRCDIR.hiredis?= ../../databases/hiredis +.endif # HIREDIS_BUILDLINK3_MK + +BUILDLINK_TREE+= -hiredis diff --git a/databases/hiredis/distinfo b/databases/hiredis/distinfo new file mode 100644 index 00000000000..f5fd1692d70 --- /dev/null +++ b/databases/hiredis/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2014/04/02 17:25:44 wiedi Exp $ + +SHA1 (v0.11.0.tar.gz) = 694b6d7a6e4ea7fb20902619e9a2423c014b37c1 +RMD160 (v0.11.0.tar.gz) = a22c38518d32b8badd77c486ab041e3e54f3ff71 +Size (v0.11.0.tar.gz) = 42137 bytes +SHA1 (patch-Makefile) = fac6faa11c2dd80acaf7a378cc4146d7a03a937c +SHA1 (patch-fmacros.h) = 77e49207baeccae657a8d2c85429d6e76c2438b3 diff --git a/databases/hiredis/patches/patch-Makefile b/databases/hiredis/patches/patch-Makefile new file mode 100644 index 00000000000..7fc67afc429 --- /dev/null +++ b/databases/hiredis/patches/patch-Makefile @@ -0,0 +1,69 @@ +$NetBSD: patch-Makefile,v 1.1 2014/04/02 17:25:44 wiedi Exp $ +add DESTDIR and use libtool + +--- Makefile.orig 2012-08-28 06:55:52.000000000 +0000 ++++ Makefile +@@ -27,6 +27,8 @@ DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname + STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) + STLIB_MAKE_CMD=ar rcs $(STLIBNAME) + ++LANAME=$(LIBNAME).la ++ + # Platform-specific overrides + uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') + ifeq ($(uname_S),SunOS) +@@ -41,7 +43,7 @@ ifeq ($(uname_S),Darwin) + DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) + endif + +-all: $(DYLIBNAME) $(BINS) ++all: $(LANAME) + + # Deps (use make dep to generate this) + net.o: net.c fmacros.h net.h hiredis.h +@@ -60,6 +62,13 @@ $(STLIBNAME): $(OBJ) + dynamic: $(DYLIBNAME) + static: $(STLIBNAME) + ++$(LANAME): $(OBJ) ++ $(LIBTOOL) --mode=link \ ++ $(CC) -o $(LANAME) \ ++ $(OBJ:.o=.lo) \ ++ -rpath $(PREFIX)/lib \ ++ -version-number $(HIREDIS_MAJOR):$(HIREDIS_MINOR) ++ + # Binaries: + hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME) + $(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -levent example-libevent.c $(STLIBNAME) +@@ -95,7 +104,7 @@ check: hiredis-test + kill `cat /tmp/hiredis-test-redis.pid` + + .c.o: +- $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $< ++ $(LIBTOOL) --mode=compile $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $< + + clean: + rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov +@@ -107,8 +116,8 @@ dep: + PREFIX?=/usr/local + INCLUDE_PATH?=include/hiredis + LIBRARY_PATH?=lib +-INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) +-INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) ++INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(INCLUDE_PATH) ++INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH) + + ifeq ($(uname_S),SunOS) + INSTALL?= cp -r +@@ -119,10 +128,7 @@ INSTALL?= cp -a + install: $(DYLIBNAME) $(STLIBNAME) + mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) + $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH) +- $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME) +- cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME) +- cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME) +- $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) ++ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) $(LANAME) $(DESTDIR)$(PREFIX)/lib + + 32bit: + @echo "" diff --git a/databases/hiredis/patches/patch-fmacros.h b/databases/hiredis/patches/patch-fmacros.h new file mode 100644 index 00000000000..9be231cbb87 --- /dev/null +++ b/databases/hiredis/patches/patch-fmacros.h @@ -0,0 +1,14 @@ +$NetBSD: patch-fmacros.h,v 1.1 2014/04/02 17:25:45 wiedi Exp $ +getaddrinfo visibility on NetBSD + +--- fmacros.h.orig 2012-08-28 06:55:52.000000000 +0000 ++++ fmacros.h +@@ -7,7 +7,7 @@ + + #if defined(__sun__) + #define _POSIX_C_SOURCE 200112L +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__NetBSD__) + #define _XOPEN_SOURCE 600 + #else + #define _XOPEN_SOURCE -- cgit v1.2.3