summaryrefslogtreecommitdiffstats
path: root/network/opendmarc/opendmarc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/opendmarc/opendmarc.SlackBuild')
-rw-r--r--network/opendmarc/opendmarc.SlackBuild50
1 files changed, 31 insertions, 19 deletions
diff --git a/network/opendmarc/opendmarc.SlackBuild b/network/opendmarc/opendmarc.SlackBuild
index 1747782641..a86798c7d8 100644
--- a/network/opendmarc/opendmarc.SlackBuild
+++ b/network/opendmarc/opendmarc.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for opendmarc
-# Copyright 2019 Mario Preksavec, Zagreb, Croatia
+# Copyright 2019, 2021 Mario Preksavec, Zagreb, Croatia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,15 @@
# 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=opendmarc
-VERSION=${VERSION:-1.3.2}
+VERSION=${VERSION:-1.4.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+SRCNAM=OpenDMARC-rel-$PRGNAM-${VERSION//./-}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +40,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}
@@ -87,9 +99,9 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
+rm -rf $SRCNAM
+tar xvf $CWD/$SRCNAM.tar.gz
+cd $SRCNAM
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -98,8 +110,14 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# http://batleth.sapienti-sat.org/projects/opendmarc/
-# ... and a few more
-for i in $CWD/patches/* ; do patch -p1 <$i ; done
+# https://github.com/trusteddomainproject/OpenDMARC/pulls
+for i in $CWD/patches/* ; do
+ case $i in
+ */z04_moreHeadersFailureReportVsBeta1.patch) : ;;
+ */pull178.diff) : ;;
+ *) patch -p1 <$i ;;
+ esac
+done
autoreconf -vif
@@ -120,12 +138,10 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
# Install init script
install -D -m0755 -oroot -groot contrib/init/generic/$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
-sed -e "s|^\(prefix=\).*|\1|" \
- -e "s|^\(exec_prefix=\).*|\1/usr|" \
- -e "s|/etc/sysconfig/opendmarc|/etc/default/opendmarc|" \
- -i $PKG/etc/rc.d/rc.$PRGNAM.new
# Configure defaults
install -D -m0644 -oroot -groot $PRGNAM/$PRGNAM.conf.sample $PKG/etc/$PRGNAM.conf.new
@@ -139,10 +155,6 @@ sed -e "s|^# \(AuthservID\) .*|\1 HOSTNAME|" \
-e "s|^# \(UserID\) .*|\1 $PRGNAM:$PRGNAM|" \
-i $PKG/etc/$PRGNAM.conf.new
-# Home directory for runtime data
-mkdir -p $PKG/var/run/$PRGNAM
-chown $PRGNAM:$PRGNAM $PKG/var/run/$PRGNAM
-
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
@@ -150,7 +162,7 @@ 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 RELEASE_NOTES $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CONTRIBUTING README README.md RELEASE_NOTES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
@@ -159,4 +171,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
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