summaryrefslogtreecommitdiffstats
path: root/system/freeswitch/freeswitch.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/freeswitch/freeswitch.SlackBuild')
-rw-r--r--system/freeswitch/freeswitch.SlackBuild75
1 files changed, 39 insertions, 36 deletions
diff --git a/system/freeswitch/freeswitch.SlackBuild b/system/freeswitch/freeswitch.SlackBuild
index c195e86329..0409049f6a 100644
--- a/system/freeswitch/freeswitch.SlackBuild
+++ b/system/freeswitch/freeswitch.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for FreeSWITCH
@@ -22,26 +22,39 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220411 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - i486 => i586.
+# - use getent instead of grepping passwd and group files.
+# - get rid of useless INSTALL in doc dir.
+# - install docs in /usr/doc/$PRGNAM-$VERSION (instead of symlinking).
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=freeswitch
VERSION=${VERSION:-1.2.15}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
-CWD=$(pwd)
+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}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -68,10 +81,8 @@ case "$PGSQL" in
*) PGSQL="--without-pgsql --disable-core-pgsql-support" ;;
esac
-# Bail if user or group isn't valid on your system
-if ! grep ^freeswitch: /etc/passwd 2>&1 > /dev/null; then
-
-cat << EOF
+bailout() {
+ cat << EOF
You must have a freeswitch user to run this script
@@ -79,20 +90,11 @@ cat << EOF
# useradd -u 269 -d /opt/freeswitch -s /bin/bash -g freeswitch freeswitch
EOF
+ exit 1
+}
- exit
-elif ! grep ^freeswitch: /etc/group 2>&1 > /dev/null; then
-
-cat << EOF
-
- You must have a freeswitch group to run this script
-
- # groupadd -g 269 freeswitch
-
-EOF
-
- exit
-fi
+getent passwd freeswitch &>/dev/null || bailout
+getent group freeswitch &>/dev/null || bailout
set -e
@@ -105,9 +107,9 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
# Prepare some things
./rebootstrap.sh
@@ -128,6 +130,7 @@ CXXFLAGS="$SLKCFLAGS -Wno-error" \
--libdir=/opt/freeswitch/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
$PGSQL \
+ --disable-static \
--build=$ARCH-slackware-linux
make -j1
@@ -157,25 +160,25 @@ install -D -m0755 -oroot -groot $CWD/rc.freeswitch $PKG/etc/rc.d/rc.freeswitch.n
mkdir -p $PKG/etc/logrotate.d
install -m 0644 $CWD/logrotate.freeswitch $PKG/etc/logrotate.d/freeswitch.new
-# Put docs into opt aswell, symlink later
-mkdir -p $PKG/opt/freeswitch/doc/$PRGNAM-$VERSION
-cp -a \
- AUTHORS COPYING ChangeLog INSTALL \
- $PKG/opt/freeswitch/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/opt/freeswitch/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# Put docs into /usr/doc (Slackware standard location)
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a AUTHORS COPYING ChangeLog $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
# Change ownership for some dirs
-chown -R freeswitch:freeswitch $PKG/var/log/freeswitch $PKG/var/run/freeswitch \
+chown -R freeswitch:freeswitch \
+ $PKG/var/log/freeswitch \
+ $PKG/var/run/freeswitch \
$PKG/opt/freeswitch
# Symlink some stuff back to the system
-mkdir -p $PKG/usr/{bin,doc}
-( cd $PKG/usr/doc ; ln -s /opt/freeswitch/doc/$PRGNAM-$VERSION )
-( cd $PKG/usr/bin ; ln -s /opt/freeswitch/bin/fs_cli )
+mkdir -p $PKG/usr/bin
+ln -s ../../opt/freeswitch/bin/fs_cli $PKG/usr/bin/fs_cli
mkdir -p $PKG/install
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