summaryrefslogtreecommitdiffstats
path: root/office/MasterPDFEditor4/MasterPDFEditor4.SlackBuild
blob: 7a26388bea4bc4e33450faa812c40146b6433e3b (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash

# Slackware build script for MasterPDFEditor4

# Originally written by Petar Petrov.
# Modified and now maintained by B. Watson <urchlay@slackware.uk>.

# 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