summaryrefslogtreecommitdiff
path: root/net-proxy/nutcracker/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/nutcracker/files')
-rw-r--r--net-proxy/nutcracker/files/nutcracker-0.5.0-configure-bashism.patch11
-rw-r--r--net-proxy/nutcracker/files/nutcracker-0.5.0-md5_signature-lto-mismatch.patch12
-rw-r--r--net-proxy/nutcracker/files/nutcracker-0.5.0-use-system-libyaml.patch62
-rw-r--r--net-proxy/nutcracker/files/nutcracker.confd9
-rw-r--r--net-proxy/nutcracker/files/nutcracker.initd39
5 files changed, 85 insertions, 48 deletions
diff --git a/net-proxy/nutcracker/files/nutcracker-0.5.0-configure-bashism.patch b/net-proxy/nutcracker/files/nutcracker-0.5.0-configure-bashism.patch
new file mode 100644
index 000000000000..888779a82514
--- /dev/null
+++ b/net-proxy/nutcracker/files/nutcracker-0.5.0-configure-bashism.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,7 +159,7 @@ AS_IF([test "x$ac_cv_epoll_works" = "xno" &&
+ AM_CONDITIONAL([OS_LINUX], [test "x$ac_cv_epoll_works" = "xyes"])
+ AM_CONDITIONAL([OS_BSD], [test "x$ac_cv_kqueue_works" = "xyes"])
+ AM_CONDITIONAL([OS_SOLARIS], [test "x$ac_cv_evports_works" = "xyes"])
+-AM_CONDITIONAL([OS_FREEBSD], [test "$(uname -v | cut -c 1-10)" == "FreeBSD 10"])
++AM_CONDITIONAL([OS_FREEBSD], [test "$(uname -v | cut -c 1-10)" = "FreeBSD 10"])
+
+ # Package options
+ AC_MSG_CHECKING([whether to enable debug logs and asserts])
diff --git a/net-proxy/nutcracker/files/nutcracker-0.5.0-md5_signature-lto-mismatch.patch b/net-proxy/nutcracker/files/nutcracker-0.5.0-md5_signature-lto-mismatch.patch
new file mode 100644
index 000000000000..bb493f209bb8
--- /dev/null
+++ b/net-proxy/nutcracker/files/nutcracker-0.5.0-md5_signature-lto-mismatch.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/861860
+--- a/src/hashkit/nc_hashkit.h
++++ b/src/hashkit/nc_hashkit.h
+@@ -55,7 +55,7 @@ typedef enum dist_type {
+ #undef DEFINE_ACTION
+
+ uint32_t hash_one_at_a_time(const char *key, size_t key_length);
+-void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result);
++void md5_signature(const unsigned char *key, unsigned long length, unsigned char *result);
+ uint32_t hash_md5(const char *key, size_t key_length);
+ uint32_t hash_crc16(const char *key, size_t key_length);
+ uint32_t hash_crc32(const char *key, size_t key_length);
diff --git a/net-proxy/nutcracker/files/nutcracker-0.5.0-use-system-libyaml.patch b/net-proxy/nutcracker/files/nutcracker-0.5.0-use-system-libyaml.patch
new file mode 100644
index 000000000000..ddb6694f05b6
--- /dev/null
+++ b/net-proxy/nutcracker/files/nutcracker-0.5.0-use-system-libyaml.patch
@@ -0,0 +1,62 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in config.h.in~
+
+ ACLOCAL_AMFLAGS = -I m4
+
+-SUBDIRS = contrib src
++SUBDIRS = src
+
+ dist_man_MANS = man/nutcracker.8
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,11 +197,8 @@ AS_IF([test "x$disable_stats" = xyes],
+ [AC_DEFINE([HAVE_STATS], [1], [Define to 1 if stats is not disabled])])
+ AC_MSG_RESULT($disable_stats)
+
+-# Untar the yaml-0.2.5 in contrib/ before config.status is rerun
+-AC_CONFIG_COMMANDS_PRE([tar xvfz contrib/yaml-0.2.5.tar.gz -C contrib])
+-
+-# Call yaml-0.2.5 ./configure recursively
+-AC_CONFIG_SUBDIRS([contrib/yaml-0.2.5])
++# Use systems libyaml.
++PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.2.5])
+
+ # Define Makefiles
+ AC_CONFIG_FILES([Makefile
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -7,7 +7,6 @@ endif
+ AM_CPPFLAGS += -I $(top_srcdir)/src/hashkit
+ AM_CPPFLAGS += -I $(top_srcdir)/src/proto
+ AM_CPPFLAGS += -I $(top_srcdir)/src/event
+-AM_CPPFLAGS += -I $(top_srcdir)/contrib/yaml-0.2.5/include
+
+ AM_CFLAGS =
+ # about -fno-strict-aliasing: https://github.com/twitter/twemproxy/issues/276
+@@ -20,9 +19,10 @@ AM_CFLAGS += -Wno-unused-parameter -Wno-unused-value
+ AM_CFLAGS += -Wconversion -Wsign-compare
+ AM_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations
+ AM_CFLAGS += -Wno-format-zero-length
++AM_CFLAGS += $(YAML_CFLAGS)
+
+ AM_LDFLAGS =
+-AM_LDFLAGS += -lm -lpthread -rdynamic
++AM_LDFLAGS += -lm -lpthread -rdynamic $(YAML_LIBS)
+ if OS_SOLARIS
+ AM_LDFLAGS += -lnsl -lsocket
+ endif
+@@ -58,7 +58,6 @@ nutcracker_SOURCES = \
+ nutcracker_LDADD = $(top_builddir)/src/hashkit/libhashkit.a
+ nutcracker_LDADD += $(top_builddir)/src/proto/libproto.a
+ nutcracker_LDADD += $(top_builddir)/src/event/libevent.a
+-nutcracker_LDADD += $(top_builddir)/contrib/yaml-0.2.5/src/.libs/libyaml.a
+
+ TESTS = test_all
+ bin_PROGRAMS = test_all
+@@ -86,4 +85,3 @@ test_all_SOURCES = test_all.c \
+ test_all_LDADD = $(top_builddir)/src/hashkit/libhashkit.a
+ test_all_LDADD += $(top_builddir)/src/proto/libproto.a
+ test_all_LDADD += $(top_builddir)/src/event/libevent.a
+-test_all_LDADD += $(top_builddir)/contrib/yaml-0.2.5/src/.libs/libyaml.a
diff --git a/net-proxy/nutcracker/files/nutcracker.confd b/net-proxy/nutcracker/files/nutcracker.confd
deleted file mode 100644
index 03393f23a64c..000000000000
--- a/net-proxy/nutcracker/files/nutcracker.confd
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-#USER="nobody"
-#PIDFILE="/var/run/nutcracker.pid"
-#CONF_FILE="/etc/nutcracker/nutcracker.yaml"
-
-NUTCRACKER_BIN="/usr/bin/nutcracker"
-NUTCRACKER_OPTS="--daemonize"
diff --git a/net-proxy/nutcracker/files/nutcracker.initd b/net-proxy/nutcracker/files/nutcracker.initd
deleted file mode 100644
index 47abe8f3cd45..000000000000
--- a/net-proxy/nutcracker/files/nutcracker.initd
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-USER="${USER:-nobody}"
-PIDFILE="${PIDFILE:-/var/run/nutcracker.pid}"
-NUTCRACKER_BIN="${NUTCRACKER_BIN:-/usr/bin/nutcracker}"
-CONF_FILE="${CONF_FILE:-/etc/nutcracker/nutcracker.yml}"
-
-depend() {
- need net
-}
-
-checkconf() {
- ebegin "Testing configuration"
- ${NUTCRACKER_BIN} --test-conf \
- --conf-file=${CONF_FILE} \
- >/dev/null 2>&1
- eend $?
-}
-
-start() {
- checkconf || exit 1
- ebegin "Starting Nutcracker"
- start-stop-daemon --start -u ${USER} \
- --name ${SVCNAME} \
- --exec ${NUTCRACKER_BIN} -- \
- --conf-file="${CONF_FILE}" \
- --pid-file=${PIDFILE} \
- ${NUTCRACKER_OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping Nutcracker"
- start-stop-daemon --stop --pidfile "${PIDFILE}"
- eend $?
-}
-