From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XOPAs-0005p3-MV for ptxdist@pengutronix.de; Mon, 01 Sep 2014 12:49:26 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1XOPAm-0003eH-Kx for ptxdist@pengutronix.de; Mon, 01 Sep 2014 12:49:20 +0200 Date: Mon, 1 Sep 2014 12:49:20 +0200 From: Michael Olbrich Message-ID: <20140901104920.GE5271@pengutronix.de> References: <1405936382-6544-1-git-send-email-guillaume.gourat@nexvision.fr> <1405936382-6544-5-git-send-email-guillaume.gourat@nexvision.fr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1405936382-6544-5-git-send-email-guillaume.gourat@nexvision.fr> Subject: Re: [ptxdist] [PATCH 5/6] libhiredis: add new package Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Mon, Jul 21, 2014 at 11:53:01AM +0200, Guillaume Gourat wrote: > From: Guillaume GOURAT > Please address my comments for the last version. Michael > Signed-off-by: Guillaume GOURAT > --- > .../libhiredis-0.11.0/01_use-proper-destdir.patch | 17 +++ > patches/libhiredis-0.11.0/03_pkgconfig-cmake.patch | 121 ++++++++++++++++++++ > patches/libhiredis-0.11.0/series | 2 + > rules/libhiredis.in | 9 ++ > rules/libhiredis.make | 59 ++++++++++ > 5 files changed, 208 insertions(+) > create mode 100644 patches/libhiredis-0.11.0/01_use-proper-destdir.patch > create mode 100644 patches/libhiredis-0.11.0/03_pkgconfig-cmake.patch > create mode 100644 patches/libhiredis-0.11.0/series > create mode 100755 rules/libhiredis.in > create mode 100755 rules/libhiredis.make > > diff --git a/patches/libhiredis-0.11.0/01_use-proper-destdir.patch b/patches/libhiredis-0.11.0/01_use-proper-destdir.patch > new file mode 100644 > index 0000000..d65c6c9 > --- /dev/null > +++ b/patches/libhiredis-0.11.0/01_use-proper-destdir.patch > @@ -0,0 +1,17 @@ > +Description: Make the Makefile use the $(DESTDIR) variable > +Origin: vendor > +Forwarded: not-needed > +From: Alessandro Ghedini > +Last-Update: 2012-08-28 > + > +--- a/Makefile > ++++ b/Makefile > +@@ -104,7 +104,7 @@ > + $(CC) -MM *.c > + > + # Installation related variables and target > +-PREFIX?=/usr/local > ++PREFIX?=$(DESTDIR)/usr > + INCLUDE_PATH?=include/hiredis > + LIBRARY_PATH?=lib > + INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) > diff --git a/patches/libhiredis-0.11.0/03_pkgconfig-cmake.patch b/patches/libhiredis-0.11.0/03_pkgconfig-cmake.patch > new file mode 100644 > index 0000000..20b036e > --- /dev/null > +++ b/patches/libhiredis-0.11.0/03_pkgconfig-cmake.patch > @@ -0,0 +1,121 @@ > +Description: Add pkg-config and cmake scripts > +Origin: vendor > +Forwarded: https://github.com/redis/hiredis/pull/129 > +Author: Tom Lee > +Last-Update: 2012-11-06 > + > +--- /dev/null > ++++ b/FindHiredis.cmake > +@@ -0,0 +1,34 @@ > ++# FindHiredis.cmake - Try to find the Hiredis library > ++# Once done this will define > ++# > ++# HIREDIS_FOUND - System has Hiredis > ++# HIREDIS_INCLUDE_DIR - The Hiredis include directory > ++# HIREDIS_LIBRARIES - The libraries needed to use Hiredis > ++# HIREDIS_DEFINITIONS - Compiler switches required for using Hiredis > ++ > ++ > ++# use pkg-config to get the directories and then use these values > ++# in the FIND_PATH() and FIND_RARY() calls > ++FIND_PACKAGE(PkgConfig) > ++PKG_SEARCH_MODULE(PC_HIREDIS REQUIRED hiredis) > ++ > ++SET(HIREDIS_DEFINITIONS ${PC_HIREDIS_CFLAGS_OTHER}) > ++ > ++FIND_PATH(HIREDIS_INCLUDE_DIR NAMES hiredis/hiredis.h > ++ HINTS > ++ ${PC_HIREDIS_INCLUDEDIR} > ++ ${PC_HIREDIS_INCLUDE_DIRS} > ++ PATH_SUFFIXES hiredis > ++ ) > ++ > ++FIND_LIBRARY(HIREDIS_LIBRARIES NAMES hiredis > ++ HINTS > ++ ${PC_HIREDIS_DIR} > ++ ${PC_HIREDIS_LIBRARY_DIRS} > ++ ) > ++ > ++ > ++INCLUDE(FindPackageHandleStandardArgs) > ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(Hiredis DEFAULT_MSG HIREDIS_LIBRARIES HIREDIS_INCLUDE_DIR) > ++ > ++MARK_AS_ADVANCED(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARIES) > +--- a/Makefile > ++++ b/Makefile > +@@ -98,17 +98,25 @@ > + $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $< > + > + clean: > +- rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov > ++ rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov hiredis.pc > + > + dep: > + $(CC) -MM *.c > + > + # Installation related variables and target > +-PREFIX?=$(DESTDIR)/usr > ++SED?=sed > ++INSTALL_PREFIX?=$(DESTDIR)/usr > ++PREFIX?=$(INSTALL_PREFIX) > + INCLUDE_PATH?=include/hiredis > + LIBRARY_PATH?=lib > +-INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) > +-INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) > ++LIB_PREFIX?=$(PREFIX)/$(LIBRARY_PATH) > ++PKGCONFIG_PATH?=$(LIBRARY_PATH)/pkgconfig > ++CMAKE_MODULES_PATH?=share/cmake/Modules > ++INSTALL_INCLUDE_PATH= $(INSTALL_PREFIX)/$(INCLUDE_PATH) > ++INSTALL_LIBRARY_PATH= $(INSTALL_PREFIX)/$(LIBRARY_PATH) > ++INSTALL_PKGCONFIG_PATH= $(INSTALL_PREFIX)/$(PKGCONFIG_PATH) > ++INSTALL_CMAKE_MODULES_PATH= $(INSTALL_PREFIX)/$(CMAKE_MODULES_PATH) > ++PKG_CONFIG_CFLAGS?= -D_FILE_OFFSET_BITS=64 > + > + ifeq ($(uname_S),SunOS) > + INSTALL?= cp -r > +@@ -116,13 +124,24 @@ > + > + INSTALL?= cp -a > + > +-install: $(DYLIBNAME) $(STLIBNAME) > ++hiredis.pc: hiredis.pc.in > ++ test -d $(INSTALL_PKGCONFIG_PATH) && \ > ++ $(SED) -e 's,@PREFIX@,$(PREFIX),g' \ > ++ -e 's,@LIB_PREFIX@,$(LIB_PREFIX),g' \ > ++ -e 's,@CFLAGS@,$(PKG_CONFIG_CFLAGS),g' $< >$@ || true > ++ > ++install: $(DYLIBNAME) $(STLIBNAME) hiredis.pc > + 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) > ++ test -f hiredis.pc && \ > ++ test -d $(INSTALL_PKGCONFIG_PATH) && \ > ++ $(INSTALL) hiredis.pc $(INSTALL_PKGCONFIG_PATH) && \ > ++ test -d "$(INSTALL_CMAKE_MODULES_PATH)" && \ > ++ $(INSTALL) FindHiredis.cmake $(INSTALL_CMAKE_MODULES_PATH) || true > + > + 32bit: > + @echo "" > +@@ -145,4 +164,4 @@ > + noopt: > + $(MAKE) OPTIMIZATION="" > + > +-.PHONY: all test check clean dep install 32bit gprof gcov noopt > ++.PHONY: all test check clean dep install 32bit gprof gcov noopt hiredis.pc > +--- /dev/null > ++++ b/hiredis.pc.in > +@@ -0,0 +1,11 @@ > ++prefix=@PREFIX@ > ++exec_prefix=${prefix} > ++libdir=@LIB_PREFIX@ > ++includedir=${prefix}/include > ++ > ++Name: Hiredis > ++Description: Minimalistic C client library for the Redis database. > ++Version: 0.11.0 > ++Libs: -L${libdir} -lhiredis > ++Cflags: -I${includedir}/hiredis @CFLAGS@ > ++ > diff --git a/patches/libhiredis-0.11.0/series b/patches/libhiredis-0.11.0/series > new file mode 100644 > index 0000000..dd8f003 > --- /dev/null > +++ b/patches/libhiredis-0.11.0/series > @@ -0,0 +1,2 @@ > +01_use-proper-destdir.patch > +03_pkgconfig-cmake.patch > diff --git a/rules/libhiredis.in b/rules/libhiredis.in > new file mode 100755 > index 0000000..3109d38 > --- /dev/null > +++ b/rules/libhiredis.in > @@ -0,0 +1,9 @@ > +## SECTION=system_libraries > + > +config LIBHIREDIS > + tristate > + prompt "libhiredis" > + select GCCLIBS_GCC_S > + select LIBEVENT > + help > + Hiredis is a minimalistic C client library for the Redis database. > diff --git a/rules/libhiredis.make b/rules/libhiredis.make > new file mode 100755 > index 0000000..e7dc992 > --- /dev/null > +++ b/rules/libhiredis.make > @@ -0,0 +1,59 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2014 by Guillaume Gourat > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_LIBHIREDIS) += libhiredis > + > +# > +# Paths and names > +# > +LIBHIREDIS_VERSION := 0.11.0 > +LIBHIREDIS_MD5 := e2ac29509823ccc96990b6fe765b5d46 > +LIBHIREDIS := libhiredis-$(LIBHIREDIS_VERSION) > +LIBHIREDIS_SUFFIX := tar.gz > +LIBHIREDIS_URL := https://github.com/redis/hiredis/archive/v$(LIBHIREDIS_VERSION).$(LIBHIREDIS_SUFFIX) > +LIBHIREDIS_SOURCE := $(SRCDIR)/$(LIBHIREDIS).$(LIBHIREDIS_SUFFIX) > +LIBHIREDIS_DIR := $(BUILDDIR)/$(LIBHIREDIS) > +LIBHIREDIS_LICENSE := BSD > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +LIBHIREDIS_CONF_TOOL := NO > +LIBHIREDIS_MAKE_ENV := $(CROSS_ENV) > +LIBHIREDIS_MAKE_PAR := NO > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/libhiredis.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, libhiredis) > + @$(call install_fixup, libhiredis,PRIORITY,optional) > + @$(call install_fixup, libhiredis,SECTION,base) > + @$(call install_fixup, libhiredis,AUTHOR,"Guillaume Gourat ") > + @$(call install_fixup, libhiredis,DESCRIPTION,missing) > + > + @$(call install_lib, libhiredis, 0, 0, 0644, libhiredis) > + > + @$(call install_finish, libhiredis) > + > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Clean > +# ---------------------------------------------------------------------------- > + > +# vim: syntax=make > -- > 1.7.10.4 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de