aboutsummaryrefslogtreecommitdiff
path: root/libsafe/libsafe.SlackBuild
blob: 033ac5bec4eb25916f8e5dac46bc803a3bcbc6e9 (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
#!/bin/bash
#
# got it from ftp://ftp.slackware.com/pub/slackware/slackware-10.2/extra/source/libsafe-2.0-16/libsafe.SlackBuild
# small changes by rhatto
#

CWD="`pwd`"

if [ -f "/etc/slackbuildrc" ]; then
  source /etc/slackbuildrc
fi

if [ -f "~/.slackbuildrc" ]; then
  source ~/.slackbuildrc
fi

PACKAGE="libsafe"
ARCH=${ARCH:=x86_64}
BUILD=${BUILD:=1rha}
TMP=${TMP:=/tmp}
VERSION=2.0.16
SRCPKG=2.0-16
SRC_DIR=${SRC:=$CWD}

if [ "$ARCH" == "x86_64" ]; then
  LIBDIR=lib64
  DOINST="doinst64.sh"
else
  LIBDIR=lib
  DOINST="doinst.sh"
fi

RTOOL="wget"
SRC="$PACKAGE-$SRCPKG.tar.gz"
URL="ftp://ftp.slackware.com/pub/slackware/slackware-10.2/extra/source/libsafe-$SRCPKG/$SRC"
PKG=$TMP/package-libsafe

if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
  wget "$URL" -O "$SRC_DIR/$SRC"
fi

cd $TMP
rm -rf $PKG
mkdir -p $PKG
tar xzvf $SRC_DIR/$SRC
cd libsafe-$SRCPKG
chown -R root.root .
find . -perm 775 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
make
mkdir -p $PKG/$LIBDIR/incoming
cat src/libsafe.so.$VERSION > $PKG/$LIBDIR/incoming/libsafe.so.$VERSION
chmod 755 $PKG/$LIBDIR/incoming/libsafe.so.$VERSION
mkdir $PKG/install
cat $CWD/$DOINST > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
mkdir -p $PKG/usr/doc/libsafe-$VERSION
cp -a \
  COPYING ChangeLog EMAIL_NOTIFICATION INSTALL README doc \
  $PKG/usr/doc/libsafe-$VERSION
mkdir -p $PKG/usr/man/man8
cat doc/libsafe.8 | gzip -9c > $PKG/usr/man/man8/libsafe.8.gz
cd $PKG
makepkg -l y -c n $TMP/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz