2012-02-21 06:40:32 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for par2cmdline tbb
|
|
|
|
# Written by powtrix (@gmail.com)
|
|
|
|
|
|
|
|
PRGNAM=par2cmdline-tbb
|
2020-03-21 10:55:56 +08:00
|
|
|
VERSION=${VERSION:-0.4_20150503}
|
2015-01-07 00:13:43 +08:00
|
|
|
BUILD=${BUILD:-1}
|
2012-02-21 06:40:32 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
DIRNAME=$(echo $PRGNAM | tr -d "\-tbb")
|
2015-01-07 00:13:43 +08:00
|
|
|
DIRVERSION=$(echo $VERSION | awk -F_ '{print $1}')
|
2012-12-21 05:44:23 +08:00
|
|
|
SRCVERSION=$(echo $VERSION | sed s,_,-tbb-,)
|
2012-02-21 06:40:32 +08:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2015-01-07 00:13:43 +08:00
|
|
|
i?86) ARCH=i686 ;; # i486 fails to build, it isn't multithread
|
2012-02-21 06:40:32 +08:00
|
|
|
arm*) ARCH=arm ;;
|
2012-12-21 05:44:23 +08:00
|
|
|
*) ARCH=$( uname -m ) ;;
|
2012-02-21 06:40:32 +08:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-03-21 12:49:22 +08:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2012-02-21 06:40:32 +08:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2015-01-07 00:13:43 +08:00
|
|
|
rm -rf $DIRNAME-$DIRVERSION
|
2012-02-21 06:40:32 +08:00
|
|
|
tar xvf $CWD/$DIRNAME-$SRCVERSION.tar.gz
|
2015-01-07 00:13:43 +08:00
|
|
|
cd $TMP/$DIRNAME-$DIRVERSION
|
2012-02-21 06:40:32 +08:00
|
|
|
chown -R root:root .
|
2013-11-22 15:37:19 +08:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2012-02-21 06:40:32 +08:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
2012-09-21 21:45:30 +08:00
|
|
|
LDFLAGS="-lrt" \
|
2012-02-21 06:40:32 +08:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
|
|
|
sed -i 's/ln -f/ln -sf/g' Makefile # make symbolic links instead of hard links
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2012-12-21 05:44:23 +08:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2012-02-21 06:40:32 +08:00
|
|
|
cp -a \
|
|
|
|
AUTHORS COPYING ChangeLog INSTALL PORTING README{,_FIRST.txt} ROADMAP \
|
2012-12-21 05:44:23 +08:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2012-02-21 06:40:32 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2012-12-21 05:44:23 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|