diff options
Diffstat (limited to 'network/yadifa/yadifa.SlackBuild')
-rw-r--r-- | network/yadifa/yadifa.SlackBuild | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/network/yadifa/yadifa.SlackBuild b/network/yadifa/yadifa.SlackBuild index c730947160..d284cd8108 100644 --- a/network/yadifa/yadifa.SlackBuild +++ b/network/yadifa/yadifa.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for YADIFA, Authoritative DNS server -# Copyright (c) 2016, Sergey Fedosov <eleksir@gmail.com> +# Copyright (c) 2016-2020 Sergey Fedosov <eleksir@gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,25 +22,29 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=yadifa -VERSION=${VERSION:-2.3.8_7713} +VERSION=${VERSION:-2.5.3} +VSUFFIX=${VSUFFIX:-10333} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} -SRCVERSION=$(echo $VERSION | tr _ -) +SRCVERSION=$(echo $VERSION-$VSUFFIX | tr _ -) if ! grep -q "^yadifa:" /etc/group; then - echo "$0: Error: $PRGNAM group (yadifa) doesn't exist." - echo "$0: Try creating one with:" - echo " # groupadd -g 332 yadifa" - exit 1 + echo "$0: Error: $PRGNAM group (yadifa) doesn't exist." + echo "$0: Try creating one with:" + echo " # groupadd -g 332 yadifa" + exit 1 fi if ! grep -q "^yadifa:" /etc/passwd; then - echo "$0: Error: $PRGNAM user (yadifa) doesn't exist." - echo "$0: Try creating one with:" - echo " # useradd -u 332 -d /var/lib/yadifa -g yadifa -s /bin/false yadifa" - exit 1 + echo "$0: Error: $PRGNAM user (yadifa) doesn't exist." + echo "$0: Try creating one with:" + echo " # useradd -u 332 -d /var/lib/yadifa -g yadifa -s /bin/false yadifa" + exit 1 fi if [ -z "$ARCH" ]; then @@ -51,7 +55,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -116,6 +127,7 @@ make install DESTDIR=$PKG 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 +find $PKG/usr/man -type f -exec gzip -9 {} \+ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION install --mode=644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -126,9 +138,6 @@ install --mode=755 $CWD/doinst.sh $PKG/install/doinst.sh mkdir -p $PKG/etc/rc.d install --mode=755 $CWD/rc.yadifa $PKG/etc/rc.d/rc.yadifa.new -mkdir -p $PKG/var/run/yadifa -chown yadifa:yadifa $PKG/var/run/yadifa - mkdir -p $PKG/var/log/yadifa chown yadifa:yadifa $PKG/var/log/yadifa @@ -143,8 +152,9 @@ install --mode=644 $CWD/zones.conf $PKG/etc/yadifa/zones.conf.new mkdir -p $PKG/etc/logrotate.d install --mode=644 $CWD/yadifa.logrotate $PKG/etc/logrotate.d/yadifa.new -# remove empty file +# remove empty files rm -rf $PKG/etc/yadifa/yadifad.conf +rm -rf $PKG/etc/yadifa/yakeyrolld.conf cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |