From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 6.mo5.mail-out.ovh.net ([178.32.119.138] helo=mo5.mail-out.ovh.net) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1X9AJU-0005sl-8n for ptxdist@pengutronix.de; Mon, 21 Jul 2014 11:55:21 +0200 Received: from mail438.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with SMTP id 00772FF9256 for ; Mon, 21 Jul 2014 11:55:19 +0200 (CEST) From: Guillaume Gourat Date: Mon, 21 Jul 2014 11:53:01 +0200 Message-Id: <1405936382-6544-5-git-send-email-guillaume.gourat@nexvision.fr> In-Reply-To: <1405936382-6544-1-git-send-email-guillaume.gourat@nexvision.fr> References: <1405936382-6544-1-git-send-email-guillaume.gourat@nexvision.fr> Subject: [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: , MIME-Version: 1.0 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 Cc: Guillaume GOURAT From: Guillaume GOURAT 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