#!/bin/bash # Slackware build script for pdf2djvu # Original author: Alexander Verbovetsky, Moscow, Russia. # Modified and now maintained by B. Watson . # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20241008 bkw: v0.9.19, BUILD=2: # - take over maintenance. # - disable -Werror. # - simplify script. # - tweak README. # - add COPYING and credits to doc dir. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=pdf2djvu VERSION=${VERSION:-0.9.19} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} 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/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} 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.xz cd $PRGNAM-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + # 20241008 bkw: Future-proofing: get rid of -Werror= completely. # This isn't needed on Slackware 15.0, but who knows what the future # may bring... sed -i '/\[-Werror=/d' configure.ac autoreconf -if # 20241008 bkw: no install-strip, so use LDFLAGS to pre-strip the bin. LDFLAGS="-Wl,-s" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --localedir=/usr/share/locale \ --build=$ARCH-slackware-linux make make install DESTDIR=$PKG gzip -9 $PKG/usr/man/{man1,??/man1}/* PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a doc/{COPYING,README,djvudigital,changelog,credits} $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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