diff options
author | Badchay <badchay@protonmail.com> | 2022-08-31 03:14:49 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-09-03 17:58:41 +0700 |
commit | 3a4f6aafbfb5ac842d45f753803bd423c62b2b5d (patch) | |
tree | ded322d36cfb25dc84e2074fc27f03e15551699d /network | |
parent | 5572cfe17669eed16a534edc03caeef5f250302a (diff) |
network/unbound: Updated for version 1.16.2. New maintainer.
Old maintainer is AWOL.
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/unbound/README | 3 | ||||
-rw-r--r-- | network/unbound/doinst.sh | 18 | ||||
-rw-r--r-- | network/unbound/rc.unbound | 122 | ||||
-rw-r--r-- | network/unbound/unbound.SlackBuild | 29 | ||||
-rw-r--r-- | network/unbound/unbound.info | 12 |
5 files changed, 64 insertions, 120 deletions
diff --git a/network/unbound/README b/network/unbound/README index 3abd246a8b42a..52fdc7c21a7dd 100644 --- a/network/unbound/README +++ b/network/unbound/README @@ -13,6 +13,3 @@ not conflict with anything else on SlackBuilds: groupadd -g 304 unbound useradd -r -u 304 -g unbound -d /etc/unbound/ -s /sbin/nologin -c \ 'Unbound DNS resolver' unbound - -Optional DNSCrypt support is provided. To enable: - DNSCRYPT=yes ./unbound.SlackBuild diff --git a/network/unbound/doinst.sh b/network/unbound/doinst.sh index 2914d5783b575..71e2910fce23b 100644 --- a/network/unbound/doinst.sh +++ b/network/unbound/doinst.sh @@ -24,3 +24,21 @@ preserve_perms() { preserve_perms etc/rc.d/rc.unbound.new config etc/unbound/unbound.conf.new + +# MD5SUM d837bf4c42abb7048c90d720a579f829 is a file hash from the previous initscript. + +if [ $(md5sum /etc/rc.d/rc.unbound | cut -f 1 -d " ") == "d837bf4c42abb7048c90d720a579f829" ] +then + echo "" + echo "Warning! Red Hat style init script detected at /etc/rc.d/rc.unbound !" + echo "It's likely from your previous Unbound installation." + echo "The init script will probably work just fine but the script has since been rewritten" + echo "as of Unbound version 1.16.2 and it's no longer supported by this SlackBuild." + echo "" + echo "Simply run the following commands to install the new Unbound init script:" + echo "# cd /etc/rc.d && mv rc.unbound.new rc.unbound" + echo "" + echo "...or if you use slackpkg:" + echo "# slackpkg new-config" + echo "" +fi diff --git a/network/unbound/rc.unbound b/network/unbound/rc.unbound index 49a6c991e84e1..c83d276725983 100644 --- a/network/unbound/rc.unbound +++ b/network/unbound/rc.unbound @@ -1,118 +1,46 @@ -#!/bin/sh +#!/bin/bash # -# unbound This shell script takes care of starting and stopping -# unbound (DNS server). -# -# chkconfig: - 14 86 -# description: unbound is a Domain Name Server (DNS) \ -# that is used to resolve host names to IP addresses. - -### BEGIN INIT INFO -# Provides: unbound -# Required-Start: $network $local_fs -# Required-Stop: $network $local_fs -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Should-Start: $syslog -# Should-Stop: $syslog -# Short-Description: unbound recursive Domain Name Server. -# Description: unbound is a Domain Name Server (DNS) -# that is used to resolve host names to IP addresses. -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions +# Slackware initialization script for Unbound. -exec="/usr/sbin/unbound" -config="/etc/unbound/unbound.conf" -pidfile="/var/run/unbound/unbound.pid" -piddir=`dirname $pidfile` -[ -x /usr/sbin/dnssec-configure ] && [ -r "$config" ] && - [ /etc/sysconfig/dnssec -nt "$config" ] && \ - /usr/sbin/dnssec-configure -u --norestart --dnssec="$DNSSEC" --dlv="$DLV" +UNBOUND=/usr/sbin/unbound +CONFIG=/etc/unbound/unbound.conf +PIDFILE=/var/run/unbound/unbound.pid start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - # /var/run could (and should) be tmpfs - [ -d $piddir ] || mkdir $piddir - - if [ -f /var/lib/unbound/root.anchor -a -f /usr/sbin/unbound-anchor ] - then - /sbin/runuser --command="/usr/sbin/unbound-anchor -a /var/lib/unbound/root.anchor -c /etc/unbound/icannbundle.pem" --shell /bin/sh unbound - fi - - if [ ! -f /etc/unbound/unbound_control.key ] - then - echo -n $"Generating unbound control key and certificate: " - /usr/sbin/unbound-control-setup -d /etc/unbound/ > /dev/null 2> /dev/null - chgrp unbound /etc/unbound/unbound_*key /etc/unbound/unbound_*pem - [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && \ - [ -x /sbin/restorecon ] && /sbin/restorecon /etc/unbound/* - echo + if [ -r $PIDFILE ]; then + echo 'Unbound is already running!' + return else - # old init script created these as root instead of unbound. - if [ -G /etc/unbound/unbound_control.key ] - then - chgrp unbound /etc/unbound/unbound_*key /etc/unbound/unbound_*pem - [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && \ - [ -x /sbin/restorecon ] && /sbin/restorecon /etc/unbound/* - echo - fi - fi - - - unbound-checkconf $config > /dev/null - RETVAL=$? - if [ $RETVAL != 0 ] - then - echo "Error in /etc/unbound/unbound.conf, aborted" - exit 6 + echo "Starting Unbound DNS validating resolver..." + $UNBOUND -c $CONFIG || echo "Failed to start! The error messages above might help." fi - - echo -n $"Starting unbound: " - - # if not running, start it up here - daemon --pidfile=$pidfile $exec -c $config - echo } stop() { - echo -n $"Stopping unbound: " - # stop it here, often "killproc unbound" - killproc -p $pidfile unbound - echo -} - -restart() { - unbound-checkconf $config > /dev/null - RETVAL=$? - if [ $RETVAL != 0 ] - then - echo "Error in /etc/unbound/unbound.conf, aborted" - exit 6 + if [ ! -r $PIDFILE ]; then + echo 'Unbound is not running.' + return fi - stop - start -} - -reload() { - restart + echo "Stopping Unbound DNS validating resolver..." + kill `cat $PIDFILE` + rm -f $PIDFILE } case "$1" in - start) + 'start') start ;; - stop) + 'stop') stop ;; - restart) - restart + 'restart') + stop + sleep 1 + start ;; *) - echo $"Usage: $0 {start|stop|restart}" - exit 2 + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; esac -exit $? diff --git a/network/unbound/unbound.SlackBuild b/network/unbound/unbound.SlackBuild index ef9c2dbd3202b..6e7cf095a9068 100644 --- a/network/unbound/unbound.SlackBuild +++ b/network/unbound/unbound.SlackBuild @@ -1,7 +1,9 @@ #!/bin/bash -# Slackware build script for unbound +# Slackware build script for Unbound +# Copyright 2022 Badchay <badchay@protonmail.com> +# All rights reserved. # Copyright 2020 Gerardo Zamudio <gerardo.zamudio@linux.com> Mexico City, Mexico # All rights reserved. # @@ -25,8 +27,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=unbound -VERSION=${VERSION:-1.13.1} -BUILD=${BUILD:-2} +VERSION=${VERSION:-1.16.2} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -96,12 +98,6 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -if [ "${DNSCRYPT:-no}" == "yes" ]; then - DNSCRYPT="--enable-dnscrypt" -else - DNSCRYPT="" -fi - CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -113,14 +109,17 @@ CXXFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --with-libevent \ --with-ssl \ + --enable-dnscrypt \ + --disable-static \ --with-username=$UB_USER \ --with-pidfile=/var/run/unbound/unbound.pid \ --build=$ARCH-slackware-linux \ - $DNSCRYPT make make install DESTDIR=$PKG +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libunbound.la + find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true @@ -128,19 +127,21 @@ 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 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a doc/CREDITS doc/FEATURES doc/LICENSE doc/README* $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cp -a doc/README* doc/FEATURES doc/CREDITS doc/TODO $PKG/usr/doc/$PRGNAM-$VERSION + +# Shorten the Changelog and restore its timestamp +head -n 1000 doc/Changelog > $PKG/usr/doc/$PRGNAM-$VERSION/Changelog +touch -r doc/Changelog $PKG/usr/doc/$PRGNAM-$VERSION/Changelog mkdir -p $PKG/var/run/unbound chown $USER:$GROUP $PKG/var/run/unbound/ mv $PKG/etc/unbound/unbound.conf $PKG/etc/unbound/unbound.conf.new install -m 0644 -D $CWD/rc.unbound $PKG/etc/rc.d/rc.unbound.new -rm -f $PKG/usr/lib*/*.la - mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/unbound/unbound.info b/network/unbound/unbound.info index 0d32e3cc39272..43ad98f4819e2 100644 --- a/network/unbound/unbound.info +++ b/network/unbound/unbound.info @@ -1,10 +1,10 @@ PRGNAM="unbound" -VERSION="1.13.1" +VERSION="1.16.2" HOMEPAGE="https://nlnetlabs.nl/projects/unbound/about/" -DOWNLOAD="https://nlnetlabs.nl/downloads/unbound/unbound-1.13.1.tar.gz" -MD5SUM="0cd660a40d733acc6e7cce43731cac62" +DOWNLOAD="https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.2.tar.gz" +MD5SUM="974cbd17e2e2373f36bfce0ad5b1d4a1" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="ldns" -MAINTAINER="Gerardo Zamudio" -EMAIL="gerardo.zamudio@linux.com" +REQUIRES="" +MAINTAINER="Badchay" +EMAIL="badchay@protonmail.com" |