Import package vendor original specs for necessary manipulations.

Wed, 21 Sep 2011 14:10:37 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 21 Sep 2011 14:10:37 +0200
changeset 378
16cc9d2eceb2
parent 377
67e813202d53
child 379
5974eb964eec

Import package vendor original specs for necessary manipulations.

memcached/memcached.patch file | annotate | diff | comparison | revisions
memcached/memcached.spec file | annotate | diff | comparison | revisions
memcached/rc.memcached file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/memcached/memcached.patch	Wed Sep 21 14:10:37 2011 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +Index: libmemcached-0.48/Makefile.in
     1.5 +--- libmemcached-0.48/Makefile.in.orig	2011-03-16 04:40:31.000000000 +0100
     1.6 ++++ libmemcached-0.48/Makefile.in	2011-03-18 18:43:52.000000000 +0100
     1.7 +@@ -95,10 +95,7 @@
     1.8 + 	clients/memerror$(EXEEXT) clients/memflush$(EXEEXT) \
     1.9 + 	clients/memrm$(EXEEXT) clients/memstat$(EXEEXT) \
    1.10 + 	$(am__EXEEXT_1)
    1.11 +-noinst_PROGRAMS = tests/atomsmasher$(EXEEXT) tests/hashplus$(EXEEXT) \
    1.12 +-	tests/memplus$(EXEEXT) tests/startservers$(EXEEXT) \
    1.13 +-	tests/testapp$(EXEEXT) tests/testhashkit$(EXEEXT) \
    1.14 +-	tests/testplus$(EXEEXT) tests/testudp$(EXEEXT) $(am__EXEEXT_3)
    1.15 ++noinst_PROGRAMS = 
    1.16 + check_PROGRAMS = $(am__EXEEXT_2)
    1.17 + @BUILD_DOCS_TRUE@am__append_1 = test-docs
    1.18 + DIST_COMMON = README $(am__configure_deps) \
    1.19 +@@ -138,7 +135,7 @@
    1.20 + @DTRACE_NEEDS_OBJECTS_TRUE@am__append_13 = libmemcached/libmemcached_probes.o
    1.21 + @DTRACE_NEEDS_OBJECTS_TRUE@am__append_14 = libmemcached/libmemcached_probes.o
    1.22 + @HAVE_SASL_TRUE@am__append_15 = $(LIBSASL)
    1.23 +-@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__append_16 = clients/memslap
    1.24 ++@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__append_16 =
    1.25 + @BUILD_BYTEORDER_TRUE@am__append_17 = libmemcached/libbyteorder.la
    1.26 + @INCLUDE_HSIEH_SRC_TRUE@am__append_18 = libhashkit/hsieh.c
    1.27 + @INCLUDE_MURMUR_SRC_TRUE@am__append_19 = libhashkit/murmur.c
    1.28 +@@ -409,7 +406,7 @@
    1.29 + libtest_libtest_la_LIBADD =
    1.30 + am_libtest_libtest_la_OBJECTS = libtest/test.lo
    1.31 + libtest_libtest_la_OBJECTS = $(am_libtest_libtest_la_OBJECTS)
    1.32 +-@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__EXEEXT_1 = clients/memslap$(EXEEXT)
    1.33 ++@BUILD_WIN32_WRAPPERS_FALSE@@HAVE_LIBEVENT_TRUE@am__EXEEXT_1 =
    1.34 + @HAVE_LIBGTEST_TRUE@am__EXEEXT_2 = unittests/unittests$(EXEEXT)
    1.35 + @HAVE_LIBEVENT_TRUE@am__EXEEXT_3 = example/memcached_light$(EXEEXT)
    1.36 + PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
    1.37 +Index: libmemcached-0.48/configure
    1.38 +--- libmemcached-0.48/configure.orig	2011-03-16 04:40:33.000000000 +0100
    1.39 ++++ libmemcached-0.48/configure	2011-03-18 18:43:13.000000000 +0100
    1.40 +@@ -17719,8 +17719,8 @@
    1.41 + 
    1.42 + fi
    1.43 + 
    1.44 +-      CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
    1.45 +-      CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
    1.46 ++      CC_WARNINGS="${BASE_WARNINGS} ${CC_WARNINGS_FULL}"
    1.47 ++      CXX_WARNINGS="${BASE_WARNINGS} -Wnon-virtual-dtor -Wno-long-long ${CXX_WARNINGS_FULL}"
    1.48 + 
    1.49 +       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to use -Wmissing-declarations from C++" >&5
    1.50 + $as_echo_n "checking whether it is safe to use -Wmissing-declarations from C++... " >&6; }
    1.51 +Index: libmemcached-0.48/support/libmemcached.pc.in
    1.52 +--- libmemcached-0.48/support/libmemcached.pc.in.orig	2011-02-22 05:06:22.000000000 +0100
    1.53 ++++ libmemcached-0.48/support/libmemcached.pc.in	2011-03-18 18:43:13.000000000 +0100
    1.54 +@@ -8,3 +8,4 @@
    1.55 + Version: @VERSION@
    1.56 + Libs: @LTLIBSASL@ @LTLIBSASL2@ -L${libdir} -lmemcached
    1.57 + Cflags: -I${includedir}
    1.58 ++Requires: libevent sasl
    1.59 +Index: memcached-1.4.6/configure
    1.60 +--- memcached-1.4.6/configure.orig	2010-04-03 23:26:12.000000000 +0200
    1.61 ++++ memcached-1.4.6/configure	2011-03-18 18:43:13.000000000 +0100
    1.62 +@@ -7914,7 +7914,6 @@
    1.63 + elif test "$GCC" = "yes"
    1.64 + then
    1.65 +   GCC_VERSION=`$CC -dumpversion`
    1.66 +-  CFLAGS="$CFLAGS -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls"
    1.67 +   case $GCC_VERSION in
    1.68 +     4.4.*)
    1.69 +     CFLAGS="$CFLAGS -fno-strict-aliasing"
    1.70 +Index: memcached-1.4.6/thread.c
    1.71 +--- memcached-1.4.6/thread.c.orig	2010-04-03 09:07:16.000000000 +0200
    1.72 ++++ memcached-1.4.6/thread.c	2011-03-18 18:43:13.000000000 +0100
    1.73 +@@ -602,6 +602,7 @@
    1.74 +         perror("Can't allocate thread descriptors");
    1.75 +         exit(1);
    1.76 +     }
    1.77 ++    memset(threads, 0, sizeof(LIBEVENT_THREAD) * nthreads);
    1.78 + 
    1.79 +     dispatcher_thread.base = main_base;
    1.80 +     dispatcher_thread.thread_id = pthread_self();
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/memcached/memcached.spec	Wed Sep 21 14:10:37 2011 +0200
     2.3 @@ -0,0 +1,181 @@
     2.4 +##
     2.5 +##  memcached.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package versions
    2.28 +%define       V_memcached       1.4.6
    2.29 +%define       V_libmemcached    0.48
    2.30 +%define       V_cache_memcached 1.28
    2.31 +
    2.32 +#   package information
    2.33 +Name:         memcached
    2.34 +Summary:      Memory Caching Daemon
    2.35 +URL:          http://memcached.org/
    2.36 +Vendor:       Brad Fitzpatrick
    2.37 +Packager:     OpenPKG Foundation e.V.
    2.38 +Distribution: OpenPKG Community
    2.39 +Class:        EVAL
    2.40 +Group:        System
    2.41 +License:      GPL
    2.42 +Version:      %{V_memcached}
    2.43 +Release:      20110716
    2.44 +
    2.45 +#   list of sources
    2.46 +Source0:      http://memcached.googlecode.com/files/memcached-%{V_memcached}.tar.gz
    2.47 +Source1:      http://download.tangent.org/libmemcached-%{V_libmemcached}.tar.gz
    2.48 +Source2:      http://www.cpan.org/authors/id/B/BR/BRADFITZ/Cache-Memcached-%{V_cache_memcached}.tar.gz
    2.49 +Source3:      rc.memcached
    2.50 +Patch0:       memcached.patch
    2.51 +
    2.52 +#   build information
    2.53 +BuildPreReq:  OpenPKG, openpkg >= 20100101, gcc, make, perl, perl-openpkg
    2.54 +PreReq:       OpenPKG, openpkg >= 20100101
    2.55 +BuildPreReq:  libevent, sasl
    2.56 +PreReq:       libevent, sasl
    2.57 +
    2.58 +%description
    2.59 +    Memcached is a high-performance, distributed memory object caching
    2.60 +    system, generic in nature, but intended for use in speeding up
    2.61 +    dynamic web applications by alleviating database load. Additionally,
    2.62 +    this package contains Perl and C client APIs to memcached.
    2.63 +
    2.64 +%track
    2.65 +    prog memcached:memcached = {
    2.66 +        version   = %{V_memcached}
    2.67 +        url       = http://code.google.com/p/memcached/downloads/list
    2.68 +        regex     = memcached-(\d+(\.\d+)+)\.tar\.gz
    2.69 +    }
    2.70 +    prog memcached:cache-memcached = {
    2.71 +        version   = %{V_cache_memcached}
    2.72 +        url       = http://www.cpan.org/authors/id/B/BR/BRADFITZ/
    2.73 +        regex     = Cache-Memcached-(__VER__)\.tar\.gz
    2.74 +    }
    2.75 +    prog memcached:libmemcached = {
    2.76 +        version   = %{V_libmemcached}
    2.77 +        url       = http://tangent.org/552/libmemcached.html
    2.78 +        regex     = libmemcached-(__VER__)\.tar\.gz
    2.79 +    }
    2.80 +
    2.81 +%prep
    2.82 +    %setup -q -c
    2.83 +    %setup -q -T -D -a 1
    2.84 +    %setup -q -T -D -a 2
    2.85 +    %patch -p0
    2.86 +
    2.87 +%build
    2.88 +    #   build daemon
    2.89 +    ( cd memcached-%{V_memcached}
    2.90 +      libs=""
    2.91 +      case "%{l_platform -t}" in
    2.92 +          *-linux* ) libs="$libs -lrt" ;;
    2.93 +      esac
    2.94 +      CC="%{l_cc}" \
    2.95 +      CFLAGS="%{l_cflags -O}" \
    2.96 +      CPPFLAGS="%{l_cppflags}" \
    2.97 +      LDFLAGS="%{l_ldflags}" \
    2.98 +      LIBS="$libs" \
    2.99 +      ./configure \
   2.100 +          --prefix=%{l_prefix} \
   2.101 +          --with-libevent=%{l_prefix} \
   2.102 +          --enable-sasl \
   2.103 +          --enable-sasl-pwdb
   2.104 +      %{l_make} %{l_mflags -O}
   2.105 +    ) || exit $?
   2.106 +
   2.107 +    #   build C client API
   2.108 +    ( cd libmemcached-%{V_libmemcached}
   2.109 +      CC="%{l_cc}" \
   2.110 +      CFLAGS="%{l_cflags -O}" \
   2.111 +      CPPFLAGS="%{l_cppflags}" \
   2.112 +      LDFLAGS="%{l_ldflags}" \
   2.113 +      ./configure \
   2.114 +          --prefix=%{l_prefix} \
   2.115 +          --mandir=%{l_prefix}/man \
   2.116 +          --without-memcached \
   2.117 +          --enable-libevent \
   2.118 +          --with-libevent-prefix=%{l_prefix} \
   2.119 +          --enable-sasl \
   2.120 +          --with-libsasl2-prefix=%{l_prefix} \
   2.121 +          --without-libinnodb-prefix \
   2.122 +          --disable-shared
   2.123 +      %{l_make} %{l_mflags -O}
   2.124 +    ) || exit $?
   2.125 +
   2.126 +    #   build Perl client API
   2.127 +    %{l_prefix}/bin/perl-openpkg prepare
   2.128 +    %{l_prefix}/bin/perl-openpkg -d Cache-Memcached-%{V_cache_memcached} configure build
   2.129 +
   2.130 +%install
   2.131 +
   2.132 +    #   install daemon
   2.133 +    ( cd memcached-%{V_memcached}
   2.134 +      %{l_shtool} mkdir -f -p -m 775 \
   2.135 +          $RPM_BUILD_ROOT%{l_prefix}/bin \
   2.136 +          $RPM_BUILD_ROOT%{l_prefix}/man/man1
   2.137 +      %{l_shtool} install -c -s -m 775 \
   2.138 +          memcached $RPM_BUILD_ROOT%{l_prefix}/bin/
   2.139 +      %{l_shtool} install -c -m 644 \
   2.140 +          doc/memcached.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
   2.141 +    ) || exit $?
   2.142 +
   2.143 +    #   install C client API
   2.144 +    ( cd libmemcached-%{V_libmemcached}
   2.145 +      %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   2.146 +    ) || exit $?
   2.147 +
   2.148 +    #   install Perl client API
   2.149 +    %{l_prefix}/bin/perl-openpkg -d Cache-Memcached-%{V_cache_memcached} install
   2.150 +    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
   2.151 +
   2.152 +    #   install daemon run-command script
   2.153 +    %{l_shtool} mkdir -f -p -m 755 \
   2.154 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   2.155 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.156 +        %{SOURCE rc.memcached} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.157 +
   2.158 +    #   install daemon run-command script
   2.159 +    %{l_shtool} mkdir -f -p -m 755 \
   2.160 +        $RPM_BUILD_ROOT%{l_prefix}/var/memcached
   2.161 +
   2.162 +    #   determine installation files
   2.163 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.164 +        %{l_files_std} `cat perl-openpkg-files` \
   2.165 +        '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/memcached'
   2.166 +
   2.167 +%files -f files
   2.168 +
   2.169 +%clean
   2.170 +
   2.171 +%post
   2.172 +    #   after upgrade, restart service
   2.173 +    [ $1 -eq 2 ] || exit 0
   2.174 +    eval `%{l_rc} memcached status 2>/dev/null`
   2.175 +    [ ".$memcached_active" = .yes ] && %{l_rc} memcached restart
   2.176 +    exit 0
   2.177 +
   2.178 +%preun
   2.179 +    #   before erase, stop service and remove log files
   2.180 +    [ $1 -eq 0 ] || exit 0
   2.181 +    %{l_rc} memcached stop 2>/dev/null
   2.182 +    rm -f $RPM_INSTALL_PREFIX/var/memcached/* >/dev/null 2>&1 || true
   2.183 +    exit 0
   2.184 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/memcached/rc.memcached	Wed Sep 21 14:10:37 2011 +0200
     3.3 @@ -0,0 +1,63 @@
     3.4 +#!@l_prefix@/bin/openpkg rc
     3.5 +##
     3.6 +##  rc.memcached -- Run-Commands
     3.7 +##
     3.8 +
     3.9 +%config
    3.10 +    memcached_enable="$openpkg_rc_def"
    3.11 +    memcached_daemon="yes"
    3.12 +    memcached_flags="-l 127.0.0.1 -p 11211"
    3.13 +    memcached_log_prolog="true"
    3.14 +    memcached_log_epilog="true"
    3.15 +    memcached_log_numfiles="10"
    3.16 +    memcached_log_minsize="1M"
    3.17 +    memcached_log_complevel="9"
    3.18 +
    3.19 +%common
    3.20 +    memcached_pidfile="@l_prefix@/var/memcached/memcached.pid"
    3.21 +    memcached_signal () {
    3.22 +        [ -f $memcached_pidfile ] && kill -$1 `cat $memcached_pidfile`
    3.23 +    }
    3.24 +
    3.25 +%status -u @l_susr@ -o
    3.26 +    memcached_usable="unknown"
    3.27 +    memcached_active="no"
    3.28 +    rcService memcached enable yes && \
    3.29 +        memcached_signal 0 && memcached_active="yes"
    3.30 +    echo "memcached_enable=\"$memcached_enable\""
    3.31 +    echo "memcached_usable=\"$memcached_usable\""
    3.32 +    echo "memcached_active=\"$memcached_active\""
    3.33 +
    3.34 +%start -p 100 -u @l_susr@
    3.35 +    rcService memcached enable yes || exit 0
    3.36 +    rcService memcached active yes && exit 0
    3.37 +    rcVarIsYes memcached_daemon || exit 0
    3.38 +    @l_prefix@/bin/memcached \
    3.39 +        -d -u @l_nusr@ \
    3.40 +        -P $memcached_pidfile \
    3.41 +        $memcached_flags
    3.42 +
    3.43 +%stop -p 900 -u @l_susr@
    3.44 +    rcService memcached enable yes || exit 0
    3.45 +    rcService memcached active no  && exit 0
    3.46 +    rcVarIsYes memcached_daemon || exit 0
    3.47 +    memcached_signal TERM
    3.48 +    sleep 2
    3.49 +    rm -f $memcached_pidfile >/dev/null 2>&1 || true
    3.50 +
    3.51 +%restart -p 100 -u @l_susr@
    3.52 +    rcService memcached enable yes || exit 0
    3.53 +    rcService memcached active no  && exit 0
    3.54 +    rcVarIsYes memcached_daemon || exit 0
    3.55 +    rc memcached stop start
    3.56 +
    3.57 +%daily -u @l_susr@
    3.58 +    rcService memcached enable yes || exit 0
    3.59 +    rcVarIsYes memcached_daemon || exit 0
    3.60 +    shtool rotate -f \
    3.61 +        -n $memcached_log_numfiles -s $memcached_log_minsize -d \
    3.62 +        -z $memcached_log_complevel -m 644 -o @l_nusr@ -g @l_ngrp@ \
    3.63 +        -P "$memcached_log_prolog" \
    3.64 +        -E "$memcached_log_epilog && rc memcached reload" \
    3.65 +        @l_prefix@/var/memcached/memcached.log
    3.66 +

mercurial