blob: 997666149dd99faef67b64ef69faaba610495c26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
#!/bin/bash
# Slackware build script for ciso
# 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.
# 20241004 bkw:
# - update for v1.0.2_2.
# - apply Debian's patches (get rid of my own).
# - update man page.
# 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.2_2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
SRCVER=${VERSION%_*} # e.g. 1.0.2_2 => 1.0.2
DEBVER=${VERSION#*_} # e.g. 1.0.2_2 => 2
# 20241004 bkw: for whatever reason, the Debianized source tarball's
# top directory isn't $PRGNAM-$VERSION as it normally is.
SRCDIR=${SRCDIR:-jamie-ciso-34d5813}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
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" = "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 $SRCDIR
tar xvf $CWD/${PRGNAM}_$SRCVER.orig.tar.gz
cd $SRCDIR
tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.xz
chown -R root:root .
chmod 644 *
for i in $( cat debian/patches/series ); do
patch -p1 < debian/patches/$i
done
mkdir -p $PKG/usr/bin
make CFLAGS="$SLKCFLAGS" LDFLAGS="-Wl,-s"
make install DESTDIR=$PKG
# 20220126 bkw: man page explains WTF a CSO image is (I didn't know).
# 20241004 bkw: debian/ has a man page, but mine is better.
mkdir -p $PKG/usr/man/man1
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
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
|