diff --git a/pkg/deb/deb-buildsource.sh b/pkg/deb/deb-buildsource.sh index d4cb5b69e..8ff522f0f 100755 --- a/pkg/deb/deb-buildsource.sh +++ b/pkg/deb/deb-buildsource.sh @@ -26,7 +26,11 @@ cd ../../../ tar -czvf keydb_$version.orig.tar.gz --force-local KeyDB cd KeyDB/pkg/deb/ mkdir -p $pkg_name/tmp -cp -r debian $pkg_name/tmp +if [ "$codename" == "xenial" ]; then + cp -r debian_dh9 $pkg_name/tmp/debian +else + cp -r debian $pkg_name/tmp +fi cp master_changelog $pkg_name/tmp/debian/changelog mv ../../../keydb_$version.orig.tar.gz ./$pkg_name cd $pkg_name/tmp diff --git a/pkg/deb/debian/control b/pkg/deb/debian/control index 597a72e5b..077d493bc 100644 --- a/pkg/deb/debian/control +++ b/pkg/deb/debian/control @@ -6,11 +6,6 @@ Build-Depends: debhelper (>= 9~), dpkg-dev (>= 1.17.5), systemd, -# libhiredis-dev (>= 0.14.0), -# libjemalloc-dev [linux-any], -# liblua5.1-dev, -# lua-bitop-dev, -# lua-cjson-dev, procps , build-essential , tcl , diff --git a/pkg/deb/debian_dh9/NEWS b/pkg/deb/debian_dh9/NEWS new file mode 100644 index 000000000..ec1496c24 --- /dev/null +++ b/pkg/deb/debian_dh9/NEWS @@ -0,0 +1,8 @@ +keydb (4:4.0.2-3) unstable; urgency=medium + + This version drops the Debian-specific support for the + /etc/keydb/keydb-{server,sentinel}.{pre,post}-{up,down}.d directories in + favour of using systemd's ExecStartPre, ExecStartPost, ExecStopPre, + ExecStopPost commands. + + -- Chris Lamb Wed, 11 Oct 2017 22:55:00 -0400 diff --git a/pkg/deb/debian_dh9/bash_completion.d/keydb-cli b/pkg/deb/debian_dh9/bash_completion.d/keydb-cli new file mode 100644 index 000000000..9c39af14d --- /dev/null +++ b/pkg/deb/debian_dh9/bash_completion.d/keydb-cli @@ -0,0 +1,30 @@ +# -*- sh -*- +# +# Bash completion function for the 'keydb-cli' command. +# +# Steve +# -- +# http://www.steve.org.uk +# + +_keydb-cli() +{ + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + # + # All known commands accepted. Sorted. + # + opts='bgrewriteaof bgsave dbsize debug decr decrby del echo exists expire expireat flushall flushdb get getset incr incrby info keys lastsave lindex llen lpop lpush lrange lrem lset ltrim mget move mset msetnx ping randomkey rename renamenx rewriteaof rpop rpoplpush rpush sadd save scard sdiff sdiffstore select set setnx shutdown sinter sinterstore sismember slaveof smembers smove sort spop srandmember srem sunion sunionstore ttl type zadd zcard zincrby zrange zrangebyscore zrem zremrangebyscore zrevrange zscore' + + # + # Only complete on the first term. + # + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi + +} +complete -F _keydb-cli keydb-cli diff --git a/pkg/deb/debian_dh9/bin/generate-systemd-service-files b/pkg/deb/debian_dh9/bin/generate-systemd-service-files new file mode 100755 index 000000000..59031d99f --- /dev/null +++ b/pkg/deb/debian_dh9/bin/generate-systemd-service-files @@ -0,0 +1,131 @@ +#!/bin/sh + +SYSTEMD_VER=$(systemctl --version | head -1 | cut -d' ' -f2) + +if [ ${SYSTEMD_VER} -lt 237 ] +then + SYSTEMD_EXTRA="" +else + SYSTEMD_EXTRA=$(cat <${TARGET} + + if [ "${MODE}" = "templated" ] + then + cat >> ${TARGET} < Mon, 09 Oct 2017 22:17:24 +0100 +EOF + fi + + cat >> ${TARGET} <> "${TARGET}" + fi + done +done diff --git a/pkg/deb/debian_dh9/changelog b/pkg/deb/debian_dh9/changelog new file mode 100644 index 000000000..064a32071 --- /dev/null +++ b/pkg/deb/debian_dh9/changelog @@ -0,0 +1,32 @@ +keydb (5:5.3.3-1~bionic1) bionic; urgency=medium + + * 5.3.3 Updating deb source package and naming convention. + + -- Ben Schermel Fri, 25 Oct 2019 8:00:37 +0000 + +keydb (5:5.1.12-1chl1~bionic1) bionic; urgency=medium + + * 5.1.1 update. This update fixes several rare deadlock scenarios. Deadlock detection is also added. + + -- Ben Schermel Fri, 25 Oct 2019 8:00:37 +0000 + + +keydb (5:5.1.11-1chl1~bionic1) bionic; urgency=medium + + * 5.1 release. This release includes subkey expires (EXPIREMEMBER/EXPIREMEMBERAT), with updates to PTTL/TTL accordingly. New OBJECT LASTMODIFIED, BITIOP LSHIFT & BITOP RSHIFT commands. See https://docs.keydb.dev/blog/2019/10/20/blog-post/ for detailed review of release. + + -- Ben Schermel Mon, 21 Oct 2019 8:00:37 +0000 + + +keydb (5:5.0.1-1chl1~bionic1) bionic; urgency=medium + + * Arm build now included for bionic package + + -- Ben Schermel Wed, 21 Aug 2019 22:58:37 +0000 + + +keydb (5:5.0.0-1chl1~bionic1) bionic; urgency=medium + + * Initial release of KeyDB PPA. This PPA was originally derived from https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server + + -- Ben Schermel Wed, 21 Aug 2019 2:58:37 +0000 diff --git a/pkg/deb/debian_dh9/compat b/pkg/deb/debian_dh9/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/pkg/deb/debian_dh9/compat @@ -0,0 +1 @@ +9 diff --git a/pkg/deb/debian_dh9/control b/pkg/deb/debian_dh9/control new file mode 100644 index 000000000..077d493bc --- /dev/null +++ b/pkg/deb/debian_dh9/control @@ -0,0 +1,77 @@ +Source: keydb +Section: database +Priority: optional +Maintainer: Ben Schermel +Build-Depends: + debhelper (>= 9~), + dpkg-dev (>= 1.17.5), + systemd, + procps , + build-essential , + tcl , + tcl-dev , + uuid-dev , + libcurl4-openssl-dev , + nasm , + autotools-dev , + autoconf , + libjemalloc-dev , + libssl-dev +Standards-Version: 4.2.1 +Homepage: https://docs.keydb.dev/ +Vcs-Git: https://github.com/JohnSully/KeyDB.git +Vcs-Browser: https://github.com/JohnSully/KeyDB + +Package: keydb +Architecture: all +Depends: + keydb-server (<< ${binary:Version}.1~), + keydb-server (>= ${binary:Version}), + ${misc:Depends}, +Description: Persistent key-value database with network interface (metapackage) + keydb is a key-value database in a similar vein to memcache but the dataset + is non-volatile. keydb additionally provides native support for atomically + manipulating and querying data structures such as lists and sets. + . + The dataset is stored entirely in memory and periodically flushed to disk. + . + This package depends on the keydb-server package. + +Package: keydb-sentinel +Architecture: any +Depends: + lsb-base (>= 3.2-14), + keydb-tools (= ${binary:Version}), + ${misc:Depends}, +Description: Persistent key-value database with network interface (monitoring) + keydb is a key-value database in a similar vein to memcache but the dataset + is non-volatile. keydb additionally provides native support for atomically + manipulating and querying data structures such as lists and sets. + . + This package contains the keydb Sentinel monitoring software. + +Package: keydb-server +Architecture: any +Depends: + lsb-base (>= 3.2-14), + keydb-tools (= ${binary:Version}), + ${misc:Depends}, +Description: Persistent key-value database with network interface + keydb is a key-value database in a similar vein to memcache but the dataset + is non-volatile. keydb additionally provides native support for atomically + manipulating and querying data structures such as lists and sets. + . + The dataset is stored entirely in memory and periodically flushed to disk. + +Package: keydb-tools +Architecture: any +Depends: + adduser, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Persistent key-value database with network interface (client) + keydb is a key-value database in a similar vein to memcache but the dataset + is non-volatile. keydb additionally provides native support for atomically + manipulating and querying data structures such as lists and sets. + . + This package contains the command line client and other tools. diff --git a/pkg/deb/debian_dh9/copyright b/pkg/deb/debian_dh9/copyright new file mode 100644 index 000000000..59975672f --- /dev/null +++ b/pkg/deb/debian_dh9/copyright @@ -0,0 +1,134 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Contact: John Sully +Upstream-Name: keydb +Source: https://github.com/JohnSully/KeyDB + +Files: * +Copyright: © 2006-2014 Salvatore Sanfilippo +Copyright © 2019, John Sully +License: BSD-3-clause + +Files: + src/rio.* + src/t_zset.c + src/ziplist.h + src/intset.* + src/redis-check-aof.c + deps/hiredis/* + deps/linenoise/* +Copyright: + © 2009-2012 Pieter Noordhuis + © 2009-2012 Salvatore Sanfilippo +License: BSD-3-clause + +Files: + src/lzf.h + src/lzfP.h + src/lzf_d.c + src/lzf_c.c +Copyright: + © 2000-2007 Marc Alexander Lehmann + © 2009-2012 Salvatore Sanfilippo +License: BSD-2-clause + +Files: src/setproctitle.c +Copyright: + © 2010 William Ahern + © 2013 Salvatore Sanfilippo + © 2013 Stam He +License: BSD-3-clause + +Files: src/ae_evport.c +Copyright: © 2012 Joyent, Inc. +License: BSD-3-clause + +Files: src/ae_kqueue.c +Copyright: © 2009 Harish Mallipeddi +License: BSD-3-clause + +Files: utils/install_server.sh +Copyright: © 2011 Dvir Volk +License: BSD-3-clause + +Files: deps/jemalloc/* +Copyright: + © 2002-2012 Jason Evans + © 2007-2012 Mozilla Foundation + © 2009-2012 Facebook, Inc. +License: BSD-3-clause + +Files: src/pqsort.* +Copyright: © 1992-1993 The Regents of the University of California +License: BSD-3-clause + +Files: deps/lua/* +Copyright: © 1994-2012 Lua.org, PUC-Ri +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +Files: debian/* +Copyright: © 2009 Chris Lamb +License: BSD-3-clause + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Redis nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/deb/debian_dh9/files b/pkg/deb/debian_dh9/files new file mode 100644 index 000000000..0c2ad5610 --- /dev/null +++ b/pkg/deb/debian_dh9/files @@ -0,0 +1 @@ +keydb_5.3.3-1~bionic1_source.buildinfo database optional diff --git a/pkg/deb/debian_dh9/gbp.conf b/pkg/deb/debian_dh9/gbp.conf new file mode 100644 index 000000000..24e95b172 --- /dev/null +++ b/pkg/deb/debian_dh9/gbp.conf @@ -0,0 +1,3 @@ +[DEFAULT] +debian-branch=debian/sid +upstream-branch=upstream/sid diff --git a/pkg/deb/debian_dh9/keydb-benchmark.1 b/pkg/deb/debian_dh9/keydb-benchmark.1 new file mode 100644 index 000000000..ce9f119b4 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-benchmark.1 @@ -0,0 +1,68 @@ +.TH KEYDB-BENCHMARK 1 "August 17, 2019" +.SH NAME +keydb-benchmark \- Benechmark a KeyDB instance +.SH SYNOPSIS +.B redis-benchmark +[\-h ] [\-p ] [\-c ] [\-n [\-k ] +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.SH OPTIONS +.TP +\-h hostname +Server hostname (default 127.0.0.1) +.TP +\-p port +Server port (default 6379) +.TP +\-s socket +Server socket (overrides host and port) +.TP +\-a password +Password for KeyDB Auth +.TP +\-c clients +Number of parallel connections (default 50) +.TP +\-n requests +Total number of requests (default 100000) +.TP +\-d size +Data size of SET/GET value in bytes (default 2) +.TP +\-dbnum db +SELECT the specified db number (default 0) +.TP +\-k boolean +1=keep alive 0=reconnect (default 1) +.TP +\-r keyspacelen +Use random keys for SET/GET/INCR, random values for SADD Using this option the +benchmark will get/set keys in the form mykey_rand000000012456 instead of +constant keys, the argument determines the max number of values +for the random number. For instance if set to 10 only rand000000000000 - +rand000000000009 range will be allowed. +.TP +\-P numreq +Pipeline requests. Default 1 (no pipeline). +.TP +\-q +Quiet. Just show query/sec values +.TP +\-\-csv +Ourput in CSV format +.TP +\-l +Loop. Run the tests forever +.TP +\-I +Idle mode. Just open N idle connections and wait. +.TP +\-D +Debug mode. more verbose. +.SH AUTHOR +\fBkeydb-benchmark\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-check-aof.1 b/pkg/deb/debian_dh9/keydb-check-aof.1 new file mode 100644 index 000000000..1eec05a3c --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-check-aof.1 @@ -0,0 +1,17 @@ +.TH KEYDB-CHECK-AOF 1 "August 17, 2019" +.SH NAME +keydb-check-aof \- Check integrity of a KeyDB .AOF file +.SH SYNOPSIS +.B keydb-check-aof +filename +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.PP +This utility checks the integrity of a dumped .AOF file. +.SH AUTHOR +\fBkeydb-check-aof\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-check-rdb.1 b/pkg/deb/debian_dh9/keydb-check-rdb.1 new file mode 100644 index 000000000..000b7a513 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-check-rdb.1 @@ -0,0 +1,17 @@ +.TH KEYDB-CHECK-RDB 1 "August 17, 2019" +.SH NAME +keydb-check-rdb \- Check integrity of KeyDB dumped database file +.SH SYNOPSIS +.B keydb-check-rdb +filename +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.PP +This utility checks the integrity of a dumped database file. +.SH AUTHOR +\fBredis-check-rdb\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-cli.1 b/pkg/deb/debian_dh9/keydb-cli.1 new file mode 100644 index 000000000..682f91938 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-cli.1 @@ -0,0 +1,19 @@ +.TH KEYDB-CLI 1 "August 17, 2019" +.SH NAME +keydb-cli \- Command-line client to keydb-server +.SH SYNOPSIS +.B keydb-cli +.RI [options] +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.PP +\fBkeydb-cli\fP provides a simple command-line interface to a KeyDB server. +.SH OPTIONS +See \fBkeydb-doc\fP for more information on the commands KeyDB accepts. +.SH AUTHOR +\fBkeydb-cli\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-sentinel.1 b/pkg/deb/debian_dh9/keydb-sentinel.1 new file mode 100644 index 000000000..782a40ff4 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.1 @@ -0,0 +1,23 @@ +.TH KEYDB-SENTINEL 1 "August 17, 2019" +.SH NAME +keydb-sentinel \- Persistent key-value database (cluster mode) +.SH SYNOPSIS +.B keydb-sentinel +.RI configfile +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.PP +.SH OPTIONS +.IP "configfile" +Read options from specified configuration file. +.SH NOTES +On Debian GNU/Linux systems, \fBkeydb-sentinel\fP is typically started via the +\fB/etc/init.d/keydb-sentinel\fP initscript, not manually. This defaults to using +\fB/etc/keydb/sentinel.conf\fP as a configuration file. +.SH AUTHOR +\fBkeydb-sentinel\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-sentinel.default b/pkg/deb/debian_dh9/keydb-sentinel.default new file mode 100755 index 000000000..05a3b73b0 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.default @@ -0,0 +1,8 @@ +# keydb-sentinel configure options + +# ULIMIT: Call ulimit -n with this argument prior to invoking KeyDB Sentinel +# itself. This may be required for high-concurrency environments. KeyDB +# Sentinel itself cannot alter its limits as it is not being run as root. +# (default: 65536) +# +ULIMIT=65536 diff --git a/pkg/deb/debian_dh9/keydb-sentinel.init b/pkg/deb/debian_dh9/keydb-sentinel.init new file mode 100755 index 000000000..1ec8b9a95 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.init @@ -0,0 +1,89 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: keydb-sentinel +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs +# Should-Start: $local_fs +# Should-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: keydb-sentinel - Persistent key-value db monitor +# Description: keydb-sentinel - Persistent key-value db monitor +### END INIT INFO + + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/keydb-sentinel +DAEMON_ARGS=/etc/keydb/sentinel.conf +NAME=keydb-sentinel +DESC=keydb-sentinel + +RUNDIR=/var/run/sentinel +PIDFILE=$RUNDIR/keydb-sentinel.pid + +test -x $DAEMON || exit 0 + +if [ -r /etc/default/$NAME ] +then + . /etc/default/$NAME +fi + +. /lib/lsb/init-functions + +set -e + +if [ "$(id -u)" != "0" ] +then + log_failure_msg "Must be run as root." + exit 1 +fi + +case "$1" in + start) + echo -n "Starting $DESC: " + mkdir -p $RUNDIR + touch $PIDFILE + chown keydb:keydb $RUNDIR $PIDFILE + chmod 755 $RUNDIR + + if [ -n "$ULIMIT" ] + then + ulimit -n $ULIMIT || true + fi + + if start-stop-daemon --start --quiet --oknodo --umask 007 --pidfile $PIDFILE --chuid keydb:keydb --exec $DAEMON -- $DAEMON_ARGS + then + echo "$NAME." + else + echo "failed" + fi + ;; + stop) + echo -n "Stopping $DESC: " + + if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON + then + echo "$NAME." + else + echo "failed" + fi + rm -f $PIDFILE + sleep 1 + ;; + + restart|force-reload) + ${0} stop + ${0} start + ;; + + status) + status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} + ;; + + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-sentinel.install b/pkg/deb/debian_dh9/keydb-sentinel.install new file mode 100644 index 000000000..600ef543c --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.install @@ -0,0 +1,2 @@ +debian/keydb-sentinel.service /lib/systemd/system +pkg/deb/conf/sentinel.conf /etc/keydb diff --git a/pkg/deb/debian_dh9/keydb-sentinel.logrotate b/pkg/deb/debian_dh9/keydb-sentinel.logrotate new file mode 100644 index 000000000..185010396 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.logrotate @@ -0,0 +1,7 @@ +/var/log/keydb/keydb-sentinel*.log { + weekly + missingok + rotate 12 + compress + notifempty +} diff --git a/pkg/deb/debian_dh9/keydb-sentinel.maintscript b/pkg/deb/debian_dh9/keydb-sentinel.maintscript new file mode 100644 index 000000000..87e4f024c --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.maintscript @@ -0,0 +1,4 @@ +rm_conffile /etc/keydb/keydb-sentinel.post-down.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-sentinel.post-up.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-sentinel.pre-down.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-sentinel.pre-up.d/00_example 4:4.0.2-3~ diff --git a/pkg/deb/debian_dh9/keydb-sentinel.manpages b/pkg/deb/debian_dh9/keydb-sentinel.manpages new file mode 100644 index 000000000..1b3d9d4a1 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.manpages @@ -0,0 +1 @@ +debian/keydb-sentinel.1 diff --git a/pkg/deb/debian_dh9/keydb-sentinel.postinst b/pkg/deb/debian_dh9/keydb-sentinel.postinst new file mode 100644 index 000000000..0c856c5c5 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -eu + +USER="keydb" +GROUP="$USER" +CONFFILE="/etc/keydb/sentinel.conf" + +if [ "$1" = "configure" ] +then + if ! dpkg-statoverride --list ${CONFFILE} >/dev/null 2>&1 + then + dpkg-statoverride --update --add ${USER} ${GROUP} 640 ${CONFFILE} + fi +fi + +#DEBHELPER# + +if [ "$1" = "configure" ] +then + find /etc/keydb -maxdepth 1 -type d -name 'keydb-sentinel.*.d' -empty -delete +fi + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-sentinel.postrm b/pkg/deb/debian_dh9/keydb-sentinel.postrm new file mode 100644 index 000000000..2e9f62888 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-sentinel.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -eu + +CONFFILE="/etc/keydb/sentinel.conf" + +if [ "$1" = "purge" ] +then + dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2 +fi + +#DEBHELPER# + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-server.1 b/pkg/deb/debian_dh9/keydb-server.1 new file mode 100644 index 000000000..2bac395f8 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.1 @@ -0,0 +1,23 @@ +.TH KEYDB-SERVER 1 "August 17, 2019" +.SH NAME +keydb-server \- Persistent key-value database +.SH SYNOPSIS +.B keydb-server +.RI configfile +.SH DESCRIPTION +KeyDB is a key-value database. It is similar to memcached but the dataset is +not volatile and other datatypes (such as lists and sets) are natively +supported. +.PP +.SH OPTIONS +.IP "configfile" +Read options from specified configuration file. +.SH NOTES +On Debian GNU/Linux systems, \fBkeydb-server\fP is typically started via the +\fB/etc/init.d/keydb-server\fP initscript, not manually. This defaults to using +\fB/etc/keydb/keydb.conf\fP as a configuration file. +.SH AUTHOR +\fBkeydb-server\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo. +.PP +This manual page was written by Chris Lamb for the Debian +project (but may be used by others). Modified by Ben Schermel diff --git a/pkg/deb/debian_dh9/keydb-server.default b/pkg/deb/debian_dh9/keydb-server.default new file mode 100755 index 000000000..9288682fa --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.default @@ -0,0 +1,7 @@ +# keydb-server configure options + +# ULIMIT: Call ulimit -n with this argument prior to invoking Redis itself. +# This may be required for high-concurrency environments. KeyDB itself cannot +# alter its limits as it is not being run as root. (default: 65536) +# +ULIMIT=65536 diff --git a/pkg/deb/debian_dh9/keydb-server.docs b/pkg/deb/debian_dh9/keydb-server.docs new file mode 100644 index 000000000..b43bf86b5 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.docs @@ -0,0 +1 @@ +README.md diff --git a/pkg/deb/debian_dh9/keydb-server.init b/pkg/deb/debian_dh9/keydb-server.init new file mode 100755 index 000000000..4d0de9149 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.init @@ -0,0 +1,89 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: keydb-server +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs +# Should-Start: $local_fs +# Should-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: keydb-server - Persistent key-value db +# Description: keydb-server - Persistent key-value db +### END INIT INFO + + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/keydb-server +DAEMON_ARGS=/etc/keydb/keydb.conf +NAME=keydb-server +DESC=keydb-server + +RUNDIR=/var/run/keydb +PIDFILE=$RUNDIR/keydb-server.pid + +test -x $DAEMON || exit 0 + +if [ -r /etc/default/$NAME ] +then + . /etc/default/$NAME +fi + +. /lib/lsb/init-functions + +set -e + +if [ "$(id -u)" != "0" ] +then + log_failure_msg "Must be run as root." + exit 1 +fi + +case "$1" in + start) + echo -n "Starting $DESC: " + mkdir -p $RUNDIR + touch $PIDFILE + chown keydb:keydb $RUNDIR $PIDFILE + chmod 755 $RUNDIR + + if [ -n "$ULIMIT" ] + then + ulimit -n $ULIMIT || true + fi + + if start-stop-daemon --start --quiet --oknodo --umask 007 --pidfile $PIDFILE --chuid keydb:keydb --exec $DAEMON -- $DAEMON_ARGS + then + echo "$NAME." + else + echo "failed" + fi + ;; + stop) + echo -n "Stopping $DESC: " + + if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON + then + echo "$NAME." + else + echo "failed" + fi + rm -f $PIDFILE + sleep 1 + ;; + + restart|force-reload) + ${0} stop + ${0} start + ;; + + status) + status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} + ;; + + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-server.install b/pkg/deb/debian_dh9/keydb-server.install new file mode 100644 index 000000000..1b86989b1 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.install @@ -0,0 +1,2 @@ +debian/keydb-server.service /lib/systemd/system +pkg/deb/conf/keydb.conf /etc/keydb diff --git a/pkg/deb/debian_dh9/keydb-server.logrotate b/pkg/deb/debian_dh9/keydb-server.logrotate new file mode 100644 index 000000000..78d0a53ea --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.logrotate @@ -0,0 +1,7 @@ +/var/log/keydb/keydb-server*.log { + weekly + missingok + rotate 12 + compress + notifempty +} diff --git a/pkg/deb/debian_dh9/keydb-server.maintscript b/pkg/deb/debian_dh9/keydb-server.maintscript new file mode 100644 index 000000000..d6ccfe60c --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.maintscript @@ -0,0 +1,4 @@ +rm_conffile /etc/keydb/keydb-server.post-down.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-server.post-up.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-server.pre-down.d/00_example 4:4.0.2-3~ +rm_conffile /etc/keydb/keydb-server.pre-up.d/00_example 4:4.0.2-3~ diff --git a/pkg/deb/debian_dh9/keydb-server.manpages b/pkg/deb/debian_dh9/keydb-server.manpages new file mode 100644 index 000000000..3935e22fd --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.manpages @@ -0,0 +1 @@ +debian/keydb-server.1 diff --git a/pkg/deb/debian_dh9/keydb-server.postinst b/pkg/deb/debian_dh9/keydb-server.postinst new file mode 100644 index 000000000..b53ce4142 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -eu + +USER="keydb" +GROUP="$USER" +CONFFILE="/etc/keydb/keydb.conf" + +if [ "$1" = "configure" ] +then + if ! dpkg-statoverride --list ${CONFFILE} >/dev/null 2>&1 + then + dpkg-statoverride --update --add ${USER} ${GROUP} 640 ${CONFFILE} + fi +fi + +#DEBHELPER# + +if [ "$1" = "configure" ] +then + find /etc/keydb -maxdepth 1 -type d -name 'keydb-server.*.d' -empty -delete +fi + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-server.postrm b/pkg/deb/debian_dh9/keydb-server.postrm new file mode 100644 index 000000000..16ef23bd7 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-server.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -eu + +CONFFILE="/etc/keydb/keydb.conf" + +if [ "${1}" = "purge" ] +then + dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2 +fi + +#DEBHELPER# + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-tools.examples b/pkg/deb/debian_dh9/keydb-tools.examples new file mode 100644 index 000000000..7f796a1b4 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-tools.examples @@ -0,0 +1,2 @@ +src/redis-trib.rb +utils/lru diff --git a/pkg/deb/debian_dh9/keydb-tools.install b/pkg/deb/debian_dh9/keydb-tools.install new file mode 100644 index 000000000..dc838bb71 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-tools.install @@ -0,0 +1,6 @@ +debian/bash_completion.d/* /usr/share/bash-completion/completions +src/keydb-server /usr/bin +src/keydb-benchmark /usr/bin +src/keydb-check-aof /usr/bin +src/keydb-check-rdb /usr/bin +src/keydb-cli /usr/bin diff --git a/pkg/deb/debian_dh9/keydb-tools.manpages b/pkg/deb/debian_dh9/keydb-tools.manpages new file mode 100644 index 000000000..bfe26d2d6 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-tools.manpages @@ -0,0 +1,4 @@ +debian/keydb-benchmark.1 +debian/keydb-check-aof.1 +debian/keydb-check-rdb.1 +debian/keydb-cli.1 diff --git a/pkg/deb/debian_dh9/keydb-tools.postinst b/pkg/deb/debian_dh9/keydb-tools.postinst new file mode 100644 index 000000000..0007d887f --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-tools.postinst @@ -0,0 +1,47 @@ +#!/bin/sh + +set -eu + +USER="keydb" + +Setup_dir () { + DIR="${1}" + MODE="${2}" + GROUP="${3}" + + mkdir -p ${DIR} + + case "${DIR}" in + /var/log/keydb) + MODE="02750" + GROUP="adm" + ;; + *) + MODE="750" + GROUP="${USER}" + ;; + esac + + if ! dpkg-statoverride --list ${DIR} >/dev/null 2>&1 + then + chown ${USER}:${GROUP} ${DIR} + chmod ${MODE} ${DIR} + fi +} + +if [ "$1" = "configure" ] +then + adduser \ + --system \ + --home /var/lib/keydb \ + --quiet \ + --group \ + ${USER} || true + + Setup_dir /var/log/keydb ${USER}:adm 2750 + Setup_dir /var/lib/keydb ${USER}:${USER} 750 +fi + +#DEBHELPER# + +exit 0 diff --git a/pkg/deb/debian_dh9/keydb-tools.postrm b/pkg/deb/debian_dh9/keydb-tools.postrm new file mode 100644 index 000000000..60c932435 --- /dev/null +++ b/pkg/deb/debian_dh9/keydb-tools.postrm @@ -0,0 +1,13 @@ +#!/bin/sh + +set -eu + +if [ "${1}" = "purge" ] +then + userdel keydb || true + rm -rf /var/lib/keydb /var/log/keydb +fi + +#DEBHELPER# + +exit 0 diff --git a/pkg/deb/debian_dh9/patches/0001-fix-ftbfs-on-kfreebsd.patch b/pkg/deb/debian_dh9/patches/0001-fix-ftbfs-on-kfreebsd.patch new file mode 100644 index 000000000..65c155215 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/0001-fix-ftbfs-on-kfreebsd.patch @@ -0,0 +1,21 @@ +From: Chris Lamb +Date: Fri, 30 Oct 2015 10:53:42 +0000 +Subject: fix-ftbfs-on-kfreebsd + +--- + src/fmacros.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fmacros.h b/src/fmacros.h +index 6e56c75..d490aec 100644 +--- a/src/fmacros.h ++++ b/src/fmacros.h +@@ -41,7 +41,7 @@ + #define _ALL_SOURCE + #endif + +-#if defined(__linux__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__OpenBSD__) || defined(__GLIBC__) + #define _XOPEN_SOURCE 700 + /* + * On NetBSD, _XOPEN_SOURCE undefines _NETBSD_SOURCE and diff --git a/pkg/deb/debian_dh9/patches/0007-Add-support-for-a-USE_SYSTEM_HIREDIS-flag.patch b/pkg/deb/debian_dh9/patches/0007-Add-support-for-a-USE_SYSTEM_HIREDIS-flag.patch new file mode 100644 index 000000000..8e59cc144 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/0007-Add-support-for-a-USE_SYSTEM_HIREDIS-flag.patch @@ -0,0 +1,84 @@ +From: Chris Lamb +Date: Wed, 3 Oct 2018 19:24:16 +0100 +Subject: Add support for a USE_SYSTEM_HIREDIS flag. + +--- + deps/Makefile | 2 ++ + src/Makefile | 19 ++++++++++++++----- + 2 files changed, 16 insertions(+), 5 deletions(-) + +diff --git a/deps/Makefile b/deps/Makefile +index 2ed7736..d6b8e3e 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -33,7 +33,9 @@ ifneq ($(shell sh -c '[ -f .make-ldflags ] && cat .make-ldflags || echo none'), + endif + + distclean: ++ifneq ($(USE_SYSTEM_HIREDIS),yes) + -(cd hiredis && $(MAKE) clean) > /dev/null || true ++endif + -(cd linenoise && $(MAKE) clean) > /dev/null || true + ifneq ($(USE_SYSTEM_LUA),yes) + -(cd lua && $(MAKE) clean) > /dev/null || true +diff --git a/src/Makefile b/src/Makefile +index 49085f2..9e7e6f1 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh') + uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') + uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') + OPTIMIZATION?=-O2 +-DEPENDENCY_TARGETS=hiredis linenoise ++DEPENDENCY_TARGETS=linenoise + NODEPS:=clean distclean + + # Default settings +@@ -107,7 +107,7 @@ endif + endif + endif + # Include paths to dependencies +-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise ++FINAL_CFLAGS+= -I../deps/linenoise + + ifeq ($(MALLOC),tcmalloc) + FINAL_CFLAGS+= -DUSE_TCMALLOC +@@ -139,6 +139,15 @@ else + FINAL_LIBS := ../deps/lua/src/liblua.a $(FINAL_LIBS) + endif + ++ifeq ($(USE_SYSTEM_HIREDIS),yes) ++ FINAL_LIBS+= -lhiredis ++ FINAL_CFLAGS+= -I/usr/include/hiredis ++else ++ DEPENDENCY_TARGETS += hiredis ++ FINAL_LIBS+= ../deps/hiredis/libhiredis.a ++ FINAL_CFLAGS+= -I../deps/hiredis ++endif ++ + REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) $(CPPFLAGS) + REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS) + REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL) +@@ -210,7 +219,7 @@ endif + + # redis-server + $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ) +- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS) ++ $(REDIS_LD) -o $@ $^ $(FINAL_LIBS) + + # redis-sentinel + $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME) +@@ -226,11 +235,11 @@ $(REDIS_CHECK_AOF_NAME): $(REDIS_SERVER_NAME) + + # redis-cli + $(REDIS_CLI_NAME): $(REDIS_CLI_OBJ) +- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/linenoise/linenoise.o $(FINAL_LIBS) ++ $(REDIS_LD) -o $@ $^ ../deps/linenoise/linenoise.o $(FINAL_LIBS) + + # redis-benchmark + $(REDIS_BENCHMARK_NAME): $(REDIS_BENCHMARK_OBJ) +- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS) ++ $(REDIS_LD) -o $@ $^ $(FINAL_LIBS) + + dict-benchmark: dict.c zmalloc.c sds.c siphash.c + $(REDIS_CC) $(FINAL_CFLAGS) $^ -D DICT_BENCHMARK_MAIN -o $@ $(FINAL_LIBS) diff --git a/pkg/deb/debian_dh9/patches/0010-Add-support-for-USE_SYSTEM_JEMALLOC-flag.patch b/pkg/deb/debian_dh9/patches/0010-Add-support-for-USE_SYSTEM_JEMALLOC-flag.patch new file mode 100644 index 000000000..d7f8b2d1e --- /dev/null +++ b/pkg/deb/debian_dh9/patches/0010-Add-support-for-USE_SYSTEM_JEMALLOC-flag.patch @@ -0,0 +1,107 @@ +From: Chris Lamb +Date: Sat, 25 Aug 2018 17:52:13 +0200 +Subject: Add support for USE_SYSTEM_JEMALLOC flag. + +https://github.com/antirez/redis/pull/5279 +--- + deps/Makefile | 2 ++ + src/Makefile | 5 +++++ + src/object.c | 5 +++++ + src/zmalloc.c | 10 ++++++++++ + src/zmalloc.h | 4 ++++ + 5 files changed, 26 insertions(+) + +diff --git a/deps/Makefile b/deps/Makefile +index eb35c1e..1342fac 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -36,7 +36,9 @@ distclean: + -(cd hiredis && $(MAKE) clean) > /dev/null || true + -(cd linenoise && $(MAKE) clean) > /dev/null || true + -(cd lua && $(MAKE) clean) > /dev/null || true ++ifneq ($(USE_SYSTEM_JEMALLOC),yes) + -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true ++endif + -(rm -f .make-*) + + .PHONY: distclean +diff --git a/src/Makefile b/src/Makefile +index 0ff6e8b..51363fe 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -120,10 +120,15 @@ ifeq ($(MALLOC),tcmalloc_minimal) + endif + + ifeq ($(MALLOC),jemalloc) ++ifeq ($(USE_SYSTEM_JEMALLOC),yes) ++ FINAL_CFLAGS+= -DUSE_JEMALLOC -I/usr/include/jemalloc/include ++ FINAL_LIBS := -ljemalloc $(FINAL_LIBS) ++else + DEPENDENCY_TARGETS+= jemalloc + FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include + FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) + endif ++endif + + REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) $(CPPFLAGS) + REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS) +diff --git a/src/object.c b/src/object.c +index 6987e1e..e49c2c2 100644 +--- a/src/object.c ++++ b/src/object.c +@@ -36,6 +36,11 @@ + #define strtold(a,b) ((long double)strtod((a),(b))) + #endif + ++#if defined(USE_JEMALLOC) && (USE_SYSTEM_JEMALLOC == yes) ++#define je_mallctl mallctl ++#define je_malloc_stats_print malloc_stats_print ++#endif ++ + /* ===================== Creation and parsing of objects ==================== */ + + robj *createObject(int type, void *ptr) { +diff --git a/src/zmalloc.c b/src/zmalloc.c +index 2482f51..80e6571 100644 +--- a/src/zmalloc.c ++++ b/src/zmalloc.c +@@ -63,6 +63,15 @@ void zlibc_free(void *ptr) { + #define realloc(ptr,size) tc_realloc(ptr,size) + #define free(ptr) tc_free(ptr) + #elif defined(USE_JEMALLOC) ++#if USE_SYSTEM_JEMALLOC == yes ++#define malloc(size) malloc(size) ++#define calloc(count,size) calloc(count,size) ++#define realloc(ptr,size) realloc(ptr,size) ++#define free(ptr) free(ptr) ++#define mallocx(size,flags) mallocx(size,flags) ++#define dallocx(ptr,flags) dallocx(ptr,flags) ++#define je_mallctl mallctl ++#else + #define malloc(size) je_malloc(size) + #define calloc(count,size) je_calloc(count,size) + #define realloc(ptr,size) je_realloc(ptr,size) +@@ -70,6 +79,7 @@ void zlibc_free(void *ptr) { + #define mallocx(size,flags) je_mallocx(size,flags) + #define dallocx(ptr,flags) je_dallocx(ptr,flags) + #endif ++#endif + + #define update_zmalloc_stat_alloc(__n) do { \ + size_t _n = (__n); \ +diff --git a/src/zmalloc.h b/src/zmalloc.h +index 6fb19b0..62ccf29 100644 +--- a/src/zmalloc.h ++++ b/src/zmalloc.h +@@ -50,7 +50,11 @@ + #include + #if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2) + #define HAVE_MALLOC_SIZE 1 ++#if USE_SYSTEM_JEMALLOC == yes ++#define zmalloc_size(p) malloc_usable_size(p) ++#else + #define zmalloc_size(p) je_malloc_usable_size(p) ++#endif + #else + #error "Newer version of jemalloc required" + #endif diff --git a/pkg/deb/debian_dh9/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch b/pkg/deb/debian_dh9/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch new file mode 100644 index 000000000..9af228c09 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch @@ -0,0 +1,75 @@ +From: Chris Lamb +Date: Wed, 24 Jan 2018 22:06:35 +1100 +Subject: Use get_current_dir_name over PATHMAX, etc. + +--- + src/aof.c | 3 ++- + src/rdb.c | 7 ++++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/aof.c b/src/aof.c +index 9723fc3..cc89847 100644 +--- a/src/aof.c ++++ b/src/aof.c +@@ -246,7 +246,7 @@ int startAppendOnly(void) { + newfd = open(server.aof_filename,O_WRONLY|O_APPEND|O_CREAT,0644); + serverAssert(server.aof_state == AOF_OFF); + if (newfd == -1) { +- char *cwdp = getcwd(cwd,MAXPATHLEN); ++ char *cwdp = get_current_dir_name(); + + serverLog(LL_WARNING, + "Redis needs to enable the AOF but can't open the " +@@ -254,6 +254,7 @@ int startAppendOnly(void) { + server.aof_filename, + cwdp ? cwdp : "unknown", + strerror(errno)); ++ zfree(cwdp); + return C_ERR; + } + if (server.rdb_child_pid != -1) { +diff --git a/src/rdb.c b/src/rdb.c +index 3e43cb4..6058160 100644 +--- a/src/rdb.c ++++ b/src/rdb.c +@@ -1218,7 +1218,6 @@ werr: /* Write error. */ + /* Save the DB on disk. Return C_ERR on error, C_OK on success. */ + int rdbSave(char *filename, rdbSaveInfo *rsi) { + char tmpfile[256]; +- char cwd[MAXPATHLEN]; /* Current working dir path for error messages. */ + FILE *fp; + rio rdb; + int error = 0; +@@ -1226,13 +1225,14 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) { + snprintf(tmpfile,256,"temp-%d.rdb", (int) getpid()); + fp = fopen(tmpfile,"w"); + if (!fp) { +- char *cwdp = getcwd(cwd,MAXPATHLEN); ++ char *cwdp = get_current_dir_name(); + serverLog(LL_WARNING, + "Failed opening the RDB file %s (in server root dir %s) " + "for saving: %s", + filename, + cwdp ? cwdp : "unknown", + strerror(errno)); ++ zfree(cwdp); + return C_ERR; + } + +@@ -1254,7 +1254,7 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) { + /* Use RENAME to make sure the DB file is changed atomically only + * if the generate DB file is ok. */ + if (rename(tmpfile,filename) == -1) { +- char *cwdp = getcwd(cwd,MAXPATHLEN); ++ char *cwdp = get_current_dir_name(); + serverLog(LL_WARNING, + "Error moving temp DB file %s on the final " + "destination %s (in server root dir %s): %s", +@@ -1262,6 +1262,7 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) { + filename, + cwdp ? cwdp : "unknown", + strerror(errno)); ++ zfree(cwdp); + unlink(tmpfile); + return C_ERR; + } diff --git a/pkg/deb/debian_dh9/patches/0011-Add-support-for-a-USE_SYSTEM_LUA-flag.patch b/pkg/deb/debian_dh9/patches/0011-Add-support-for-a-USE_SYSTEM_LUA-flag.patch new file mode 100644 index 000000000..7e57c48f7 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/0011-Add-support-for-a-USE_SYSTEM_LUA-flag.patch @@ -0,0 +1,71 @@ +From: Chris Lamb +Date: Sun, 26 Aug 2018 12:57:32 +0200 +Subject: Add support for a USE_SYSTEM_LUA flag. + +https://github.com/antirez/redis/pull/5280 +--- + deps/Makefile | 2 ++ + src/Makefile | 15 ++++++++++++--- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/deps/Makefile b/deps/Makefile +index 1342fac..2ed7736 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -35,7 +35,9 @@ endif + distclean: + -(cd hiredis && $(MAKE) clean) > /dev/null || true + -(cd linenoise && $(MAKE) clean) > /dev/null || true ++ifneq ($(USE_SYSTEM_LUA),yes) + -(cd lua && $(MAKE) clean) > /dev/null || true ++endif + ifneq ($(USE_SYSTEM_JEMALLOC),yes) + -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true + endif +diff --git a/src/Makefile b/src/Makefile +index 51363fe..49085f2 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh') + uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') + uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') + OPTIMIZATION?=-O2 +-DEPENDENCY_TARGETS=hiredis linenoise lua ++DEPENDENCY_TARGETS=hiredis linenoise + NODEPS:=clean distclean + + # Default settings +@@ -107,7 +107,7 @@ endif + endif + endif + # Include paths to dependencies +-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src ++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise + + ifeq ($(MALLOC),tcmalloc) + FINAL_CFLAGS+= -DUSE_TCMALLOC +@@ -130,6 +130,15 @@ else + endif + endif + ++ifeq ($(USE_SYSTEM_LUA),yes) ++ FINAL_CFLAGS+= -I/usr/include/lua5.1 ++ FINAL_LIBS := -llua5.1 $(FINAL_LIBS) ++else ++ FINAL_CFLAGS+= -I../deps/lua/src ++ DEPENDENCY_TARGETS+= lua ++ FINAL_LIBS := ../deps/lua/src/liblua.a $(FINAL_LIBS) ++endif ++ + REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) $(CPPFLAGS) + REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS) + REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL) +@@ -201,7 +210,7 @@ endif + + # redis-server + $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ) +- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS) ++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS) + + # redis-sentinel + $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME) diff --git a/pkg/deb/debian_dh9/patches/debian-packaging/0003-dpkg-buildflags.patch b/pkg/deb/debian_dh9/patches/debian-packaging/0003-dpkg-buildflags.patch new file mode 100644 index 000000000..fdbe661f3 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/debian-packaging/0003-dpkg-buildflags.patch @@ -0,0 +1,49 @@ +From: Chris Lamb +Date: Fri, 30 Oct 2015 10:53:42 +0000 +Subject: Add CPPFLAGS in upstream makefiles + +--- + deps/hiredis/Makefile | 2 +- + deps/linenoise/Makefile | 2 +- + src/Makefile | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/deps/hiredis/Makefile b/deps/hiredis/Makefile +index 9a4de83..4c8a8e4 100644 +--- a/deps/hiredis/Makefile ++++ b/deps/hiredis/Makefile +@@ -41,7 +41,7 @@ CXX:=$(shell sh -c 'type $(CXX) >/dev/null 2>/dev/null && echo $(CXX) || echo g+ + OPTIMIZATION?=-O3 + WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings + DEBUG_FLAGS?= -g -ggdb +-REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(ARCH) ++REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(ARCH) $(CPPFLAGS) + REAL_LDFLAGS=$(LDFLAGS) $(ARCH) + + DYLIBSUFFIX=so +diff --git a/deps/linenoise/Makefile b/deps/linenoise/Makefile +index 1dd894b..12ada21 100644 +--- a/deps/linenoise/Makefile ++++ b/deps/linenoise/Makefile +@@ -6,7 +6,7 @@ R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) + R_LDFLAGS= $(LDFLAGS) + DEBUG= -g + +-R_CC=$(CC) $(R_CFLAGS) ++R_CC=$(CC) $(R_CFLAGS) $(CPPFLAGS) + R_LD=$(CC) $(R_LDFLAGS) + + linenoise.o: linenoise.h linenoise.c +diff --git a/src/Makefile b/src/Makefile +index 773d3b2..0ff6e8b 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -125,7 +125,7 @@ ifeq ($(MALLOC),jemalloc) + FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) + endif + +-REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) ++REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) $(CPPFLAGS) + REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS) + REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL) + diff --git a/pkg/deb/debian_dh9/patches/debian-packaging/0007-Set-Debian-configuration-defaults.patch b/pkg/deb/debian_dh9/patches/debian-packaging/0007-Set-Debian-configuration-defaults.patch new file mode 100644 index 000000000..7fe85ab1b --- /dev/null +++ b/pkg/deb/debian_dh9/patches/debian-packaging/0007-Set-Debian-configuration-defaults.patch @@ -0,0 +1,109 @@ +From: Chris Lamb +Date: Tue, 10 Oct 2017 09:56:42 +0100 +Subject: Set Debian configuration defaults. + +--- + keydb.conf | 12 ++++++------ + sentinel.conf | 9 +++++---- + 2 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/keydb.conf b/keydb.conf +index 93ab9a4..24e6c79 100644 +--- a/keydb.conf ++++ b/keydb.conf +@@ -66,7 +66,7 @@ + # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES + # JUST COMMENT THE FOLLOWING LINE. + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-bind 127.0.0.1 ++bind 127.0.0.1 ::1 + + # Protected mode is a layer of security protection, in order to avoid that + # keydb instances left open on the internet are accessed and exploited. +@@ -106,7 +106,7 @@ tcp-backlog 511 + # incoming connections. There is no default, so keydb will not listen + # on a unix socket when not specified. + # +-# unixsocket /tmp/keydb.sock ++# unixsocket /var/run/keydb/keydb-server.sock + # unixsocketperm 700 + + # Close the connection after a client is idle for N seconds (0 to disable) +@@ -133,7 +133,7 @@ tcp-keepalive 300 + + # By default keydb does not run as a daemon. Use 'yes' if you need it. + # Note that keydb will write a pid file in /var/run/keydb.pid when daemonized. +-daemonize no ++daemonize yes + + # If you run keydb from upstart or systemd, keydb can interact with your + # supervision tree. Options: +@@ -155,7 +155,7 @@ supervised no + # + # Creating a pid file is best effort: if keydb is not able to create it + # nothing bad happens, the server will start and run normally. +-pidfile /var/run/keydb_6379.pid ++pidfile /var/run/keydb/keydb-server.pid + + # Specify the server verbosity level. + # This can be one of: +@@ -168,7 +168,7 @@ loglevel notice + # Specify the log file name. Also the empty string can be used to force + # keydb to log on the standard output. Note that if you use standard + # output for logging but daemonize, logs will be sent to /dev/null +-logfile "" ++logfile /var/log/keydb/keydb-server.log + + # To enable logging to the system logger, just set 'syslog-enabled' to yes, + # and optionally update the other syslog parameters to suit your needs. +@@ -260,7 +260,7 @@ dbfilename dump.rdb + # The Append Only File will also be created inside this directory. + # + # Note that you must specify a directory here, not a file name. +-dir ./ ++dir /var/lib/keydb + + ################################# REPLICATION ################################# + +diff --git a/sentinel.conf b/sentinel.conf +index bc9a705..58a4c84 100644 +--- a/sentinel.conf ++++ b/sentinel.conf +@@ -13,6 +13,7 @@ + # For example you may use one of the following: + # + # bind 127.0.0.1 192.168.1.1 ++bind 127.0.0.1 ::1 + # + # protected-mode no + +@@ -23,17 +24,17 @@ port 26379 + # By default keydb Sentinel does not run as a daemon. Use 'yes' if you need it. + # Note that keydb will write a pid file in /var/run/keydb-sentinel.pid when + # daemonized. +-daemonize no ++daemonize yes + + # When running daemonized, keydb Sentinel writes a pid file in + # /var/run/keydb-sentinel.pid by default. You can specify a custom pid file + # location here. +-pidfile /var/run/keydb-sentinel.pid ++pidfile /var/run/sentinel/keydb-sentinel.pid + + # Specify the log file name. Also the empty string can be used to force + # Sentinel to log on the standard output. Note that if you use standard + # output for logging but daemonize, logs will be sent to /dev/null +-logfile "" ++logfile /var/log/keydb/keydb-sentinel.log + + # sentinel announce-ip + # sentinel announce-port +@@ -62,7 +63,7 @@ logfile "" + # For keydb Sentinel to chdir to /tmp at startup is the simplest thing + # for the process to don't interfere with administrative tasks such as + # unmounting filesystems. +-dir /tmp ++dir /var/lib/keydb + + # sentinel monitor + # diff --git a/pkg/deb/debian_dh9/patches/series b/pkg/deb/debian_dh9/patches/series new file mode 100644 index 000000000..ccb3d98d6 --- /dev/null +++ b/pkg/deb/debian_dh9/patches/series @@ -0,0 +1,8 @@ +0001-fix-ftbfs-on-kfreebsd.patch +#debian-packaging/0003-dpkg-buildflags.patch +#debian-packaging/0007-Set-Debian-configuration-defaults.patch +#0010-Use-get_current_dir_name-over-PATHMAX-etc.patch +#0010-Add-support-for-USE_SYSTEM_JEMALLOC-flag.patch +#0011-Add-support-for-a-USE_SYSTEM_LUA-flag.patch +#0007-Add-support-for-a-USE_SYSTEM_HIREDIS-flag.patch +#test diff --git a/pkg/deb/debian_dh9/patches/test b/pkg/deb/debian_dh9/patches/test new file mode 100644 index 000000000..5cab70cec --- /dev/null +++ b/pkg/deb/debian_dh9/patches/test @@ -0,0 +1,83 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + redis (5:5.0.5-1chl1~bionic1) bionic; urgency=medium + . + * Redis 5.0.5 fixes an important issue with AOF and adds multiple very useful + modules APIs. Moreover smaller bugs in other parts of Redis are fixed in + this release. + * Streams: a bug in the iterator could prevent certain items to be returned in + range queries under specific conditions. + * Memleak in bitfieldCommand fixed. + * Modules API: Preserve client*>id for blocked clients. + * Fix memory leak when rewriting config file in case of write errors. + * New modules API: RedisModule_GetKeyNameFromIO(). + * Fix non critical bugs in diskless replication. + * New mdouels API: command filtering. See RedisModule_RegisterCommandFilter(); + * Tests improved to be more deterministic. + * Fix a Redis Cluster bug, manual failover may abort because of the master + sending PINGs to the replicas. +Author: Chris Lea + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2019-08-14 + +--- /dev/null ++++ redis-5.0.5/redis_5.0.5-1chl1~bionic1.dsc +@@ -0,0 +1,42 @@ ++-----BEGIN PGP SIGNED MESSAGE----- ++Hash: SHA512 ++ ++Format: 3.0 (quilt) ++Source: redis ++Binary: redis, redis-sentinel, redis-server, redis-tools ++Architecture: any all ++Version: 5:5.0.5-1chl1~bionic1 ++Maintainer: Chris Lamb ++Homepage: https://redis.io/ ++Standards-Version: 4.2.1 ++Vcs-Browser: https://salsa.debian.org/lamby/pkg-redis ++Vcs-Git: https://salsa.debian.org/lamby/pkg-redis.git ++Testsuite: autopkgtest ++Build-Depends: debhelper (>= 9~), dpkg-dev (>= 1.17.5), systemd, procps , tcl ++Package-List: ++ redis deb database optional arch=all ++ redis-sentinel deb database optional arch=any ++ redis-server deb database optional arch=any ++ redis-tools deb database optional arch=any ++Checksums-Sha1: ++ 71e38ae09ac70012b5bc326522b976bcb8e269d6 1975750 redis_5.0.5.orig.tar.gz ++ 4698bbe4c190f31601d3864d9bcd5ed8380c8723 25956 redis_5.0.5-1chl1~bionic1.debian.tar.xz ++Checksums-Sha256: ++ 2139009799d21d8ff94fc40b7f36ac46699b9e1254086299f8d3b223ca54a375 1975750 redis_5.0.5.orig.tar.gz ++ 639fdb1be66542dc6b84e8c0bc30357e661bde809118cd1754e4cbbb83773a62 25956 redis_5.0.5-1chl1~bionic1.debian.tar.xz ++Files: ++ 2d2c8142baf72e6543174fc7beccaaa1 1975750 redis_5.0.5.orig.tar.gz ++ 1dd668600931bcca0e25f86c5c2cc0aa 25956 redis_5.0.5-1chl1~bionic1.debian.tar.xz ++ ++-----BEGIN PGP SIGNATURE----- ++ ++iQEzBAEBCgAdFiEEtTSUDPRzjdEehKuC2ZMjAYFA0IoFAl1Tk1QACgkQ2ZMjAYFA ++0Iqqzgf5AbOFgzqszqv4YxXg9hf+Iq5CCuw4J5U2Aid5fijLQVFPZaI0AgE3Br7C ++0nxqvxYEIjKF+e2nX6zNjVk3JXYz3/Am/quyrSBI4KW2lIbpfCnhC8zCLOVcDtlX ++jhdlg2rziqCDVaS1jGKR76vdz2FGSv/nAcGrjjOn0Lux7VhoaJgBoMgGCNigL8gB ++Wo36UBhZQ6h3zXJjiJUee40ne55xYENhBoWpMvChOlA6/7cW4Xwf6PKBiqwKaRry ++TYMTeLYgZ2S51ThK5zitfOPpBiP2xVuisL9NxgPiRTL1BnclJnOQzupX3xntNPtn ++Ym34YnxbLTGwew232JvgK3ywMmwBeA== ++=CJU0 ++-----END PGP SIGNATURE----- ++ diff --git a/pkg/deb/debian_dh9/rules b/pkg/deb/debian_dh9/rules new file mode 100755 index 000000000..0a8f0f1c6 --- /dev/null +++ b/pkg/deb/debian_dh9/rules @@ -0,0 +1,48 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/buildflags.mk + +#LUA_LIBS_DEBIAN = cjson bitop +#LUA_LIBS_BUNDLED = struct cmsgpack +# +#LUA_OBJECTS = $(addprefix lua_,$(addsuffix .o,$(LUA_LIBS_BUNDLED))) +#LUA_LDFLAGS = $(addprefix -llua5.1-,$(LUA_LIBS_DEBIAN)) $(addprefix ../deps/lua/src/,$(LUA_OBJECTS)) + +export BUILD_TLS=yes +export CFLAGS CPPFLAGS LDFLAGS +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_LDFLAGS_MAINT_APPEND = -ldl -latomic $(LUA_LDFLAGS) + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) + export MAKEFLAGS +endif + +%: + dh $@ + +override_dh_auto_install: + debian/bin/generate-systemd-service-files + +#override_dh_auto_build: +# make -C deps/lua/src $(LUA_OBJECTS) +# dh_auto_build --parallel -- V=1 USE_SYSTEM_JEMALLOC=yes USE_SYSTEM_LUA=yes USE_SYSTEM_HIREDIS=yes + +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + # Avoid race conditions in upstream testsuite. +# ./runtest --clients 1 || true +# ./runtest-cluster || true +# ./runtest-sentinel || true +endif + +override_dh_auto_clean: + dh_auto_clean + rm -f src/release.h debian/*.service + +override_dh_compress: + dh_compress -Xredis-trib.rb + +override_dh_installchangelogs: + dh_installchangelogs --keep 00-RELEASENOTES diff --git a/pkg/deb/debian_dh9/source/format b/pkg/deb/debian_dh9/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/pkg/deb/debian_dh9/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/pkg/deb/debian_dh9/source/include-binaries b/pkg/deb/debian_dh9/source/include-binaries new file mode 100644 index 000000000..ddd5cd4c9 --- /dev/null +++ b/pkg/deb/debian_dh9/source/include-binaries @@ -0,0 +1,2 @@ +keydb_5.0.6.orig.tar.gz +keydb_5.0.6-1chl1~bionic1.debian.tar.xz diff --git a/pkg/deb/debian_dh9/source/lintian-overrides b/pkg/deb/debian_dh9/source/lintian-overrides new file mode 100644 index 000000000..ca7456a67 --- /dev/null +++ b/pkg/deb/debian_dh9/source/lintian-overrides @@ -0,0 +1,2 @@ +# Upstream do not provide signed tarballs. +keydb source: debian-watch-does-not-check-gpg-signature diff --git a/pkg/deb/debian_dh9/source/options b/pkg/deb/debian_dh9/source/options new file mode 100644 index 000000000..aa96de89f --- /dev/null +++ b/pkg/deb/debian_dh9/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^\.travis\.yml$" diff --git a/pkg/deb/debian_dh9/tests/0001-keydb-cli b/pkg/deb/debian_dh9/tests/0001-keydb-cli new file mode 100755 index 000000000..d29d34b18 --- /dev/null +++ b/pkg/deb/debian_dh9/tests/0001-keydb-cli @@ -0,0 +1,8 @@ +#!/bin/sh +# +# Show the INFO from "keydb-cli" + +set -eu + +keydb-cli INFO +keydb-cli LOLWUT diff --git a/pkg/deb/debian_dh9/tests/0002-benchmark b/pkg/deb/debian_dh9/tests/0002-benchmark new file mode 100755 index 000000000..aa0b19c0b --- /dev/null +++ b/pkg/deb/debian_dh9/tests/0002-benchmark @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Run the benchmarking + +set -eu + +keydb-benchmark -P 10 diff --git a/pkg/deb/debian_dh9/tests/0003-keydb-check-aof b/pkg/deb/debian_dh9/tests/0003-keydb-check-aof new file mode 100755 index 000000000..c271b9710 --- /dev/null +++ b/pkg/deb/debian_dh9/tests/0003-keydb-check-aof @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Smoke test keydb-check-aof + +keydb-check-aof 2>&1 | grep -qsi usage: diff --git a/pkg/deb/debian_dh9/tests/0004-keydb-check-rdb b/pkg/deb/debian_dh9/tests/0004-keydb-check-rdb new file mode 100755 index 000000000..200043b0c --- /dev/null +++ b/pkg/deb/debian_dh9/tests/0004-keydb-check-rdb @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Test keydb-check-rdb + +set -eu + +# Perform a synchronous save to ensure .rdb file eixsts +keydb-cli SAVE + +keydb-check-rdb /var/lib/keydb/dump.rdb diff --git a/pkg/deb/debian_dh9/tests/control b/pkg/deb/debian_dh9/tests/control new file mode 100644 index 000000000..94edcf7e5 --- /dev/null +++ b/pkg/deb/debian_dh9/tests/control @@ -0,0 +1,8 @@ +Tests: 0001-keydb-cli + +Tests: 0002-benchmark + +Tests: 0003-keydb-check-aof + +Tests: 0004-keydb-check-rdb +Restrictions: needs-root diff --git a/pkg/deb/debian_dh9/watch b/pkg/deb/debian_dh9/watch new file mode 100644 index 000000000..bc7d05321 --- /dev/null +++ b/pkg/deb/debian_dh9/watch @@ -0,0 +1,3 @@ +version=4 +opts=uversionmangle=s/-?(alpha|beta|rc)/~$1/ \ + https://github.com/JohnSully/KeyDB/releases .*/archive/(.*).tar.gz diff --git a/pkg/deb/master_changelog b/pkg/deb/master_changelog index b2989f988..d792095b2 100644 --- a/pkg/deb/master_changelog +++ b/pkg/deb/master_changelog @@ -1,3 +1,12 @@ +keydb (6.0.8-1distribution_placeholder) codename_placeholder; urgency=medium + + * 6.0.8 + * Updating deb package builds to build from source and phasing out init.d on newer builds. dh_installsystemd from deb helper >=11 used where applicable + * Naming conventions are now updated [ keydbpackage_version-build~distribution_architecture] and master changelog included and maintained + * keydb-pro-server binary is no longer inluded in the open source package + + -- Ben Schermel Sun, 31 May 2020 8:00:37 +0000 + keydb (5.3.3-1distribution_placeholder) codename_placeholder; urgency=medium * 5.3.3 Updating deb source package, naming conventions, and build scripts.