2010-05-11 20:01:51 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-08-26 12:11:15 +02:00
|
|
|
# Written by Ismael Cortés (leamsi.setroc@gmail.com)
|
2010-05-11 20:01:51 +02:00
|
|
|
# I, as writer and author, give this script and its
|
|
|
|
# intellectual property to the public domain.
|
|
|
|
|
|
|
|
# Modified by Robby Workman - http://rlworkman.net
|
|
|
|
|
|
|
|
PRGNAM=pstotext
|
2017-03-21 20:20:49 +01:00
|
|
|
VERSION=${VERSION:-1.9}
|
2010-05-11 20:01:51 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-13 00:39:26 +02:00
|
|
|
|
2010-06-04 07:14:56 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-03-21 20:20:49 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:14:56 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 20:01:51 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-03-21 20:20:49 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:39:26 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:51 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:39:26 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:14:56 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:51 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-13 00:39:26 +02:00
|
|
|
set -e
|
2010-05-11 20:01:51 +02:00
|
|
|
|
|
|
|
rm -rf $PKG
|
2010-05-13 00:39:26 +02:00
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2010-05-11 20:01:51 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-13 00:39:26 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 20:01:51 +02:00
|
|
|
|
2010-05-13 00:39:26 +02:00
|
|
|
make CC="gcc $SLKCFLAGS"
|
2010-05-11 20:01:51 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
mv pstotext $PKG/usr/bin/
|
2010-05-13 00:39:26 +02:00
|
|
|
chmod 0755 $PKG/usr/bin/pstotext
|
2010-05-11 20:01:51 +02:00
|
|
|
strip --strip-unneeded $PKG/usr/bin/pstotext
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/man/man1
|
2010-05-13 00:39:26 +02:00
|
|
|
gzip -9c pstotext.1 > $PKG/usr/man/man1/pstotext.1.gz
|
2010-05-11 20:01:51 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:39:26 +02:00
|
|
|
cp -a pstotext.hlp pstotext.txt $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 20:01:51 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
chmod 644 $PKG/usr/doc/$PRGNAM-$VERSION/*
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:39:26 +02:00
|
|
|
chown -R root:root .
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|