diff options
Diffstat (limited to 'graphics/unpaper/unpaper.SlackBuild')
-rw-r--r-- | graphics/unpaper/unpaper.SlackBuild | 77 |
1 files changed, 53 insertions, 24 deletions
diff --git a/graphics/unpaper/unpaper.SlackBuild b/graphics/unpaper/unpaper.SlackBuild index 1606b5f5fd..f9ff3b6c79 100644 --- a/graphics/unpaper/unpaper.SlackBuild +++ b/graphics/unpaper/unpaper.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for unpaper # Copyright 2008-2014 LukenShiro, Italy -# Copyright 2019 Logan Rathbone <poprocks@gmail.com> +# Copyright 2019-2023 Logan Rathbone <poprocks@gmail.com> # # All rights reserved. # @@ -24,7 +24,7 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# CHANGELOG +# CHANGELOG - Discontinued as of 7.0.0; see git log. # # 20191107 Logan Rathbone <poprocks@gmail.com> 6.1-1 # - Update to 6.1 @@ -39,22 +39,20 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=unpaper -VERSION=${VERSION:-6.1} +VERSION=${VERSION:-7.0.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -64,12 +62,18 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +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 @@ -78,33 +82,58 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z + cd $PRGNAM-$VERSION + +# Building the manpage requires "sphinx" which is a huge python package +# with many dependencies. Since there is no meson_options.txt in unpaper +# at this time which allows us to optionally disable this, patch it out +# unless the SPHINX option is set to true. + +SPHINX=${SPHINX:-false} + +if [ "$SPHINX" != "true" ]; then + patch -p1 < $CWD/unpaper-7.0.0-no-sphinx.patch +fi + 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 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 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +mkdir build CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --build=$ARCH-slackware-linux -make -make install DESTDIR=$PKG +meson setup \ + --buildtype=plain \ + --infodir=/usr/info \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + -Dstrip=true \ + build/ +${NINJA:=ninja} -v -C build/ +DESTDIR=$PKG $NINJA -C build/ install + +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la 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 -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 +if [ "$SPHINX" = "true" ]; then + 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 +fi -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/ -cp AUTHORS COPYING NEWS README.md $PKG/usr/doc/$PRGNAM-$VERSION/ +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + AUTHORS NEWS README.md LICENSES/ \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install |