Skip to content

Commit bb38dc9

Browse files
committed
Bump version to 0.1.4, check directories, set mandir
1 parent 4f37c9e commit bb38dc9

File tree

1 file changed

+49
-25
lines changed

1 file changed

+49
-25
lines changed

libsamplerate.SlackBuild

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,82 @@
11
#!/bin/sh
22
#
3-
# SlackBuild for libsamplerate
3+
# Slackware build script for libsamplerate
44
# Written by Georgi D. Sotirov <gdsotirov@dir.bg>
5+
# Visit SlackPack at http://sotirov-bg.net/slackpack/
56
#
67

7-
. ../slack-package.conf
8+
. /etc/slack-package.conf
89

910
NAME=libsamplerate
10-
VERSION=0.1.2
11+
VERSION=0.1.4
1112
BUILD=1
13+
ARCH=${ARCH:-i486}
14+
15+
CWD=${CWD:-`pwd`}
16+
TMP=${TMP:-/tmp}
17+
18+
if [ ! -e $TMP ]; then
19+
mkdir -p $TMP # location to build the source
20+
fi
1221

13-
cd $TMP
14-
tar -zxvf $CWD/$NAME-$VERSION.tar.gz
1522
SRC=$TMP/$NAME-$VERSION
23+
if [ -e $SRC -a -d $SRC ]; then
24+
echo "Source directory '$SRC' already exists! Plaese, move it or remove it."
25+
exit 1
26+
fi
27+
28+
PKG=$TMP/package-$NAME
29+
if [ -e $PKG -a -d $PKG ]; then
30+
echo "Package creation directory '$PKG' already exists! Please, move it or remove it."
31+
exit 2
32+
fi
33+
mkdir -p $PKG
34+
35+
# Extract the sources
36+
cd $TMP
37+
tar -zxvf $CWD/$NAME-$VERSION.tar.gz || exit 1
1638
cd $SRC
1739
fix_source
1840

41+
# Note: Doesn't compiles with the new version of flac
1942
CFLAGS=$SLKCFLAGS \
2043
CXXFLAGS=$SLKCFLAGS \
2144
./configure --build=$ARCH-slackware-linux \
2245
--host=$ARCH-slackware-linux \
2346
--prefix=/usr \
24-
--enable-shared=yes \
25-
--enable-static=no
47+
--sysconfdir=/etc \
48+
--mandir=/usr/man \
49+
--enable-shared=yes \
50+
--enable-static=no || exit 2
2651

27-
make || exit 1
28-
29-
PKG="$TMP/package-$NAME"
30-
mkdir -p $PKG
31-
32-
make -e DESTDIR=$PKG install
52+
make -j4 || exit 3
53+
make DESTDIR=$PKG install || exit 4
3354

3455
bin_perms $PKG
3556
( cd $PKG; strip_bin; strip_lib )
3657
( cd $SRC; create_docs $PKG $NAME-$VERSION )
3758

38-
mkdir -p $PKG/install
39-
install -m 644 $CWD/slack-desc $PKG/install
40-
install -m 644 $CWD/slack-required $PKG/install
59+
# Copy service info
60+
install -m 755 -d $PKG/install
61+
install -m 644 $CWD/slack-desc $PKG/install/slack-desc
62+
install -m 644 $CWD/slack-required $PKG/install/slack-required
4163

42-
mkdir -p $PKG/usr/src/slackbuilds/$NAME-$VERSION
43-
install -m 644 $CWD/slack-desc $PKG/usr/src/slackbuilds/$NAME-$VERSION
44-
install -m 644 $CWD/slack-required $PKG/usr/src/slackbuilds/$NAME-$VERSION
45-
install -m 644 $CWD/$NAME.SlackBuild $PKG/usr/src/slackbuilds/$NAME-$VERSION
64+
SBDIR=$PKG/usr/src/slackbuilds/$NAME-$VERSION
65+
install -m 755 -d $SBDIR
66+
install -m 644 $CWD/slack-desc $SBDIR/slack-desc
67+
install -m 644 $CWD/slack-required $SBDIR/slack-required
68+
install -m 644 $CWD/$NAME.SlackBuild $SBDIR/$NAME.SlackBuild
4669

47-
cd $PKG
4870
PKGNAME=$NAME-$VERSION-$ARCH-$BUILD$MYIN
71+
cd $PKG
4972
makepkg -l y -c n $PKG_DIR/$PKGNAME.tgz
5073
cd $PKG_DIR
5174
md5sum $PKGNAME.tgz > $PKGNAME.tgz.md5
52-
cat $PKG/install/slack-desc > $PKG_DIR/$PKGNAME.txt
75+
cp $CWD/slack-desc $PKGNAME.txt
5376

54-
if [ "$1" == "--cleanup" ]; then
55-
rm -r $SRC
56-
rm -r $PKG
77+
# Clean up (optionally)
78+
if [ "$1" = "--cleanup" ]; then
79+
rm -rf $SRC
80+
rm -rf $PKG
5781
fi
5882

0 commit comments

Comments
 (0)