From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 8.mo6.mail-out.ovh.net ([178.33.42.204] helo=mo6.mail-out.ovh.net) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1X8o7X-00078Z-54 for ptxdist@pengutronix.de; Sun, 20 Jul 2014 12:13:32 +0200 Received: from mail95.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo6.mail-out.ovh.net (Postfix) with SMTP id BB4AAFF84F1 for ; Sun, 20 Jul 2014 12:13:30 +0200 (CEST) From: "Guillaume GOURAT" Date: Sun, 20 Jul 2014 12:13:20 +0200 Message-ID: <006401cfa403$3bea1f10$b3be5d30$@gourat@nexvision.fr> MIME-Version: 1.0 Content-Language: fr Subject: [ptxdist] [PATCH] 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 libhiredis: add new package Signed-off-by: Guillaume Gourat 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 -- ptxdist mailing list ptxdist@pengutronix.de