aboutsummaryrefslogtreecommitdiff
path: root/libsafe/libsafe.SlackBuild
blob: 2dd83b4039c4ef35a250a1feb64ffa9d585e86e9 (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
#!/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 ~/.slackbuildrc ]; then
  source ~/.slackbuildrc
elif [ -f /etc/slackbuildrc ]; then
  source /etc/slackbuildrc
fi

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

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"

SRC_DIR="$SRC_DIR/$PACKAGE"
mkdir -p $SRC_DIR

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

TMP="$TMP/$PACKAGE"
PKG=$TMP/package-$PACKAGE
rm -rf $TMP
mkdir -p $TMP
cd $TMP

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 || exit 32
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 $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz

if [ "$CLEANUP" == "yes" ]; then
  rm -rf $TMP
fi