mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
network/memcached: Updated for version 1.4.21.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
b91f3318e9
commit
d5093c172a
4 changed files with 77 additions and 7 deletions
25
network/memcached/doinst.sh
Normal file
25
network/memcached/doinst.sh
Normal 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
|
|
@ -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}
|
||||
|
|
|
@ -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=""
|
||||
|
|
42
network/memcached/rc.memcached
Normal file
42
network/memcached/rc.memcached
Normal 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
|
||||
|
Loading…
Reference in a new issue