#!/bin/bash # # valkey.SlackBuild is free software; you can valkeytribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # valkey.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="valkey" PACKAGE_EXT="gz" VERSION=${VERSION:=7.2.5} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" #URL="http://download.valkey.io/releases/$SRC" URL="https://github.com/valkey-io/valkey/archive/refs/tags/${VERSION}.tar.$PACKAGE_EXT" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Use our flags (thanks to SBo) sed "s|-O3||" -i deps/Makefile -i deps/hiredis/Makefile make CFLAGS="$SLKCFLAGS" make PREFIX=$PKG/usr install # Create symlink to start valkey in sentinel mode. ( cd $PKG/usr/bin ; ln -sf valkey-server valkey-sentinel ) # Use sample config and set some sane defaults. mkdir -p $PKG/etc/valkey sed -e 's|^daemonize no|daemonize yes|' \ -e 's|^dir \.|dir /var/lib/valkey|' \ -e 's|^logfile ""|logfile /var/log/valkey/valkey.log|' \ -e 's|^# bind 127.0.0.1|bind 127.0.0.1|' \ -e 's|^tcp-keepalive 0|tcp-keepalive 60|' \ -e 's|^# unixsocket|unixsocket|' \ valkey.conf > $PKG/etc/valkey/valkey.conf.new install -Dm0644 sentinel.conf $PKG/etc/valkey/sentinel.conf.new # Create data directory. install -dm0700 $PKG/var/lib/valkey # Install init script. install -Dm755 $CWD/files/rc.valkey $PKG/etc/rc.d/rc.valkey.new # Install logrotate script. install -Dm644 $CWD/files/valkey.logrotate $PKG/etc/logrotate.d/valkey.new mkdir -p $PKG/var/log/valkey mkdir -p $DOCS cp -a 00-RELEASENOTES BUGS *.md COPYING INSTALL MANIFESTO $DOCS || true fixup_package $PKG set +u # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi