2010-06-30 06:17:45 +02:00
|
|
|
#!/bin/sh
|
2013-11-03 21:25:44 +01:00
|
|
|
# Written by Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
|
2010-06-30 06:17:45 +02:00
|
|
|
# Based on http://slackbuilds.org/template.SlackBuild
|
|
|
|
|
|
|
|
PRGNAM=xplanet
|
2017-01-22 23:32:42 +01:00
|
|
|
VERSION=${VERSION:-1.3.1}
|
2010-06-30 06:17:45 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2018-03-16 06:47:37 +01:00
|
|
|
i?86) export ARCH=i586 ;;
|
2010-06-30 06:17:45 +02:00
|
|
|
arm*) export ARCH=arm ;;
|
|
|
|
*) export ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2018-03-16 06:47:37 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-06-30 06:17:45 +02: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
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2018-03-16 06:47:37 +01:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-06-30 06:17:45 +02:00
|
|
|
|
2018-03-16 06:47:37 +01:00
|
|
|
patch -p1 < $CWD/null-comparison.patch
|
2015-06-25 14:31:18 +02:00
|
|
|
# Patch for giflib 5.x from Arch Linux (thanks!)
|
|
|
|
# https://projects.archlinux.org/svntogit/community.git/plain/trunk/giflib6.patch?h=packages/xplanet
|
|
|
|
patch -p1 < $CWD/giflib6.patch
|
|
|
|
|
2010-06-30 06:17:45 +02: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 install DESTDIR=$PKG
|
|
|
|
|
2018-03-16 06:47:37 +01:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-06-30 06:17:45 +02:00
|
|
|
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
2018-03-16 06:47:37 +01:00
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-06-30 06:17:45 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
README TODO AUTHORS COPYING NEWS ChangeLog \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $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:-tgz}
|