diff options
Diffstat (limited to 'network/fail2ban/fail2ban.SlackBuild')
-rw-r--r-- | network/fail2ban/fail2ban.SlackBuild | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/network/fail2ban/fail2ban.SlackBuild b/network/fail2ban/fail2ban.SlackBuild index 1ac086703eddf..a08000e8f749f 100644 --- a/network/fail2ban/fail2ban.SlackBuild +++ b/network/fail2ban/fail2ban.SlackBuild @@ -3,6 +3,7 @@ # Slackware Package Build Script for fail2ban # Git Hub: https://github.com/fail2ban/fail2ban/ +# Copyright (c) 2024, Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy # Copyright (c) 2008-2018, Nishant Limbachia, Hoffman Estates, IL, USA # <nishant _AT_ mnspace _DOT_ net> # All rights reserved. @@ -28,7 +29,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM="fail2ban" -VERSION=${VERSION:-0.11.2} +VERSION=${VERSION:-1.0.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -43,9 +44,6 @@ if [ -z "$ARCH" ]; then esac fi -# 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 @@ -70,6 +68,10 @@ 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 {} \; +sed -i 's|self.install_dir|"/usr/bin"|' setup.py +sed -i 's/^before = paths-debian.conf/before = paths-slackware.conf/' config/jail.conf + +./fail2ban-2to3 python setup.py install --root=$PKG # installing man pages @@ -78,15 +80,6 @@ install -m 0644 man/fail2ban-client.1 man/fail2ban-regex.1 \ man/fail2ban-server.1 man/fail2ban.1 man/fail2ban-testcases.1 $PKG/usr/man/man1 install -m 0644 man/jail.conf.5 $PKG/usr/man/man5 -# move config files to .new -( cd $PKG/etc/fail2ban - for file in $(find . -type f); do - mv $file "$file.new" - done -) - -( cd $PKG/etc/fail2ban; patch -p0 < $CWD/patches/jail.conf.patch ) - 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 @@ -113,6 +106,9 @@ mkdir -p $PKG/var/lib/fail2ban # remove /usr/share/doc rm -fr $PKG/usr/share/doc +# remove the /run directory in the package +rm -fr $PKG/run + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a CONTRIBUTING.md COPYING ChangeLog DEVELOP FILTERS MANIFEST \ README.md RELEASE THANKS TODO \ @@ -124,5 +120,15 @@ mkdir -p $PKG/install cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc +# Don't clobber existing configuration files +for i in etc/fail2ban/{,action.d,fail2ban.d,filter.d,jail.d}; do + for j in $(ls -1 $PKG/$i); do + if [ ! -d $PKG/$i/$j ]; then + mv $PKG/$i/$j $PKG/$i/$j.new + echo "config $i/$j.new" >> $PKG/install/doinst.sh + fi + done +done + cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |