diff options
author | Nishant Limbachia <nishant@mnspace.net> | 2014-11-21 01:23:21 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-11-21 01:28:38 +0700 |
commit | d5093c172a774f6ca08f012dd83f13ce6a1248a2 (patch) | |
tree | 7cbdccbcb0f8e47f2d57ed410c9dff0081b32d32 /network | |
parent | b91f3318e9e0a8f9ceae915f60ef21c7ed2c4420 (diff) | |
download | slackbuilds-d5093c172a774f6ca08f012dd83f13ce6a1248a2.tar.gz |
network/memcached: Updated for version 1.4.21.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/memcached/doinst.sh | 25 | ||||
-rw-r--r-- | network/memcached/memcached.SlackBuild | 11 | ||||
-rw-r--r-- | network/memcached/memcached.info | 6 | ||||
-rw-r--r-- | network/memcached/rc.memcached | 42 |
4 files changed, 77 insertions, 7 deletions
diff --git a/network/memcached/doinst.sh b/network/memcached/doinst.sh new file mode 100644 index 0000000000..0cac982d8c --- /dev/null +++ b/network/memcached/doinst.sh @@ -0,0 +1,25 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +config etc/rc.d/rc.memcached.new diff --git a/network/memcached/memcached.SlackBuild b/network/memcached/memcached.SlackBuild index 812cbbe98f..07f70fb69c 100644 --- a/network/memcached/memcached.SlackBuild +++ b/network/memcached/memcached.SlackBuild @@ -26,9 +26,10 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Originally written by Conrado Ruch Jr conradojr@gmail.com +# Added rc startup script contributed by Miguel De Anda PRGNAM="memcached" -VERSION=${VERSION:-1.4.17} +VERSION=${VERSION:-1.4.21} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -79,7 +80,7 @@ find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -97,13 +98,15 @@ make install-strip DESTDIR=$PKG find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $(find $PKG/usr/man -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done +install -D -m 0644 $CWD/rc.memcached $PKG/etc/rc.d/rc.memcached.new + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog \ - NEWS README.md $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING ChangeLog NEWS README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/memcached/memcached.info b/network/memcached/memcached.info index a7fa25b808..b72cd5534e 100644 --- a/network/memcached/memcached.info +++ b/network/memcached/memcached.info @@ -1,8 +1,8 @@ PRGNAM="memcached" -VERSION="1.4.17" +VERSION="1.4.21" HOMEPAGE="http://memcached.org/" -DOWNLOAD="http://www.memcached.org/files/memcached-1.4.17.tar.gz" -MD5SUM="46402dfbd7faadf6182283dbbd18b1a6" +DOWNLOAD="http://www.memcached.org/files/memcached-1.4.21.tar.gz" +MD5SUM="28e744a6ad14891443a582e7a8a62cdd" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/memcached/rc.memcached b/network/memcached/rc.memcached new file mode 100644 index 0000000000..4cacb097d4 --- /dev/null +++ b/network/memcached/rc.memcached @@ -0,0 +1,42 @@ +#!/bin/sh +# +# /etc/rc.d/rc.memcached - start/stop/restart memcached service. +# Contributed by Miguel De Anda <miguel@thedeanda.com> +# +# Please add this script to rc.local and rc.local_shutdown +# to automatically start and stop the memcached service. +# + +PID="/var/run/memcached.pid" +USER="nobody" + +memcached_start() { + memcached -d -u $USER -P $PID +} + +memcached_stop() { + kill $(cat $PID) +} + +memcached_restart() { + memcached_stop + sleep 2 + memcached_start +} + +case "$1" in + 'start') + memcached_start + ;; + 'stop') + memcached_stop + ;; + 'restart') + memcached_restart + ;; + *) + echo "USAGE: $0 start|stop|restart" + exit 1 + ;; +esac + |