network/memcached: Updated for version 1.4.21.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Nishant Limbachia 2014-11-21 01:23:21 +07:00 committed by Willy Sudiarto Raharjo
parent b91f3318e9
commit d5093c172a
4 changed files with 77 additions and 7 deletions

View file

@ -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

View file

@ -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}

View file

@ -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=""

View file

@ -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