diff options
Diffstat (limited to 'network/yadifa/yadifa.SlackBuild')
-rw-r--r-- | network/yadifa/yadifa.SlackBuild | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/network/yadifa/yadifa.SlackBuild b/network/yadifa/yadifa.SlackBuild index 0b27ad7745..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,24 +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} -VSUFFIX=${VSUFFIX:-7713} +VERSION=${VERSION:-2.5.3} +VSUFFIX=${VSUFFIX:-10333} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +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 @@ -50,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} @@ -84,9 +96,9 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf yadifa-$VERSION-${VSUFFIX} -tar xvf $CWD/yadifa-$VERSION-${VSUFFIX}.tar.gz || tar xvf $CWD/$VERSION-${VSUFFIX}.tar.gz -cd yadifa-$VERSION-${VSUFFIX} +rm -rf yadifa-$SRCVERSION +tar xvf $CWD/yadifa-$SRCVERSION.tar.gz || tar xvf $CWD/$SRCVERSION.tar.gz +cd yadifa-$SRCVERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -100,7 +112,7 @@ find -L . \ --libdir=/usr/lib/yadifa \ --localstatedir=/var/lib/yadifa \ --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION-${VSUFFIX} \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ --with-logdir=/var/log/yadifa \ --enable-silent-rules \ --enable-shared=$SHARED \ @@ -115,8 +127,9 @@ 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 -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION-${VSUFFIX} -install --mode=644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION-${VSUFFIX}/$PRGNAM.SlackBuild +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 mkdir -p $PKG/install install --mode=644 $CWD/slack-desc $PKG/install/slack-desc @@ -125,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 @@ -142,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}_${VSUFFIX}-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |