diff options
Diffstat (limited to 'network/opensmtpd/opensmtpd.SlackBuild')
-rw-r--r-- | network/opensmtpd/opensmtpd.SlackBuild | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/network/opensmtpd/opensmtpd.SlackBuild b/network/opensmtpd/opensmtpd.SlackBuild index d2e54fba71..accaedc775 100644 --- a/network/opensmtpd/opensmtpd.SlackBuild +++ b/network/opensmtpd/opensmtpd.SlackBuild @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for opensmtpd # Copyright 2013-2014 Robby Workman, Northport, Alabama, USA -# Copyright 2015-2018 Richard Narron, California, USA +# Copyright 2015-2020 Richard Narron, California, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,10 +23,13 @@ # 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=opensmtpd -VERSION=${VERSION:-6.0.3p1} -BUILD=${BUILD:-4} +VERSION=${VERSION:-7.4.0p1} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,7 +39,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} @@ -81,9 +91,10 @@ 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 $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION chown -R root:root . find -L . \ @@ -92,12 +103,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 {} \; -# fix reply buffer overflow -cat $CWD/openbsd64-020-smtpd.patch | patch -p1 - -# check null from crypt function -cat $CWD/fix-crash-on-authentication.patch | patch -p1 - CFLAGS="$SLKCFLAGS -D_DEFAULT_SOURCE" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -107,7 +112,6 @@ CXXFLAGS="$SLKCFLAGS" \ --localstatedir=/var \ --with-path-socket=/var/run \ --mandir=/usr/man \ - --with-mantype=doc \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --without-rpath \ --with-path-mbox=/var/spool/mail \ @@ -141,10 +145,16 @@ ln -s smtpctl $PKG/usr/sbin/makemap mkdir -p $PKG/etc/rc.d cat $CWD/rc.opensmtpd > $PKG/etc/rc.d/rc.opensmtpd.new -# Don't clobber the config file +# copy original smtpd.conf file +cp -p $PKG/etc/opensmtpd/smtpd.conf $PKG/etc/opensmtpd/smtpd.conf.upstream.default + +# Don't clobber the existing config file mv $PKG/etc/opensmtpd/smtpd.conf $PKG/etc/opensmtpd/smtpd.conf.new # and reflect the correct path to aliases file -sed -i "s,/etc/mail/,/etc/opensmtpd/,g" $PKG/etc/opensmtpd/smtpd.conf.new +# and use mbox instead of maildir +sed -i -e "s,/etc/mail/,/etc/opensmtpd/,g" \ + -e "s,maildir alias,mbox alias,g" \ + $PKG/etc/opensmtpd/smtpd.conf.new # Create (but don't clobber) the aliases file cat $CWD/aliases > $PKG/etc/opensmtpd/aliases.new @@ -167,7 +177,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 INSTALL LICENSE README.md THANKS $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CHANGES.md LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.slackware cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -176,4 +186,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -p -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -p -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |