diff options
author | Eric Hameleers <alien@slackware.com> | 2022-01-25 12:44:50 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2022-01-25 12:44:50 +0000 |
commit | d1ca8269cbe1d85e9871a3fee220b26ea95593f5 (patch) | |
tree | 2c9f385f0e92b850fa5059acd3355c587656d5d2 /redis/build/redis.SlackBuild | |
parent | 2478278ab3e8a49c7902d6409b08e20de340029c (diff) | |
download | asb-d1ca8269cbe1d85e9871a3fee220b26ea95593f5.tar.gz asb-d1ca8269cbe1d85e9871a3fee220b26ea95593f5.tar.xz |
redis: fix the SlackBuild to work better with the 6.x releases
Diffstat (limited to '')
-rwxr-xr-x | redis/build/redis.SlackBuild | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/redis/build/redis.SlackBuild b/redis/build/redis.SlackBuild index a315968b..af4d30a8 100755 --- a/redis/build/redis.SlackBuild +++ b/redis/build/redis.SlackBuild @@ -2,6 +2,7 @@ # $Id$ # Copyright 2010 Kuroi Kenshi <kuroi_kenshi96@yahoo.com> # Copyright 2012-2018 Audrius Kaukauskas <audrius@neutrino.lt> +# Copyright 2021 Heinz Wiesinger, Amsterdam, The Netherlands # Copyright 2022 Eric Hameleers, Eindhoven, NL # All rights reserved. # @@ -42,6 +43,8 @@ # # ----------------------------------------------------------------------------- +# Note: redis user:group IDs 198:198 are used in accordance with SBo. + PRGNAM=redis VERSION=${VERSION:-6.2.6} BUILD=${BUILD:-1} @@ -156,6 +159,10 @@ cd ${PRGNAM}-${VERSION} # This messes with Slackware's CFLAGS: sed -e "s|-O3||" -i deps/Makefile deps/hiredis/Makefile +# Use system jemalloc: +cat $SRCDIR/patches/redis-5.0-use-system-jemalloc.patch | patch -p1 --verbose \ + 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log + chown -R root:root . chmod -R u+w,go+r-w,a+rX-st . @@ -164,8 +171,9 @@ export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" -make $NUMJOBS PREFIX=/usr MANDIR=/usr/man 2>&1 | tee $OUTPUT/make-${PRGNAM}.log -make install PREFIX=$PKG/usr MANDIR=$PKG/usr/man DESTDIR=$PKG install \ +make $NUMJOBS BUILD_TLS="yes" PREFIX=/usr MANDIR=/usr/man \ + 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +make install DESTDIR=$PKG BUILD_TLS="yes" PREFIX=$PKG/usr MANDIR=$PKG/usr/man \ 2>&1 | tee $OUTPUT/install-${PRGNAM}.log # Add this to the doinst.sh: @@ -203,6 +211,29 @@ config etc/redis/sentinel.conf.new config etc/logrotate.d/redis.new preserve_perms etc/rc.d/rc.redis.new +# Create redis user/group: +if ! chroot . getent group redis >/dev/null +then + GROUPOPT="-g 198" + if chroot . groupadd \$GROUPOPT redis 2>/dev/null + then + : redis group successfully added + else + chroot . groupadd redis + fi +fi + +if ! chroot . getent passwd redis >/dev/null +then + USEROPT="-u 198" + if chroot . useradd -g redis \$USEROPT -d /var/lib/redis redis 2>/dev/null + then + : redis user successfully added + else + chroot . useradd -g redis -d /var/lib/redis redis + fi +fi + # Update rc.local so that Redis daemon will be started on boot: if ! grep "rc.redis" etc/rc.d/rc.local 1>/dev/null 2>&1 ; then cat <<_EOM_ >> etc/rc.d/rc.local @@ -219,23 +250,29 @@ EOINS # Use sample config and set some sane defaults: install -D -m0644 redis.conf $PKG/etc/redis/redis.conf.new -sed \ +sed -i \ -e 's|^daemonize no|daemonize yes|' \ -e 's|^dir \.|dir /var/lib/redis|' \ -e 's|^logfile ""|logfile /var/log/redis/redis.log|' \ - -i $PKG/etc/redis/redis.conf.new -install -D -m 0644 sentinel.conf $PKG/etc/redis/sentinel.conf.new + -e 's|/var/run/redis_6379.pid|/var/run/redis/redis_6379.pid|' \ + -e 's|/run/redis.sock|/var/run/redis/redis.sock|' \ + -e 's|unixsocketperm 700|unixsocketperm 660|' \ + $PKG/etc/redis/redis.conf.new +install -D -m0644 sentinel.conf $PKG/etc/redis/sentinel.conf.new # Create data directory: mkdir -p $PKG/var/lib/redis -chmod 0700 $PKG/var/lib/redis +chown 198:198 $PKG/var/lib/redis +chmod 0770 $PKG/var/lib/redis # Create log directory: mkdir -p $PKG/var/log/redis +chown root:198 $PKG/var/log/redis +chmod 0775 $PKG/var/log/redis -# Install init script. +# Install init script: mkdir -p $PKG/etc/rc.d -cat $SRCDIR/rc.redis > $PKG/etc/rc.d/rc.redis.new +install -m0644 $SRCDIR/rc.redis $PKG/etc/rc.d/rc.redis.new # Install logrotate script. mkdir -p $PKG/etc/logrotate.d |