From: George McCollister <[email protected]>

I added a new packet libmemcached. A client library for memcached.

Signed-off-by: George McCollister <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
---
 ...binary.m4-switched-to-compile-time-checks.patch |   39 ++++++
 .../0002-add-cache-checks-to-setsockopt.m4.patch   |  124 ++++++++++++++++++++
 ...003-Don-t-check-for-pod2man-in-pod2man.m4.patch |   28 +++++
 ...n-t-check-for-podchecker-in-podchecker.m4.patch |   28 +++++
 ...5-Change-Makefile.am-so-docs-aren-t-built.patch |   29 +++++
 .../0006-fixed-typo-in-byteorder.m4.patch          |   29 +++++
 patches/libmemcached-0.37/autogen.sh               |    1 +
 patches/libmemcached-0.37/series                   |    8 ++
 rules/libmemcached.in                              |   36 ++++++
 rules/libmemcached.make                            |   84 +++++++++++++
 10 files changed, 406 insertions(+), 0 deletions(-)
 create mode 100644 
patches/libmemcached-0.37/0001-protocol_binary.m4-switched-to-compile-time-checks.patch
 create mode 100644 
patches/libmemcached-0.37/0002-add-cache-checks-to-setsockopt.m4.patch
 create mode 100644 
patches/libmemcached-0.37/0003-Don-t-check-for-pod2man-in-pod2man.m4.patch
 create mode 100644 
patches/libmemcached-0.37/0004-Don-t-check-for-podchecker-in-podchecker.m4.patch
 create mode 100644 
patches/libmemcached-0.37/0005-Change-Makefile.am-so-docs-aren-t-built.patch
 create mode 100644 
patches/libmemcached-0.37/0006-fixed-typo-in-byteorder.m4.patch
 create mode 120000 patches/libmemcached-0.37/autogen.sh
 create mode 100644 patches/libmemcached-0.37/series
 create mode 100644 rules/libmemcached.in
 create mode 100644 rules/libmemcached.make

diff --git 
a/patches/libmemcached-0.37/0001-protocol_binary.m4-switched-to-compile-time-checks.patch
 
b/patches/libmemcached-0.37/0001-protocol_binary.m4-switched-to-compile-time-checks.patch
new file mode 100644
index 0000000..d17a778
--- /dev/null
+++ 
b/patches/libmemcached-0.37/0001-protocol_binary.m4-switched-to-compile-time-checks.patch
@@ -0,0 +1,39 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 12:08:55 -0600
+Subject: [PATCH] protocol_binary.m4 switched to compile time checks
+
+protocol_binary.m4 was using runtime checks to check for unsupported
+compiler padding. Changed to use compile time checks.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ m4/protocol_binary.m4 |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/m4/protocol_binary.m4 b/m4/protocol_binary.m4
+index d31bcb0..03dae8f 100644
+--- a/m4/protocol_binary.m4
++++ b/m4/protocol_binary.m4
+@@ -5,14 +5,14 @@ AC_DEFUN([PROTOCOL_BINARY_TEST],
+   [AC_LANG_PUSH([C])
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -I${srcdir}"
+-   AC_RUN_IFELSE([ 
++   AC_COMPILE_IFELSE([ 
+       AC_LANG_PROGRAM([[
+ #include "libmemcached/memcached/protocol_binary.h"
++#define COMPILE_TIME_ASSERT(expr) struct { unsigned int bf : (expr); };
+    ]],[[
+       protocol_binary_request_set request;
+-      if (sizeof(request) != sizeof(request.bytes)) {
+-         return 1;
+-      }
++      COMPILE_TIME_ASSERT(sizeof(request) == sizeof(request.bytes));
++      return 0;
+    ]])],, AC_MSG_ERROR([Unsupported struct padding done by compiler.])) 
+    CFLAGS="$save_CFLAGS"
+    AC_LANG_POP
+-- 
+1.7.2.3
+
diff --git 
a/patches/libmemcached-0.37/0002-add-cache-checks-to-setsockopt.m4.patch 
b/patches/libmemcached-0.37/0002-add-cache-checks-to-setsockopt.m4.patch
new file mode 100644
index 0000000..d14d76c
--- /dev/null
+++ b/patches/libmemcached-0.37/0002-add-cache-checks-to-setsockopt.m4.patch
@@ -0,0 +1,124 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 12:08:55 -0600
+Subject: [PATCH] add cache checks to setsockopt.m4
+
+Added cache checks to setsockopt.m4 so cached values can be provided
+when cross compiling.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ m4/setsockopt.m4 |   85 +++++++++++++++++++++++++++++++----------------------
+ 1 files changed, 50 insertions(+), 35 deletions(-)
+
+diff --git a/m4/setsockopt.m4 b/m4/setsockopt.m4
+index e37fe2a..e5ca8d7 100644
+--- a/m4/setsockopt.m4
++++ b/m4/setsockopt.m4
+@@ -3,53 +3,68 @@ dnl Macro: SETSOCKOPT_SANITY
+ dnl 
---------------------------------------------------------------------------
+ AC_DEFUN([SETSOCKOPT_SANITY],[
+   AC_LANG_PUSH([C])
+-  AC_RUN_IFELSE([ 
+-    AC_LANG_PROGRAM([[
++  AC_CACHE_CHECK([if SO_SNDTIMEO works with setsockopt()], 
ac_cv_setsockopt_so_sndtime0,[
++    AC_RUN_IFELSE([
++      AC_LANG_PROGRAM([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <time.h>
+ #include <sys/time.h>
+ #include <errno.h>
+-   ]],[[
+-     int sock = socket(AF_INET, SOCK_STREAM, 0);
+-     struct timeval waittime;
+-   
+-     waittime.tv_sec= 0;
+-     waittime.tv_usec= 500;
+-   
+-     if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, 
+-                    &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
+-       if (errno == ENOPROTOOPT) {
+-         return 1;
++     ],[
++       int sock = socket(AF_INET, SOCK_STREAM, 0);
++       struct timeval waittime;
++     
++       waittime.tv_sec= 0;
++       waittime.tv_usec= 500;
++     
++       if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
++                    &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
++       if (errno == ENOPROTOOPT) {
++         return 1;
++       }
+        }
+-     }
+-     return 0;
+-   ]])],
+-   [AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working 
SO_SNDTIMEO])]) 
+-
+-  AC_RUN_IFELSE([ 
+-    AC_LANG_PROGRAM([[
++       return 0;
++     ])],[
++       ac_cv_setsockopt_so_sndtime0=yes
++     ],[
++       ac_cv_setsockopt_so_sndtime0=no
++     ])
++  ])
++  if test $ac_cv_setsockopt_so_sndtime0 = yes; then
++    AC_DEFINE(HAVE_SNDTIMEO, 1, [SO_SNDTIMEO works with setsockopt()])
++  fi
++  AC_CACHE_CHECK([if SO_RCVTIMEO works with setsockopt()], 
ac_cv_setsockopt_so_rcvtime0,[
++    AC_RUN_IFELSE([
++      AC_LANG_PROGRAM([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <time.h>
+ #include <sys/time.h>
+ #include <errno.h>
+-    ]],[[
+-     int sock = socket(AF_INET, SOCK_STREAM, 0);
+-     struct timeval waittime;
+-   
+-     waittime.tv_sec= 0;
+-     waittime.tv_usec= 500;
+-   
+-     if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, 
+-                    &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
+-       if (errno == ENOPROTOOPT) {
+-         return 1;
++      ],[
++       int sock = socket(AF_INET, SOCK_STREAM, 0);
++       struct timeval waittime;
++     
++       waittime.tv_sec= 0;
++       waittime.tv_usec= 500;
++     
++       if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
++                    &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
++       if (errno == ENOPROTOOPT) {
++         return 1;
++       }
+        }
+-     }
+-     return 0;
+-   ]])], [AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working 
SO_RCVTIMEO])]) 
+-
++       return 0;
++     ])],[
++       ac_cv_setsockopt_so_rcvtime0=yes
++     ].[
++       ac_cv_setsockopt_so_rcvtime0=no
++     ])
++  ])
++  if test $ac_cv_setsockopt_so_rcvtime0 = yes; then
++    AC_DEFINE(HAVE_RCVTIMEO, 1, [SO_RCVTIMEO works with setsockopt()])
++  fi
+   AC_LANG_POP
+ ])
+ dnl 
---------------------------------------------------------------------------
+-- 
+1.7.2.3
+
diff --git 
a/patches/libmemcached-0.37/0003-Don-t-check-for-pod2man-in-pod2man.m4.patch 
b/patches/libmemcached-0.37/0003-Don-t-check-for-pod2man-in-pod2man.m4.patch
new file mode 100644
index 0000000..9a2e039
--- /dev/null
+++ b/patches/libmemcached-0.37/0003-Don-t-check-for-pod2man-in-pod2man.m4.patch
@@ -0,0 +1,28 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 12:08:55 -0600
+Subject: [PATCH] Don't check for pod2man in pod2man.m4
+
+This patch removes the check for pod2man in pod2man.m4 which is only
+necessary when building docs.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ m4/pod2man.m4 |    5 -----
+ 1 files changed, 0 insertions(+), 5 deletions(-)
+
+diff --git a/m4/pod2man.m4 b/m4/pod2man.m4
+index 2658998..06c3383 100644
+--- a/m4/pod2man.m4
++++ b/m4/pod2man.m4
+@@ -1,7 +1,2 @@
+ AC_DEFUN([REQUIRE_POD2MAN],[
+-  AC_PATH_PROG([POD2MAN], [pod2man],
+-    "no", [$PATH:/usr/bin:/usr/local/bin:/usr/perl5/bin])
+-  AS_IF([test "x$POD2MAN" = "xno"],
+-    AC_MSG_ERROR(["Could not find pod2man anywhere in path"]))
+-  AC_SUBST(POD2MAN)
+ ])
+-- 
+1.7.2.3
+
diff --git 
a/patches/libmemcached-0.37/0004-Don-t-check-for-podchecker-in-podchecker.m4.patch
 
b/patches/libmemcached-0.37/0004-Don-t-check-for-podchecker-in-podchecker.m4.patch
new file mode 100644
index 0000000..a97fb4b
--- /dev/null
+++ 
b/patches/libmemcached-0.37/0004-Don-t-check-for-podchecker-in-podchecker.m4.patch
@@ -0,0 +1,28 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 12:08:55 -0600
+Subject: [PATCH] Don't check for podchecker in podchecker.m4
+
+This patch removes the check for podchecker in podchecker.m4 which is only
+necessary when building docs.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ m4/podchecker.m4 |    5 -----
+ 1 files changed, 0 insertions(+), 5 deletions(-)
+
+diff --git a/m4/podchecker.m4 b/m4/podchecker.m4
+index ae10a6b..06475fb 100644
+--- a/m4/podchecker.m4
++++ b/m4/podchecker.m4
+@@ -1,7 +1,2 @@
+ AC_DEFUN([REQUIRE_PODCHECKER],[
+-  AC_PATH_PROG([PODCHECKER], [podchecker],
+-    "no", [$PATH:/usr/bin:/usr/local/bin:/usr/perl5/bin])
+-  AS_IF([test "x$PODCHECKER" = "xno"],
+-    AC_MSG_ERROR(["Could not find podchecker anywhere in path"]))
+-  AC_SUBST(PODCHECKER)
+ ])
+-- 
+1.7.2.3
+
diff --git 
a/patches/libmemcached-0.37/0005-Change-Makefile.am-so-docs-aren-t-built.patch 
b/patches/libmemcached-0.37/0005-Change-Makefile.am-so-docs-aren-t-built.patch
new file mode 100644
index 0000000..260f527
--- /dev/null
+++ 
b/patches/libmemcached-0.37/0005-Change-Makefile.am-so-docs-aren-t-built.patch
@@ -0,0 +1,29 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 12:08:55 -0600
+Subject: [PATCH] Change Makefile.am so docs aren't built
+
+Two utilities, pod2man and podchecker are required to build docs. If you
+don't care about the docs anyway it seems better to not do it at all.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ Makefile.am |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index d163202..286c6b8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -16,7 +16,7 @@ EXTRA_HEADERS =
+ BUILT_SOURCES=
+ EXTRA_DIST = README.FIRST
+ 
+-SUBDIRS = docs
++SUBDIRS =
+ 
+ test-docs:
+       (cd docs && $(MAKE) test-docs)
+-- 
+1.7.2.3
+
diff --git a/patches/libmemcached-0.37/0006-fixed-typo-in-byteorder.m4.patch 
b/patches/libmemcached-0.37/0006-fixed-typo-in-byteorder.m4.patch
new file mode 100644
index 0000000..f5ae4e5
--- /dev/null
+++ b/patches/libmemcached-0.37/0006-fixed-typo-in-byteorder.m4.patch
@@ -0,0 +1,29 @@
+From: George McCollister <[email protected]>
+Date: Wed, 17 Nov 2010 16:08:34 -0600
+Subject: [PATCH] fixed typo in byteorder.m4
+
+The one use of av_cv_have_htonll needs to be changed to
+ac_cv_have_htonll so it matches the variable in the following test.
+
+Signed-off-by: George McCollister <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+---
+ m4/byteorder.m4 |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/m4/byteorder.m4 b/m4/byteorder.m4
+index 4692bbd..0202648 100644
+--- a/m4/byteorder.m4
++++ b/m4/byteorder.m4
+@@ -1,7 +1,7 @@
+ AC_DEFUN([DETECT_BYTEORDER],
+ [
+     AC_REQUIRE([AC_C_BIGENDIAN])
+-    AC_CACHE_CHECK([for htonll],[av_cv_have_htonll],[
++    AC_CACHE_CHECK([for htonll],[ac_cv_have_htonll],[
+ 
+     AC_RUN_IFELSE([
+        AC_LANG_PROGRAM([[
+-- 
+1.7.2.3
+
diff --git a/patches/libmemcached-0.37/autogen.sh 
b/patches/libmemcached-0.37/autogen.sh
new file mode 120000
index 0000000..9f8a4cb
--- /dev/null
+++ b/patches/libmemcached-0.37/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/libmemcached-0.37/series b/patches/libmemcached-0.37/series
new file mode 100644
index 0000000..57a6c44
--- /dev/null
+++ b/patches/libmemcached-0.37/series
@@ -0,0 +1,8 @@
+# generated by git-ptx-patches
+0001-protocol_binary.m4-switched-to-compile-time-checks.patch
+0002-add-cache-checks-to-setsockopt.m4.patch
+0003-Don-t-check-for-pod2man-in-pod2man.m4.patch
+0004-Don-t-check-for-podchecker-in-podchecker.m4.patch
+0005-Change-Makefile.am-so-docs-aren-t-built.patch
+0006-fixed-typo-in-byteorder.m4.patch
+# 0a01f344d57585c2ce61701f034bf2ed  - git-ptx-patches magic
diff --git a/rules/libmemcached.in b/rules/libmemcached.in
new file mode 100644
index 0000000..fa12ba6
--- /dev/null
+++ b/rules/libmemcached.in
@@ -0,0 +1,36 @@
+## SECTION=system_libraries
+
+menuconfig LIBMEMCACHED
+       tristate
+       prompt "libmemcached"
+       help
+         libmemcached is a C client library for interfacing to a memcached
+         server. It has been designed to be light on memory usage, thread
+         safe and to provide full access to server side methods. It also
+         implements several command line tools: memcat, memflush, memrm,
+         memstat, and memslap (for load generation). The library has been
+         designed to allow for different hashing methods on keys,
+         partitioning by keys, and to use consistent hashing for 
+         distribution. 
+         You can find more information here: 
http://tangent.org/552/libmemcached.html
+
+       config LIBMEMCACHED_LIBHASHKIT
+               depends on LIBMEMCACHED
+               bool
+               prompt "install libhashkit"
+               help
+                 If selected libhashkit will be included in the package.
+
+       config LIBMEMCACHED_LIBMEMCACHEDUTIL
+               depends on LIBMEMCACHED
+               bool
+               prompt "install libmemcachedutil"
+               help
+                 If selected libmemcachedutil will be included in the package.
+
+       config LIBMEMCACHED_LIBMEMCACHEDPROTOCOL
+               depends on LIBMEMCACHED
+               bool
+               prompt "install libmemcachedprotocol"
+               help
+                 If selected libmemcachedprotocol will be included in the 
package.
diff --git a/rules/libmemcached.make b/rules/libmemcached.make
new file mode 100644
index 0000000..1bf6236
--- /dev/null
+++ b/rules/libmemcached.make
@@ -0,0 +1,84 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2010 by NovaTech-LLC
+#
+# 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_LIBMEMCACHED) += libmemcached
+
+#
+# Paths and names
+#
+LIBMEMCACHED_VERSION           := 0.37
+LIBMEMCACHED                   := libmemcached-$(LIBMEMCACHED_VERSION)
+LIBMEMCACHED_SUFFIX            := tar.gz
+LIBMEMCACHED_URL               := 
http://launchpad.net/libmemcached/1.0/$(LIBMEMCACHED_VERSION)/+download/$(LIBMEMCACHED).$(LIBMEMCACHED_SUFFIX)
+LIBMEMCACHED_SOURCE            := 
$(SRCDIR)/$(LIBMEMCACHED).$(LIBMEMCACHED_SUFFIX)
+LIBMEMCACHED_DIR               := $(BUILDDIR)/$(LIBMEMCACHED)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBMEMCACHED_ENV := \
+       $(CROSS_ENV) \
+       ac_cv_c_alignment=need \
+       ac_cv_time_t_unsigned=no \
+       ac_cv_c_stack_direction=0 \
+       ac_cv_gcc_atomic_builtins=no \
+       ac_cv_have_htonll=no \
+       ac_cv_setsockopt_so_sndtime0=no \
+       ac_cv_setsockopt_so_rcvtime0=no \
+       pandora_cv_use_pipe=yes
+
+#We have libevent but disable it so clients/memslap doesn't build. 
+#It fails to link because __sync_fetch_and_sub_4 is missing.
+LIBMEMCACHED_ENV += ac_cv_libevent=no
+
+#
+# autoconf
+#
+LIBMEMCACHED_AUTOCONF := \
+       $(CROSS_AUTOCONF_USR) \
+       --without-memcached \
+       --disable-libevent
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libmemcached.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, libmemcached)
+       @$(call install_fixup, libmemcached, PRIORITY, optional)
+       @$(call install_fixup, libmemcached, SECTION, base)
+       @$(call install_fixup, libmemcached, AUTHOR, "NovaTech-LLC")
+       @$(call install_fixup, libmemcached, DESCRIPTION, missing)
+
+       @$(call install_lib, libmemcached, 0, 0, 0644, libmemcached)
+
+ifdef PTXCONF_LIBMEMCACHED_LIBHASHKIT
+       @$(call install_lib, libmemcached, 0, 0, 0644, libhashkit)
+endif
+
+ifdef PTXCONF_LIBMEMCACHED_LIBMEMCACHEDUTIL
+       @$(call install_lib, libmemcached, 0, 0, 0644, libmemcachedutil)
+endif
+
+ifdef PTXCONF_LIBMEMCACHED_LIBMEMCACHEDPROTOCOL
+       @$(call install_lib, libmemcached, 0, 0, 0644, libmemcachedprotocol)
+endif
+
+       @$(call install_finish,libmemcached)
+
+       @$(call touch)
+
+# vim: syntax=make
-- 
1.7.2.3


-- 
ptxdist mailing list
[email protected]

Reply via email to