aboutsummaryrefslogtreecommitdiff
path: root/system/daemontools-bin/daemontools-bin.SlackBuild
diff options
context:
space:
mode:
authorAaditya Bagga <aaditya_gnulinux@zoho.com>2019-10-19 10:56:48 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-10-19 10:56:48 +0700
commit119392d16f620777a000dbf34e46947c59efeb09 (patch)
treeb94b9a7b969faa8c8ecfb7ba1a61f8554eaf51ac /system/daemontools-bin/daemontools-bin.SlackBuild
parent7b8c0065d150e1305d1f2f0d97f55812abf87573 (diff)
system/daemontools-bin: Added (manage UNIX services).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/daemontools-bin/daemontools-bin.SlackBuild')
-rw-r--r--system/daemontools-bin/daemontools-bin.SlackBuild105
1 files changed, 105 insertions, 0 deletions
diff --git a/system/daemontools-bin/daemontools-bin.SlackBuild b/system/daemontools-bin/daemontools-bin.SlackBuild
new file mode 100644
index 0000000000000..96ec1969e5ce8
--- /dev/null
+++ b/system/daemontools-bin/daemontools-bin.SlackBuild
@@ -0,0 +1,105 @@
+#!/bin/sh
+
+# Slackware build script for daemontools
+
+# Copyright 2017 Duncan Roe Melbourne, Australia
+# Copyright 2019 Aaditya Bagga, India
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=daemontools-bin
+SRCNAM=daemontools
+VERSION=${VERSION:-0.76}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.gz --strip-components=1
+tar xvf $CWD/$SRCNAM-$VERSION-man.tar.gz
+mv $SRCNAM-man $SRCNAM-$VERSION/man
+mv $SRCNAM-$VERSION $PRGNAM-$VERSION
+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 \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+echo "${CC:-gcc} $SLKCFLAGS -Wall" > src/conf-cc
+echo "${LD:-gcc -s}" > src/conf-ld
+
+for i in $CWD/*.patch; do
+ patch -p1 < $i
+done
+
+package/compile
+
+install -d $PKG/usr/{bin,sbin}
+install -m 755 command/* $PKG/usr/bin/
+mv $PKG/usr/bin/svscanboot $PKG/usr/sbin/
+
+install -d $PKG/usr/man/man8
+install -m 644 man/*.8 $PKG/usr/man/man8/
+
+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
+
+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 \
+ src/{CHANGES,TODO} \
+ package/README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}