2010-06-23 23:07:40 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Slackware build script for exact-image
|
2013-11-03 21:25:44 +01:00
|
|
|
# Written by Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
|
2010-06-23 23:07:40 +02:00
|
|
|
|
|
|
|
PRGNAM=exact-image
|
2017-01-31 15:46:50 +01:00
|
|
|
VERSION=${VERSION:-0.9.2}
|
2012-09-25 04:05:14 +02:00
|
|
|
BUILD=${BUILD:-3}
|
2010-06-23 23:07:40 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-01-31 15:46:50 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-23 23:07:40 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-01-31 15:46:50 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-06-23 23:07:40 +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 $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2010-06-23 23:07:40 +02: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 {} \;
|
|
|
|
|
2010-10-20 08:24:18 +02:00
|
|
|
# Patch to fix perl path
|
2010-06-23 23:07:40 +02:00
|
|
|
eval $(perl -V:vendorlib)
|
2010-10-25 13:49:24 +02:00
|
|
|
sed "s,@vendorlib@,$vendorlib,g" $CWD/fixup-perl_paths.diff | patch -p1 --verbose
|
2010-06-23 23:07:40 +02:00
|
|
|
|
2015-12-29 23:59:38 +01:00
|
|
|
# Fix for swig-3.0.7
|
|
|
|
sed -i -e '/^# manually/d' api/api-swig.hh
|
|
|
|
|
2017-07-05 04:11:28 +02:00
|
|
|
patch -p1 < $CWD/c98.patch
|
|
|
|
patch -p1 < $CWD/raw.patch
|
|
|
|
|
2010-06-23 23:07:40 +02:00
|
|
|
./configure \
|
|
|
|
--bindir=/usr/bin \
|
2012-09-10 05:20:38 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--without-php
|
2010-06-23 23:07:40 +02:00
|
|
|
|
2017-07-05 04:11:28 +02:00
|
|
|
make CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS -Wno-narrowing -fpermissive"
|
2010-06-23 23:07:40 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a LICENSE README TODO CODING examples $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}
|