2011-08-05 13:45:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Slackware build script for ledger
|
|
|
|
# Written by Lionel Young (redtricycle at gmail dot com)
|
|
|
|
|
|
|
|
PRGNAM=ledger
|
2015-01-10 01:43:15 +01:00
|
|
|
VERSION=${VERSION:-3.1}
|
2015-02-23 16:20:07 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2011-08-05 13:45:21 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
2013-10-31 04:57:54 +01:00
|
|
|
mkdir -p $TMP $PKG/usr $OUTPUT
|
2011-08-05 13:45:21 +02:00
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2015-08-08 21:44:46 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz
|
2011-08-05 13:45:21 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2015-01-10 01:43:15 +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 {} \;
|
2011-08-05 13:45:21 +02:00
|
|
|
|
2015-02-23 16:20:07 +01:00
|
|
|
tar xvf $CWD/utfcpp.tar.gz -C lib/
|
2015-08-08 21:44:46 +02:00
|
|
|
|
|
|
|
# Fix build with boost-1.58 (thanks to Arch Linux)
|
|
|
|
patch -p1 < $CWD/ledger_git.diff
|
|
|
|
|
2015-01-10 01:43:15 +01:00
|
|
|
./acprep --prefix=/usr update
|
2011-08-05 13:45:21 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2015-01-10 01:43:15 +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
|
|
|
|
|
|
|
|
mv $PKG/usr/share/man $PKG/usr
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2011-08-05 13:45:21 +02:00
|
|
|
|
2015-01-10 01:43:15 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
|
2011-08-05 13:45:21 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2015-01-10 01:43:15 +01:00
|
|
|
cp -a README.md doc/NEWS $PKG/usr/doc/$PRGNAM-$VERSION/
|
2011-08-05 13:45:21 +02:00
|
|
|
|
2015-01-10 01:43:15 +01:00
|
|
|
cp -ra contrib $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -ra test/input/* $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -ra tools $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-08-05 13:45:21 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
2015-01-10 01:43:15 +01:00
|
|
|
cd $PKG
|
2011-08-05 13:45:21 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|