summaryrefslogtreecommitdiffstats
path: root/misc/ciso/ciso.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ciso/ciso.SlackBuild')
-rw-r--r--misc/ciso/ciso.SlackBuild75
1 files changed, 38 insertions, 37 deletions
diff --git a/misc/ciso/ciso.SlackBuild b/misc/ciso/ciso.SlackBuild
index e478ec7fd5..12b0356f31 100644
--- a/misc/ciso/ciso.SlackBuild
+++ b/misc/ciso/ciso.SlackBuild
@@ -1,31 +1,26 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ciso
-# Copyright 2008-2009 Tarantino Antonino <metrofox9@gmail.com>
-# 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.
+# Originally written by Tarantino Antonino.
+# Modified and now maintained by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20220126 bkw: BUILD=3
+# - take over maintenance.
+# - rework -p0 patches into one -p1 patch.
+# - add man page.
+# - actually use SLKCFLAGS.
+# - fix banner so it shows the right version number.
+
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ciso
VERSION=${VERSION:-1.0.0}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +30,11 @@ if [ -z "$ARCH" ]; then
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}
@@ -59,29 +58,31 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+chmod 644 *
+
+# Patch does this:
+# - fix x86_64 build.
+# - add missing includes.
+# - add CFLAGS support to Makefile.
+# - make the banner show the actual version number.
-# Patching the source for compiling better on x64 arch and for avoiding warnings during compilation
-patch -p0 < $CWD/ciso.h.patch
-patch -p0 < $CWD/fix_includes.patch
+patch -p1 < $CWD/compilefix.diff
mkdir -p $PKG/usr/bin
-make CC="gcc $SLKCFLAGS"
+make CFLAGS="$SLKCFLAGS -Wl,-s"
make install DESTDIR=$PKG
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# 20220126 bkw: man page explains WTF a CSO image is (I didn't know).
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp license $PKG/usr/doc/$PRGNAM-$VERSION
-chmod 0644 $PKG/usr/doc/$PRGNAM-$VERSION/*
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a license $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
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