summaryrefslogtreecommitdiffstats
path: root/network/asterisk/asterisk.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/asterisk/asterisk.SlackBuild')
-rw-r--r--network/asterisk/asterisk.SlackBuild30
1 files changed, 20 insertions, 10 deletions
diff --git a/network/asterisk/asterisk.SlackBuild b/network/asterisk/asterisk.SlackBuild
index af0e38e6e1..9ee9071514 100644
--- a/network/asterisk/asterisk.SlackBuild
+++ b/network/asterisk/asterisk.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2006, Alan Hicks, Lizella, GA
# Copyright 2010, 2013, 2015 Mario Preksavec, Zagreb, Croatia
-# Copyright 2018-2019 Chris Walker, Kempner, TX
+# Copyright 2018-2020 Chris Walker, Kempner, TX
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,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=asterisk
-VERSION=${VERSION:-16.6.2}
+VERSION=${VERSION:-16.15.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +38,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}
@@ -139,6 +149,7 @@ CXXFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
+ --with-cap \
--with-download-cache=$CACHEDIR \
$CONFIGURE_OPTS \
--build=$ARCH-slackware-linux
@@ -242,17 +253,16 @@ for i in \
done
mkdir -p $PKG/etc/rc.d
-install -m 0755 contrib/init.d/rc.slackware.asterisk $PKG/etc/rc.d/rc.asterisk.new
-
-# Fix pid file location in rc script
-sed -i 's/asterisk.pid/asterisk\/asterisk.pid/' $PKG/etc/rc.d/rc.asterisk.new
+sed $CWD/rc.asterisk.new \
+ -e "s,@ASTERISKUSR@,$ASTERISKUSR,g" \
+ -e "s,@ASTERISKGRP@,$ASTERISKGRP,g" \
+ > $PKG/etc/rc.d/rc.asterisk.new
# Set file ownership
chown -R $ASTERISKUSR:$ASTERISKGRP $PKG/usr/lib${LIBDIRSUFFIX}
chown -R $ASTERISKUSR:$ASTERISKGRP $PKG/var/lib/asterisk
chown -R $ASTERISKUSR:$ASTERISKGRP $PKG/var/spool/asterisk
chown -R $ASTERISKUSR:$ASTERISKGRP $PKG/var/log/asterisk
-chown -R $ASTERISKUSR:$ASTERISKGRP $PKG/var/run/asterisk
chown $ASTERISKUSR:$ASTERISKGRP $PKG/usr/sbin/asterisk
# The voicemail config file needs to writeable by the asterisk user
@@ -265,4 +275,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