# HG changeset patch # User Michael Schloh von Bennewitz # Date 1316607037 -7200 # Node ID 16cc9d2eceb2a22b75072f9a7dea2c81f167c334 # Parent 67e813202d5307f1da9a44bb0788ff02d6c11c18 Import package vendor original specs for necessary manipulations. diff -r 67e813202d53 -r 16cc9d2eceb2 memcached/memcached.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memcached/memcached.patch Wed Sep 21 14:10:37 2011 +0200 @@ -0,0 +1,77 @@ +Index: libmemcached-0.48/Makefile.in +--- libmemcached-0.48/Makefile.in.orig 2011-03-16 04:40:31.000000000 +0100 ++++ libmemcached-0.48/Makefile.in 2011-03-18 18:43:52.000000000 +0100 +@@ -95,10 +95,7 @@ + clients/memerror$(EXEEXT) clients/memflush$(EXEEXT) \ + clients/memrm$(EXEEXT) clients/memstat$(EXEEXT) \ + $(am__EXEEXT_1) +-noinst_PROGRAMS = tests/atomsmasher$(EXEEXT) tests/hashplus$(EXEEXT) \ +- tests/memplus$(EXEEXT) tests/startservers$(EXEEXT) \ +- tests/testapp$(EXEEXT) tests/testhashkit$(EXEEXT) \ +- tests/testplus$(EXEEXT) tests/testudp$(EXEEXT) $(am__EXEEXT_3) ++noinst_PROGRAMS = + check_PROGRAMS = $(am__EXEEXT_2) + @BUILD_DOCS_TRUE@am__append_1 = test-docs + DIST_COMMON = README $(am__configure_deps) \ +@@ -138,7 +135,7 @@ + @DTRACE_NEEDS_OBJECTS_TRUE@am__append_13 = libmemcached/libmemcached_probes.o + @DTRACE_NEEDS_OBJECTS_TRUE@am__append_14 = libmemcached/libmemcached_probes.o + @HAVE_SASL_TRUE@am__append_15 = $(LIBSASL) +-@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__append_16 = clients/memslap ++@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__append_16 = + @BUILD_BYTEORDER_TRUE@am__append_17 = libmemcached/libbyteorder.la + @INCLUDE_HSIEH_SRC_TRUE@am__append_18 = libhashkit/hsieh.c + @INCLUDE_MURMUR_SRC_TRUE@am__append_19 = libhashkit/murmur.c +@@ -409,7 +406,7 @@ + libtest_libtest_la_LIBADD = + am_libtest_libtest_la_OBJECTS = libtest/test.lo + libtest_libtest_la_OBJECTS = $(am_libtest_libtest_la_OBJECTS) +-@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__EXEEXT_1 = clients/memslap$(EXEEXT) ++@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__EXEEXT_1 = + @HAVE_LIBGTEST_TRUE@am__EXEEXT_2 = unittests/unittests$(EXEEXT) + @HAVE_LIBEVENT_TRUE@am__EXEEXT_3 = example/memcached_light$(EXEEXT) + PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +Index: libmemcached-0.48/configure +--- libmemcached-0.48/configure.orig 2011-03-16 04:40:33.000000000 +0100 ++++ libmemcached-0.48/configure 2011-03-18 18:43:13.000000000 +0100 +@@ -17719,8 +17719,8 @@ + + fi + +- CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" +- CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" ++ CC_WARNINGS="${BASE_WARNINGS} ${CC_WARNINGS_FULL}" ++ CXX_WARNINGS="${BASE_WARNINGS} -Wnon-virtual-dtor -Wno-long-long ${CXX_WARNINGS_FULL}" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to use -Wmissing-declarations from C++" >&5 + $as_echo_n "checking whether it is safe to use -Wmissing-declarations from C++... " >&6; } +Index: libmemcached-0.48/support/libmemcached.pc.in +--- libmemcached-0.48/support/libmemcached.pc.in.orig 2011-02-22 05:06:22.000000000 +0100 ++++ libmemcached-0.48/support/libmemcached.pc.in 2011-03-18 18:43:13.000000000 +0100 +@@ -8,3 +8,4 @@ + Version: @VERSION@ + Libs: @LTLIBSASL@ @LTLIBSASL2@ -L${libdir} -lmemcached + Cflags: -I${includedir} ++Requires: libevent sasl +Index: memcached-1.4.6/configure +--- memcached-1.4.6/configure.orig 2010-04-03 23:26:12.000000000 +0200 ++++ memcached-1.4.6/configure 2011-03-18 18:43:13.000000000 +0100 +@@ -7914,7 +7914,6 @@ + elif test "$GCC" = "yes" + then + GCC_VERSION=`$CC -dumpversion` +- CFLAGS="$CFLAGS -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls" + case $GCC_VERSION in + 4.4.*) + CFLAGS="$CFLAGS -fno-strict-aliasing" +Index: memcached-1.4.6/thread.c +--- memcached-1.4.6/thread.c.orig 2010-04-03 09:07:16.000000000 +0200 ++++ memcached-1.4.6/thread.c 2011-03-18 18:43:13.000000000 +0100 +@@ -602,6 +602,7 @@ + perror("Can't allocate thread descriptors"); + exit(1); + } ++ memset(threads, 0, sizeof(LIBEVENT_THREAD) * nthreads); + + dispatcher_thread.base = main_base; + dispatcher_thread.thread_id = pthread_self(); diff -r 67e813202d53 -r 16cc9d2eceb2 memcached/memcached.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memcached/memcached.spec Wed Sep 21 14:10:37 2011 +0200 @@ -0,0 +1,181 @@ +## +## memcached.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2011 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package versions +%define V_memcached 1.4.6 +%define V_libmemcached 0.48 +%define V_cache_memcached 1.28 + +# package information +Name: memcached +Summary: Memory Caching Daemon +URL: http://memcached.org/ +Vendor: Brad Fitzpatrick +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: System +License: GPL +Version: %{V_memcached} +Release: 20110716 + +# list of sources +Source0: http://memcached.googlecode.com/files/memcached-%{V_memcached}.tar.gz +Source1: http://download.tangent.org/libmemcached-%{V_libmemcached}.tar.gz +Source2: http://www.cpan.org/authors/id/B/BR/BRADFITZ/Cache-Memcached-%{V_cache_memcached}.tar.gz +Source3: rc.memcached +Patch0: memcached.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make, perl, perl-openpkg +PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: libevent, sasl +PreReq: libevent, sasl + +%description + Memcached is a high-performance, distributed memory object caching + system, generic in nature, but intended for use in speeding up + dynamic web applications by alleviating database load. Additionally, + this package contains Perl and C client APIs to memcached. + +%track + prog memcached:memcached = { + version = %{V_memcached} + url = http://code.google.com/p/memcached/downloads/list + regex = memcached-(\d+(\.\d+)+)\.tar\.gz + } + prog memcached:cache-memcached = { + version = %{V_cache_memcached} + url = http://www.cpan.org/authors/id/B/BR/BRADFITZ/ + regex = Cache-Memcached-(__VER__)\.tar\.gz + } + prog memcached:libmemcached = { + version = %{V_libmemcached} + url = http://tangent.org/552/libmemcached.html + regex = libmemcached-(__VER__)\.tar\.gz + } + +%prep + %setup -q -c + %setup -q -T -D -a 1 + %setup -q -T -D -a 2 + %patch -p0 + +%build + # build daemon + ( cd memcached-%{V_memcached} + libs="" + case "%{l_platform -t}" in + *-linux* ) libs="$libs -lrt" ;; + esac + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + LIBS="$libs" \ + ./configure \ + --prefix=%{l_prefix} \ + --with-libevent=%{l_prefix} \ + --enable-sasl \ + --enable-sasl-pwdb + %{l_make} %{l_mflags -O} + ) || exit $? + + # build C client API + ( cd libmemcached-%{V_libmemcached} + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + ./configure \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ + --without-memcached \ + --enable-libevent \ + --with-libevent-prefix=%{l_prefix} \ + --enable-sasl \ + --with-libsasl2-prefix=%{l_prefix} \ + --without-libinnodb-prefix \ + --disable-shared + %{l_make} %{l_mflags -O} + ) || exit $? + + # build Perl client API + %{l_prefix}/bin/perl-openpkg prepare + %{l_prefix}/bin/perl-openpkg -d Cache-Memcached-%{V_cache_memcached} configure build + +%install + + # install daemon + ( cd memcached-%{V_memcached} + %{l_shtool} mkdir -f -p -m 775 \ + $RPM_BUILD_ROOT%{l_prefix}/bin \ + $RPM_BUILD_ROOT%{l_prefix}/man/man1 + %{l_shtool} install -c -s -m 775 \ + memcached $RPM_BUILD_ROOT%{l_prefix}/bin/ + %{l_shtool} install -c -m 644 \ + doc/memcached.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ + ) || exit $? + + # install C client API + ( cd libmemcached-%{V_libmemcached} + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + ) || exit $? + + # install Perl client API + %{l_prefix}/bin/perl-openpkg -d Cache-Memcached-%{V_cache_memcached} install + %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup + + # install daemon run-command script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.memcached} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install daemon run-command script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/memcached + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} `cat perl-openpkg-files` \ + '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/memcached' + +%files -f files + +%clean + +%post + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} memcached status 2>/dev/null` + [ ".$memcached_active" = .yes ] && %{l_rc} memcached restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} memcached stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/memcached/* >/dev/null 2>&1 || true + exit 0 + diff -r 67e813202d53 -r 16cc9d2eceb2 memcached/rc.memcached --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memcached/rc.memcached Wed Sep 21 14:10:37 2011 +0200 @@ -0,0 +1,63 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.memcached -- Run-Commands +## + +%config + memcached_enable="$openpkg_rc_def" + memcached_daemon="yes" + memcached_flags="-l 127.0.0.1 -p 11211" + memcached_log_prolog="true" + memcached_log_epilog="true" + memcached_log_numfiles="10" + memcached_log_minsize="1M" + memcached_log_complevel="9" + +%common + memcached_pidfile="@l_prefix@/var/memcached/memcached.pid" + memcached_signal () { + [ -f $memcached_pidfile ] && kill -$1 `cat $memcached_pidfile` + } + +%status -u @l_susr@ -o + memcached_usable="unknown" + memcached_active="no" + rcService memcached enable yes && \ + memcached_signal 0 && memcached_active="yes" + echo "memcached_enable=\"$memcached_enable\"" + echo "memcached_usable=\"$memcached_usable\"" + echo "memcached_active=\"$memcached_active\"" + +%start -p 100 -u @l_susr@ + rcService memcached enable yes || exit 0 + rcService memcached active yes && exit 0 + rcVarIsYes memcached_daemon || exit 0 + @l_prefix@/bin/memcached \ + -d -u @l_nusr@ \ + -P $memcached_pidfile \ + $memcached_flags + +%stop -p 900 -u @l_susr@ + rcService memcached enable yes || exit 0 + rcService memcached active no && exit 0 + rcVarIsYes memcached_daemon || exit 0 + memcached_signal TERM + sleep 2 + rm -f $memcached_pidfile >/dev/null 2>&1 || true + +%restart -p 100 -u @l_susr@ + rcService memcached enable yes || exit 0 + rcService memcached active no && exit 0 + rcVarIsYes memcached_daemon || exit 0 + rc memcached stop start + +%daily -u @l_susr@ + rcService memcached enable yes || exit 0 + rcVarIsYes memcached_daemon || exit 0 + shtool rotate -f \ + -n $memcached_log_numfiles -s $memcached_log_minsize -d \ + -z $memcached_log_complevel -m 644 -o @l_nusr@ -g @l_ngrp@ \ + -P "$memcached_log_prolog" \ + -E "$memcached_log_epilog && rc memcached reload" \ + @l_prefix@/var/memcached/memcached.log +