#!/bin/bash # Slackware build script for jbig2dec # Originally written by Hubert Hesse # Now maintained by B. Watson # Original version of this script had no license. Modified version # licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ # for details. # 20231108 bkw: update for v0.20 # 20211124 bkw: BUILD=2, remove .la file # 20201103 bkw: update for v0.19 # 20200314 bkw: update for v0.18 # 20191208 bkw: update for v0.17 # 20180904 bkw: update for v0.15 # 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. # 20171222 bkw: # - update for v0.14 # - add WTFPL # - use upstream's homepage URL (they updated it this release) # 20160725 bkw: # - update for v0.13 # - removed libpng patch (no longer needed) # 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 wget -c https://github.com/ArtifexSoftware/jbig2dec/archive/0.20/jbig2dec-0.20.tar.gz cd $(dirname $0) ; CWD=$(pwd) PRGNAM=jbig2dec VERSION=${VERSION:-0.20} TAG=_cosmic BUILD=${BUILD:-1} PKGTYPE=${PKGTYPE:-txz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi TMP=${TMP:-/tmp/cosmic} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/var/cache/cosmic} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" 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 . find -L . \ \( -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 {} \; # 20180623 bkw: configure & friends are now absent, generate them. ./autogen.sh autoreconf -if CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --disable-static \ --enable-shared \ --build=$ARCH-slackware-linux make make install-strip DESTDIR=$PKG 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 # Compress and link manpages, if any: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.* ) done ) fi rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a README LICENSE COPYING CHANGES $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # Remove any systemd files if present for path in usr/lib/systemd usr/lib64/systemd; do if [ -d "$PKG/$path" ]; then rm -rf "$PKG/$path" fi done 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