#!/bin/bash # Slackware build script for MasterPDFEditor4 # Originally written by Petar Petrov. # Modified and now maintained by B. Watson . # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20240821 bkw: BUILD=3. # - new maintainer. # - relicense as WTFPL. # - use upstream's .desktop and directory name under /opt. # - extract directly to $PKG (no copying). # - fix spelling, grammar, punctuation in README, slack-desc. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=MasterPDFEditor4 SRCNAM=master-pdf-editor VERSION=${VERSION:-4.3.89} BUILD=${BUILD:-3} 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" != "x86_64" ]; then printf "\n\n$ARCH is not supported... \n" exit 1 fi set -e # 20240822 bkw: no "build" or "source" dir, extract straight to $PKG. rm -rf $PKG mkdir -p $PKG/opt $OUTPUT cd $PKG/opt tar xvf $CWD/$SRCNAM-${VERSION}_qt5.amd64.tar.gz 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 {} + # 20240822 bkw: shipped binary is already stripped. EXE=${PRGNAM,,} DIR=${SRCNAM}-4 mkdir -p $PKG/usr/share/applications mv $DIR/$EXE.desktop $PKG/usr/share/applications # 20240822 bkw: for us command-line junkies: mkdir -p $PKG/usr/bin ln -s ../../opt/$DIR/$EXE $PKG/usr/bin/$EXE # 20240822 bkw: not really needed, but do this for compatibility with # previous version of this build. ln -s ../../opt/$DIR/$EXE $PKG/usr/bin/$PRGNAM PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC mv $DIR/license.txt $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE