summaryrefslogtreecommitdiffstats
path: root/multimedia/minidlna/minidlna.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/minidlna/minidlna.SlackBuild')
-rw-r--r--multimedia/minidlna/minidlna.SlackBuild35
1 files changed, 24 insertions, 11 deletions
diff --git a/multimedia/minidlna/minidlna.SlackBuild b/multimedia/minidlna/minidlna.SlackBuild
index fe1e323072..64ffce800b 100644
--- a/multimedia/minidlna/minidlna.SlackBuild
+++ b/multimedia/minidlna/minidlna.SlackBuild
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for minidlna
# Copyright 2011-2012 Niels Horn, Rio de Janeiro, RJ, Brazil
-# Copyright 2015 Mario Preksavec, Zagreb, Croatia
+# Copyright 2015, 2023 Mario Preksavec, Zagreb, Croatia
# 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=minidlna
-VERSION=${VERSION:-1.3.0}
+VERSION=${VERSION:-1.3.2}
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}
@@ -89,14 +99,17 @@ make install DESTDIR=$PKG
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
-# Include the config file
-mkdir -p $PKG/etc
-cat $PRGNAM.conf > $PKG/etc/$PRGNAM.conf.new
+# Include startup script and configs thanks to Andrew Isakov
+install -D -m755 $CWD/rc.$PRGNAM -T $PKG/etc/rc.d/rc.$PRGNAM.new
+install -D -m644 $CWD/${PRGNAM}.logrotate -T $PKG/etc/logrotate.d/${PRGNAM}.new
+install -D -m644 $PRGNAM.conf -T $PKG/etc/$PRGNAM.conf.new
+
+# Create log and db cache directories
+mkdir -p $PKG/var/{log,cache}/$PRGNAM
# Include the manual pages
-mkdir -p $PKG/usr/man/man{5,8}
-cat minidlna.conf.5 > $PKG/usr/man/man5/minidlna.conf.5
-cat minidlnad.8 > $PKG/usr/man/man8/minidlnad.8
+install -D -m644 minidlna.conf.5 -t $PKG/usr/man/man5
+install -D -m644 minidlnad.8 -t $PKG/usr/man/man8
gzip -9 $PKG/usr/man/man?/*.?
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -109,4 +122,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