2011-06-26 00:59:02 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for jbig2dec
|
|
|
|
|
2017-12-22 08:26:03 +01:00
|
|
|
# Originally written by Hubert Hesse <email removed>
|
2011-06-26 00:59:02 +02:00
|
|
|
|
2017-12-22 08:26:03 +01:00
|
|
|
# Now maintained by B. Watson <yalhcru@gmail.com>
|
2013-06-29 14:50:03 +02:00
|
|
|
|
2017-12-22 08:26:03 +01:00
|
|
|
# Original version of this script had no license. Modified version
|
|
|
|
# licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/
|
|
|
|
# for details.
|
|
|
|
|
2018-09-04 22:55:12 +02:00
|
|
|
# 20180904 bkw: update for v0.15
|
|
|
|
|
2018-06-24 02:09:03 +02:00
|
|
|
# 20180623 bkw:
|
|
|
|
# - upstream moved again (to github). use github url for source.
|
|
|
|
# the innards of the tarball are slightly different: none of the
|
|
|
|
# autoconf-generated stuff is there. however all the actual source
|
|
|
|
# code is identical, so I'm not updating BUILD.
|
|
|
|
|
2017-12-22 08:26:03 +01:00
|
|
|
# 20171222 bkw:
|
|
|
|
# - update for v0.14
|
|
|
|
# - add WTFPL
|
|
|
|
# - use upstream's homepage URL (they updated it this release)
|
2015-09-15 08:21:01 +02:00
|
|
|
|
2016-07-25 23:23:19 +02:00
|
|
|
# 20160725 bkw:
|
|
|
|
# - update for v0.13
|
|
|
|
# - removed libpng patch (no longer needed)
|
|
|
|
|
2017-12-22 08:26:03 +01:00
|
|
|
# 20150915 bkw:
|
|
|
|
# - update for v0.12
|
|
|
|
|
|
|
|
# Modified 20130620 by B. Watson:
|
|
|
|
# - Took over maintenance
|
|
|
|
# - Got rid of static library
|
|
|
|
# - Use 'make install-strip'
|
|
|
|
# - Added 'how to edit' stuff to slack-desc
|
|
|
|
|
2011-06-26 00:59:02 +02:00
|
|
|
PRGNAM=jbig2dec
|
2018-09-04 22:55:12 +02:00
|
|
|
VERSION=${VERSION:-0.15}
|
2016-07-25 23:23:19 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2011-06-26 00:59:02 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 11:00:08 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-06-26 00:59:02 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-19 11:00:08 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-06-26 00:59:02 +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 .
|
2018-09-04 22:55:12 +02:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2011-06-26 00:59:02 +02:00
|
|
|
|
2018-06-24 02:09:03 +02:00
|
|
|
# 20180623 bkw: configure & friends are now absent, generate them.
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
autoreconf -if
|
|
|
|
|
2011-06-26 00:59:02 +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 \
|
2013-06-29 14:50:03 +02:00
|
|
|
--disable-static \
|
|
|
|
--enable-shared \
|
2011-06-26 00:59:02 +02:00
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
2013-06-29 14:50:03 +02:00
|
|
|
make install-strip DESTDIR=$PKG
|
2011-06-26 00:59:02 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2013-06-29 14:50:03 +02:00
|
|
|
cp -a README LICENSE COPYING CHANGES $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-06-26 00:59:02 +02:00
|
|
|
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}
|