aboutsummaryrefslogtreecommitdiff
path: root/office/pdftk
diff options
context:
space:
mode:
Diffstat (limited to 'office/pdftk')
-rw-r--r--office/pdftk/README9
-rw-r--r--office/pdftk/pdftk-2.02-use-gcc5.patch15
-rw-r--r--office/pdftk/pdftk.SlackBuild68
-rw-r--r--office/pdftk/pdftk.info16
-rw-r--r--office/pdftk/pdftk.sh4
5 files changed, 36 insertions, 76 deletions
diff --git a/office/pdftk/README b/office/pdftk/README
index 115255971eed..f55989c90989 100644
--- a/office/pdftk/README
+++ b/office/pdftk/README
@@ -6,9 +6,6 @@ use it to merge PDF documents, split PDF documents, apply watermarks,
repair corrupt PDF, update PDF metadata, and more. pdftk does not
require Acrobat and is free software.
-NOTE: Starting with Slackware 15.0, pdftk compilation requires SBo
-gcc-5 because gcc-java was dropped from the GNU Compiler Collection
-as of gcc-7. Don't forget to source /etc/profile.d/gcc5.sh before
-starting to build this, like:
-
- . /etc/profile.d/gcc5.sh
+This SlackBuild repackages the newer Java port of the original pdftk.
+A Java Runtime Environment of version >= 8 is required
+(ex. zulu-openjdk8).
diff --git a/office/pdftk/pdftk-2.02-use-gcc5.patch b/office/pdftk/pdftk-2.02-use-gcc5.patch
deleted file mode 100644
index d1e6e124de2b..000000000000
--- a/office/pdftk/pdftk-2.02-use-gcc5.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-# diff -Nurp pdftk/Makefile.Slackware-13.1.orig pdftk/Makefile.Slackware-13.1
---- orig/pdftk/Makefile.Slackware-13.1 2013-07-24 13:27:46.000000000 -0500
-+++ pdftk/Makefile.Slackware-13.1 2018-03-04 06:20:55.312900883 -0600
-@@ -21,8 +21,9 @@
- # tools
- # need direct path to libgcj for gcjh (starting in gcj 4.1.2 per AurĂ©lien GĂRĂME)
- TOOLPATH=
--export VERSUFF=-4.4.4
--export CXX= $(TOOLPATH)g++
-+GCCMAJORTAG=-5 # kjh was here
-+export VERSUFF=-5.5.0 # kjh was here
-+export CXX= $(TOOLPATH)g++$(GCCMAJORTAG) # kjh was here
- export GCJ= $(TOOLPATH)gcj
- export GCJH= $(TOOLPATH)gcjh
- export GJAR= $(TOOLPATH)gjar
diff --git a/office/pdftk/pdftk.SlackBuild b/office/pdftk/pdftk.SlackBuild
index 700304334977..6de4541cb9fd 100644
--- a/office/pdftk/pdftk.SlackBuild
+++ b/office/pdftk/pdftk.SlackBuild
@@ -2,8 +2,9 @@
# Slackware build script for pdftk
-# Copyright 2010 Gregory J. L. Tourte <artourter@gmail.com>
# Copyright 2006-2009 Yalla-One <yallaone@gmail.com>
+# Copyright 2010 Gregory J. L. Tourte <artourter@gmail.com>
+# Copyright 2024 Isaac Yu <isaacyu@protonmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -26,22 +27,13 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pdftk
-VERSION=${VERSION:-2.02}
+VERSION=${VERSION:-3.3.3}
BUILD=${BUILD:-1}
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
+ARCH=noarch
-# 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
@@ -51,49 +43,29 @@ 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-dist
-unzip $CWD/$PRGNAM-$VERSION-src.zip
-cd $PRGNAM-$VERSION-dist
-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 {} \;
-patch -p1 < $CWD/pdftk-2.02-use-gcc5.patch
+# Copy the binary
+mkdir -p $PKG/usr/share/java/$PRGNAM
+install -Dm644 $CWD/$PRGNAM-all.jar $PKG/usr/share/java/$PRGNAM
+
+# pdftk.sh was taken from the Arch Linux repo:
+# https://gitlab.archlinux.org/archlinux/packaging/packages/pdftk/-/tree/main?ref_type=heads
+mkdir -p $PKG/usr/bin
+install -Dm755 $CWD/$PRGNAM.sh $PKG/usr/bin/$PRGNAM
-cd $PRGNAM
- # Hardcode "-j1" since this fails with multiple make jobs
- make OPT="$SLKCFLAGS" -j1 -f Makefile.Slackware-13.1
- mkdir -p $PKG/usr/{bin,man/man1,doc/$PRGNAM-$VERSION}
- cp -a pdftk $PKG/usr/bin
- strip --strip-unneeded $PKG/usr/bin/pdftk 2> /dev/null
-cd ..
+# Man file
+# Typo fix taken from https://gitlab.com/pdftk-java/pdftk/-/blob/master/pdftk.1
+mkdir -p $PKG/usr/man/man1
+install -Dm644 $CWD/$PRGNAM.1 $PKG/usr/man/man1
+sed -i '198s/fB1\\\\-/fB1\\\-/' $PKG/usr/man/man1/pdftk.1
+gzip -9 $PKG/usr/man/man1/$PRGNAM.1
-gzip -9c pdftk.1 > $PKG/usr/man/man1/pdftk.1.gz
-cp -a \
- pdftk.1.* changelog.* license_gpl_pdftk \
- $PKG/usr/doc/$PRGNAM-$VERSION/
+# Only pdftk.SlackBuild is copied to /usr/doc/pdftk-$VERSION
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/office/pdftk/pdftk.info b/office/pdftk/pdftk.info
index b4e36211a901..51c382f4f1a8 100644
--- a/office/pdftk/pdftk.info
+++ b/office/pdftk/pdftk.info
@@ -1,10 +1,12 @@
PRGNAM="pdftk"
-VERSION="2.02"
-HOMEPAGE="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/"
-DOWNLOAD="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip"
-MD5SUM="6534365fd6727724f288a556ede33faa"
+VERSION="3.3.3"
+HOMEPAGE="https://gitlab.com/pdftk-java/pdftk"
+DOWNLOAD="https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/v3.3.3/pdftk-all.jar \
+ https://gitlab.com/pdftk-java/pdftk/-/raw/v3.3.3/pdftk.1"
+MD5SUM="59a28bed53b428595d165d52988bf4cf \
+ 7f3b3fee7c84aa2169a37c84939f2577"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="gcc5"
-MAINTAINER="ArTourter"
-EMAIL="artourter@gmail.com"
+REQUIRES="zulu-openjdk8"
+MAINTAINER="Isaac Yu"
+EMAIL="isaacyu@protonamil.com"
diff --git a/office/pdftk/pdftk.sh b/office/pdftk/pdftk.sh
new file mode 100644
index 000000000000..40fdde27a380
--- /dev/null
+++ b/office/pdftk/pdftk.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+CP='/usr/share/java/pdftk/pdftk-all.jar'
+exec java -cp "$CP" com.gitlab.pdftk_java.pdftk "$@"
+