print/pdftk: Update to 3.0.8 of JDK-based fork

The fork is a pure Java implementation of pdftk and does not rely
on the obsolete GCJ.  It is mostly compatible with the old version.
The old version was the last port still depending on lang/gcc6.

Changes:	https://gitlab.com/pdftk-java/pdftk/blob/v3.0.8/CHANGELOG.md#308-2019-10-14
This commit is contained in:
Tobias Kortkamp 2019-12-22 09:06:37 +00:00
parent 5ff2e13ce3
commit ebb2697836
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=520608
5 changed files with 45 additions and 78 deletions

View File

@ -2,53 +2,52 @@
# $FreeBSD$
PORTNAME= pdftk
PORTVERSION= 2.02
PORTREVISION= 8
CATEGORIES= print
MASTER_SITES= http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ LOCAL/mat/pdftk
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
DISTVERSIONPREFIX= v
DISTVERSION= 3.0.8
CATEGORIES= print java
MASTER_SITES= http://repo.maven.apache.org/maven2/:bcprov
DISTFILES= ${_BCPROV_JAR}:bcprov
MAINTAINER= ports@FreeBSD.org
MAINTAINER= tobik@FreeBSD.org
COMMENT= Simple tool for doing everyday things with PDF documents
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
# Get GCC version suffix without the dot in USE_GCC
CSUFF= ${_USE_GCC:S/.//}
BUILD_DEPENDS= ${JAVAJARDIR}/commons-lang3.jar:java/apache-commons-lang3
RUN_DEPENDS= ${JAVAJARDIR}/commons-lang3.jar:java/apache-commons-lang3
USE_GCC= 6 # Only GCC 6 provides Java (GCJ and libgcj).
USES= iconv gmake zip
USE_ANT= yes
USE_GITLAB= yes
GL_ACCOUNT= pdftk-java
GL_COMMIT= c98f90e623376942b5a0e9c77345e11710e50509
USE_JAVA= yes
ALL_TARGET= jar
NO_ARCH= yes
SUB_FILES= pdftk
SUB_LIST= CLASSPATH="${_CLASSPATH:ts:}" \
JAVA="${JAVA}"
PLIST_FILES= ${JAVAJARDIR}/${_BCPROV_JAR:T} \
${JAVAJARDIR}/pdftk.jar \
bin/pdftk \
man/man1/pdftk.1.gz
# gcj/libgcj don't exist on some platforms
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= GNU gcj does not exist on this platform
_BCPROV_JAR= org/bouncycastle/bcprov-jdk15on/1.51/bcprov-jdk15on-1.51.jar
_CLASSPATH= ${JAVAJARDIR}/${_BCPROV_JAR:T} ${JAVAJARDIR}/commons-lang3.jar \
${JAVAJARDIR}/pdftk.jar
PATCH_WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-dist
WRKSRC= ${PATCH_WRKSRC}/${PORTNAME}
MAKEFILE= Makefile.FreeBSD
MAKE_ENV= GCJ=gcj${CSUFF} GCJH=gcjh${CSUFF} GCPP=cpp${CSUFF} \
OBJCOPY=${OBJCOPY}
PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
pre-configure:
@if [ ! -e ${LOCALBASE}/bin/gcj${CSUFF} ]; then \
${ECHO_MSG} ""; \
${ECHO_MSG} "Cannot find gcj${CSUFF}"; \
${ECHO_MSG} "Please rebuild ${_GCC_PORT} with java support"; \
${ECHO_MSG} ""; \
exit 1; \
fi
post-patch:
@${REINPLACE_CMD} -e "s|TOOLPATH=|TOOLPATH=${LOCALBASE}/bin/|g; \
s|VERSUFF=|VERSUFF=${CSUFF}|g; s|GCJFLAGS=|GCJFLAGS= -L${LOCALBASE}/lib ${LDFLAGS} -w|g; \
s|LDLIBS= -lgcj|LDLIBS= -lgcj -pthread ${ICONV_LIB} -lz -L${LOCALBASE}/lib ${LDFLAGS} -w|g" \
${WRKSRC}/${MAKEFILE}
post-extract:
@${MKDIR} ${WRKSRC}/lib
@${LN} -sf ${JAVAJARDIR}/commons-lang3.jar ${WRKSRC}/lib
@${LN} -sf ${DISTDIR}/${_BCPROV_JAR} ${WRKSRC}/lib
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/../${PORTNAME}.1 ${STAGEDIR}${PREFIX}/man/man1
${INSTALL_SCRIPT} ${WRKDIR}/pdftk \
${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/build/jar/pdftk.jar \
${DISTDIR}/${_BCPROV_JAR} \
${STAGEDIR}${JAVAJARDIR}
${INSTALL_MAN} ${WRKSRC}/pdftk.1 \
${STAGEDIR}${PREFIX}/man/man1
.include <bsd.port.mk>

View File

@ -1,2 +1,5 @@
SHA256 (pdftk-2.02-src.zip) = 118f6a25fd3acaafb58824dce6f97cdc07e56050e666b90e4c4ef426ea37b8c1
SIZE (pdftk-2.02-src.zip) = 2239008
TIMESTAMP = 1577004031
SHA256 (org/bouncycastle/bcprov-jdk15on/1.51/bcprov-jdk15on-1.51.jar) = 8748f0ec73895f7f18c1a9c13cf754fddddf0451cf472463ef02f93c3e7a7de7
SIZE (org/bouncycastle/bcprov-jdk15on/1.51/bcprov-jdk15on-1.51.jar) = 2842667
SHA256 (pdftk-java-pdftk-c98f90e623376942b5a0e9c77345e11710e50509_GL0.tar.gz) = 7afd3ff60062554038d8e035f710838ff0159720315a9fe2198591239dc8f586
SIZE (pdftk-java-pdftk-c98f90e623376942b5a0e9c77345e11710e50509_GL0.tar.gz) = 1359740

View File

@ -1,33 +0,0 @@
--- pdftk/Makefile.Base.orig 2013-10-13 16:59:09.000000000 +0300
+++ pdftk/Makefile.Base 2013-10-13 17:14:39.000000000 +0300
@@ -28,24 +28,24 @@
#
CPPFLAGS+= -DPDFTK_VER=\"2.02\"
-all : javalib pdftk
+all : pdftk
javalib :
$(MAKE) -f Makefile -iC $(JAVALIBPATH) all
-attachments.o : attachments.cc attachments.h pdftk.h $(JAVALIB)
+attachments.o : javalib attachments.cc attachments.h pdftk.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(JAVALIBPATH) attachments.cc -c
-report.o : report.cc report.h pdftk.h $(JAVALIB)
+report.o : javalib report.cc report.h pdftk.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(JAVALIBPATH) report.cc -c
-passwords.o : passwords.cc passwords.h pdftk.h $(JAVALIB)
+passwords.o : javalib passwords.cc passwords.h pdftk.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(JAVALIBPATH) passwords.cc -c
-pdftk.o : pdftk.cc pdftk.h attachments.h report.h passwords.h $(JAVALIB)
+pdftk.o : javalib pdftk.cc pdftk.h attachments.h report.h passwords.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(JAVALIBPATH) pdftk.cc -c
-pdftk : pdftk.o attachments.o report.o passwords.o $(JAVALIB) $(LIBGCJ_SUPPLEMENT_FULL_O)
+pdftk : javalib pdftk.o attachments.o report.o passwords.o $(LIBGCJ_SUPPLEMENT_FULL_O)
$(CXX) $(CXXFLAGS) attachments.o report.o passwords.o pdftk.o $(JAVALIB) $(LIBGCJ_SUPPLEMENT_FULL_O) $(LDLIBS) -o pdftk
install:

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "%%JAVA%%" $JAVA_OPTS -classpath "%%CLASSPATH%%" com.gitlab.pdftk_java.pdftk "$@"

View File

@ -12,8 +12,4 @@ Report on PDF Metrics, including Metadata and Bookmarks
Uncompress and Re-Compress Page Streams
Repair Corrupted PDF (Where Possible)
Pdftk is also an example of how to use a library of Java classes
in a stand-alone C++ program. Specifically, it demonstrates how GCJ and CNI
allow C++ code to use iText's (itext-paulo) Java classes.
WWW: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
WWW: https://gitlab.com/pdftk-java/pdftk