mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Guillaume GOURAT" <guillaume.gourat@nexvision.fr>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] libhiredis: add new package
Date: Sun, 20 Jul 2014 12:13:20 +0200	[thread overview]
Message-ID: <006401cfa403$3bea1f10$b3be5d30$@gourat@nexvision.fr> (raw)

    libhiredis: add new package

    Signed-off-by: Guillaume Gourat <guillaume.gourat@nexvision.fr>

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 <ghedo@debian.org>
+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 <debian@tomlee.co>
+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 <guillaume.gourat@nexvision.fr> 
+#
+# 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
<guillaume.gourat@nexvision.fr>")
+	@$(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

             reply	other threads:[~2014-07-20 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-20 10:13 Guillaume GOURAT [this message]
2014-07-21  9:18 ` Michael Olbrich
2014-07-21  9:55   ` Guillaume GOURAT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006401cfa403$3bea1f10$b3be5d30$@gourat@nexvision.fr' \
    --to=guillaume.gourat@nexvision.fr \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox