--- pdftk-1.41+~dfsg.orig/pdftk/Makefile.Base +++ pdftk-1.41+~dfsg/pdftk/Makefile.Base @@ -72,5 +72,4 @@ rm -vf /usr/local/bin/pdftk clean: - $(MAKE) -C $(java_libs_root) clean rm -vf *.o --- pdftk-1.41+~dfsg.orig/debian/changelog +++ pdftk-1.41+~dfsg/debian/changelog @@ -1,13 +1,166 @@ +pdftk (1.41+~dfsg-0ubuntu1) karmic; urgency=low + + * Repackaged due to some undistributable files copyrighted by Sun + (lp: #384515). + * Added debian/README.source and a get-orig-source target. + * pdftk/Makefile.Base: Patch the clean target directly as it's needed by + the clean target from debian/rules. + * debian/patches: + - pdftk-use-internal-itext.patch: Link with a packaged itext library + (patch taken from Fedora: + https://bugzilla.redhat.com/show_bug.cgi?id=471811) + - Update the other patches (remove now unneeded parts). + - no_embedded_libs, java-calendar: Removed completely. + - itext-2.1.5: Link with libitext-java-gcj 2.1.5 + * debian/control: + - Add a versioned build- and runtime-dependency on libitext-java-gcj. + * debian/rules: + - Generate headers from itext.jar + + -- Michael Bienia Thu, 25 Jun 2009 12:03:49 +0200 + +pdftk (1.41-3ubuntu2) karmic; urgency=low + + * Fix build failure with gcj-4.4. + * Don't depend on versioned compiler, link with -findirect-dispatch. + + -- Matthias Klose Mon, 27 Apr 2009 18:40:33 +0200 + +pdftk (1.41-3ubuntu1) jaunty; urgency=low + + * Rebuild with gcj-4.3. + (Patch taken from Debian bug #470215) + + -- Michael Bienia Sat, 14 Feb 2009 13:39:47 +0100 + +pdftk (1.41-3) unstable; urgency=high + + * Change my email address in the Uploaders field. + * Bump Standards-Version to 3.7.3. + * Remove no longer used Vcs-Git, Vcs-Browser, and + XS-DM-Upload-Allowed fields. + * Change Build-Depends field: gcj-4.2 [!alpha !arm !hppa !hurd-i386]. + (Closes: #477898) + + -- Aurélien GÉRÔME Fri, 30 May 2008 15:08:46 +0200 + +pdftk (1.41-2) unstable; urgency=low + + * Switch from the XS-Vcs-Git/XS-Vcs-Browser fields to the + Vcs-Git/Vcs-Browser fields and fix typos in both URLs. + * Rework debian/copyright to include missing copyright holders + and licenses. + * Add the XS-DM-Upload-Allowed field. + + -- Aurélien GÉRÔME Sun, 02 Dec 2007 00:02:04 +0100 + +pdftk (1.41-1) unstable; urgency=high + + * New upstream release. (Closes: #400920) + * Regenerate upstream tarball by removing superfluous files. + + debian/ + + java_libs/com/lowagie/text/pdf/PRStream.java.orig + + java_libs/com/lowagie/text/pdf/PRTokeniser.java.orig + * Add quilt support. + * Add the XS-Vcs-Git and XS-Vcs-Browser fields. + * Remove the uppercase at the beginning of the Description field. + * Fix upstream homepage location. (Closes: #420973) + + Remove it from the long description. + + Add it in the new Homepage field. + * Remove ${misc:Depends} from the Depends field. + * Fix FTBFS due to new behaviour of gcjh since gcj-4.1.2. + (Closes: #421341, #443714) + * Fix ABI mismatch at runtime due to old embedded copies of gcj + Java source code. (Closes: #426314) + The following directories are thus no longer needed by Debian. + + java_libs/gnu/ + + java_libs/gnu_local/ + + java_libs/java_local/ + * Change Build-Depends to gcj-4.2 and g++-4.2. + + Depends on libgcj8-1. (Closes: #385914, #423417) + * Fix lintian warnings "debian-rules-ignores-make-clean-error". + * Remove unused debhelper tools from debian/rules. + * Update debian/copyright. + + -- Aurélien GÉRÔME Wed, 14 Nov 2007 14:40:12 +0100 + +pdftk (1.40-2) unstable; urgency=low + + * New maintainer. + * Add debian/watch file. + + -- Aurélien GÉRÔME Sun, 15 Oct 2006 17:14:13 +0200 + +pdftk (1.40-1) unstable; urgency=low + + * New upstream version. + - Fix concatenation of 2 pdf documents which some kind of pdf + (closes: bug#385598). + + -- Aurelien Jarno Fri, 22 Sep 2006 16:39:10 +0200 + +pdftk (1.12-11) unstable; urgency=low + + * Mixing different versions of g++ and gcj does not work, explicitely + use gcj-4.1 and g++-4.1. + + -- Aurelien Jarno Sat, 20 May 2006 00:40:04 +0200 + +pdftk (1.12-10) unstable; urgency=low + + * Added -O2 to GCJFLAGS (closes: bug#366661). + * Bumped Standards-Version to 3.7.2 (no changes). + + -- Aurelien Jarno Wed, 10 May 2006 10:56:37 +0200 + +pdftk (1.12-9) unstable; urgency=low + + * Fix previous FDF patch (closes: bug#365084). + + -- Aurelien Jarno Thu, 27 Apr 2006 23:27:01 +0200 + +pdftk (1.12-8) unstable; urgency=low + + * Added a patch to support page rotating. Thanks to David Fabel. + * Bumped Standards-Version to 3.6.2 (no changes). + + -- Aurelien Jarno Mon, 24 Apr 2006 22:03:59 +0200 + +pdftk (1.12-7) unstable; urgency=low + + * Build with -fdollars-in-identifiers to workaround a gcc bug on arm + (closes: bug#334642). + + -- Aurelien Jarno Wed, 19 Oct 2005 19:31:00 +0200 + +pdftk (1.12-6) unstable; urgency=low + + * Fixed FTBFS. + + -- Aurelien Jarno Sun, 16 Oct 2005 21:21:49 +0200 + +pdftk (1.12-5) unstable; urgency=low + + * C++ ABI transition. + + -- Aurelien Jarno Wed, 6 Jul 2005 01:03:57 +0200 + +pdftk (1.12-4) unstable; urgency=low + + * Suggests: xpdf-utils (closes: bug#306625). + + -- Aurelien Jarno Sun, 1 May 2005 11:27:28 +0200 + pdftk (1.12-3) unstable; urgency=low * Depends on libgcj-dev instead of libgcj4-dev. - * Build with gcj instead of gcj-3.33. + * Build with gcj instead of gcj-3.3. -- Aurelien Jarno Wed, 30 Mar 2005 16:44:02 +0200 pdftk (1.12-2) unstable; urgency=low - * Added a patch from Bernhard R. Link to adds a new generate_fdf + * Added a patch from Bernhard R. Link to adds a new generate_fdf action to generate a FDF out of a PDF file. The patch will also be added in the next upstream version (closes: bug#289846). @@ -15,7 +168,7 @@ pdftk (1.12-1) unstable; urgency=low - * New upstream release. + * New upstream release. -- Aurelien Jarno Wed, 10 Nov 2004 21:04:25 +0000 @@ -27,7 +180,7 @@ pdftk (1.10-1) unstable; urgency=low - * New upstream version. + * New upstream version. -- Aurelien Jarno Wed, 27 Oct 2004 14:15:40 +0000 --- pdftk-1.41+~dfsg.orig/debian/watch +++ pdftk-1.41+~dfsg/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.pdfhacks.com/pdftk/pdftk-(.*)\.tar\.gz --- pdftk-1.41+~dfsg.orig/debian/copyright +++ pdftk-1.41+~dfsg/debian/copyright @@ -1,14 +1,88 @@ This package was debianized by Aurelien Jarno on Sun, 15 Feb 2004 23:43:55 +0100. +It is maintained by Aurélien GÉRÔME since +Sun, 15 Oct 2006 17:14:13 +0200. -It was downloaded from http://www.accesspdf.com/pdftk/ +The Debian packaging is (C) 2004-2006 Aurelien Jarno +and (C) 2006-2007 Aurélien GÉRÔME , and is licensed under the +GPL, see `/usr/share/common-licenses/GPL'. -Upstream Author: Sid Steward +It was downloaded from . -Copyright: -This software is copyright (c) 2003-04 by Sid Steward +pdftk code in pdftk/ +-------------------- -You are free to distribute this software under the terms of the GNU General -Public License. On Debian systems, the complete text of the GNU General Public -License can be found in /usr/share/common-licenses/GPL file. + Upstream Author: + + Sid Steward + + Copyright: + + Copyright (C) 2003-2006 Sid Steward + + License: + + You are free to distribute this software under the terms of the + GNU General Public License. + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL file. + + Upstream makefiles everywhere fall under the same copyright + and license. + + +iText library in java_libs/com/lowagie/text/ +-------------------------------------------- + + It was downloaded by the upstream author of pdftk from + . + + Upstream Authors: + + Bruno Lowagie + Paulo Soares + + Copyright: + + Copyright (C) 1999-2002 Bruno Lowagie + Copyright (C) 2000-2002 Paulo Soares + + License: + + This library is free software; you can redistribute it and/or + modify it under the terms of the MPL or under the terms of the GNU + Library General Public License as published by the Free Software + Foundation; either version 2 of the License, or any later version. + + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in /usr/share/common-licenses/GPL file. + + +Portions of GNU Compiler for Java and GNU Classpath in +java_libs/{gnu{,_local},java_local}/ +------------------------------------------------------ + + Upstream Author: + + Free Software Foundation, Inc. + + Copyright: + + Copyright (C) 2003-2006 Free Software Foundation, Inc. + + License: + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or + (at your option) any later version. + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL file. + + Note: + + Old embedded source code copies no longer used by the Debian + package. --- pdftk-1.41+~dfsg.orig/debian/rules +++ pdftk-1.41+~dfsg/debian/rules @@ -10,6 +10,10 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +# Path to the debian directory +DEBIAN_DIR := $(shell echo ${MAKEFILE_LIST} | awk '{print $$1}' | xargs dirname ) +UPSTREAM_VERSION ?=$(shell uscan --dehs | sed -n 's/.*\(.*\)<\/upstream-version>.*/\1/p') + ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif @@ -17,21 +21,34 @@ INSTALL_PROGRAM += -s endif +get-orig-source: + cd ${DEBIAN_DIR}/.. && uscan --force-download + tar xf ../pdftk-${UPSTREAM_VERSION}.tar.gz + rm ../pdftk-${UPSTREAM_VERSION}.tar.gz + rm -r pdftk-${UPSTREAM_VERSION}/java_libs + mv pdftk-${UPSTREAM_VERSION} pdftk-${UPSTREAM_VERSION}+~dfsg.orig + tar -cf ../pdftk_${UPSTREAM_VERSION}+~dfsg.orig.tar pdftk-${UPSTREAM_VERSION}+~dfsg.orig + rm -fr pdftk-${UPSTREAM_VERSION}+~dfsg.orig + gzip -9fn ../pdftk_${UPSTREAM_VERSION}+~dfsg.orig.tar + build: build-stamp build-stamp: dh_testdir - cd $(CURDIR)/pdftk && $(MAKE) -f Makefile.Debian + QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2 + jar tf /usr/share/java/itext.jar | grep '\.class$$' | sed 's/\.class//' | sed 's|/|\.|g' > classes + gjavah -d java_libs -cni -classpath=/usr/share/java/itext.jar `cat classes` + rm classes + $(MAKE) -C $(CURDIR)/pdftk -f Makefile.Debian touch build-stamp -clean: debian-clean - dh_clean - -debian-clean: +clean: dh_testdir - dh_testroot - -make -C pdftk -f Makefile.Debian clean - -make -C $(CURDIR)/java_libs/ clean - -rm -f *-stamp + [ ! -f $(CURDIR)/pdftk/Makefile.Debian ] || make -C $(CURDIR)/pdftk -f Makefile.Debian clean + rm -rf java_libs + QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2 + rm -rf .pc + rm -f build-stamp + dh_clean install: build dh_testdir @@ -43,7 +60,6 @@ install -o root -g root -m 755 -d $(CURDIR)/debian/pdftk/usr/bin install -o root -g root -m 755 pdftk/pdftk $(CURDIR)/debian/pdftk/usr/bin - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -52,15 +68,9 @@ binary-arch: build install dh_testdir dh_testroot -# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit dh_installcron dh_installman dh_installinfo @@ -69,10 +79,8 @@ dh_strip dh_compress dh_fixperms -# dh_makeshlibs dh_installdeb -# dh_perl - dh_shlibdeps + dh_shlibdeps -l/ dh_gencontrol dh_md5sums dh_builddeb --- pdftk-1.41+~dfsg.orig/debian/control +++ pdftk-1.41+~dfsg/debian/control @@ -1,14 +1,17 @@ Source: pdftk -Maintainer: Aurelien Jarno +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Aurélien GÉRÔME Section: text Priority: optional -Build-Depends: debhelper (>= 4.0.0), gcj-4.1, g++-4.1 -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 4.0.0), quilt, gcj [!alpha !arm !hppa !hurd-i386], libitext-java-gcj (>= 2.1.5) +Standards-Version: 3.7.3 +Homepage: http://www.pdfhacks.com/pdftk/ Package: pdftk Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: A useful tool for manipulating PDF documents +Depends: ${shlibs:Depends}, libitext-java-gcj (>= 2.1.5-1ubuntu2), libitext-java-gcj (<< 2.1.6) +Suggests: xpdf-utils +Description: useful tool for manipulating PDF documents If PDF is electronic paper, then pdftk is an electronic stapler-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Keep one in the @@ -28,4 +31,3 @@ - Repair corrupted PDF (where possible) . Author: Sid Steward - Homepage: http://www.accesspdf.com/pdftk --- pdftk-1.41+~dfsg.orig/debian/README.source +++ pdftk-1.41+~dfsg/debian/README.source @@ -0,0 +1,8 @@ +This a repackaged version of the source as can be downloaded from upstream. +The reason is that it contains some undistributable files from Sun in +java_libs/com/lowagie/text/pdf/codec/postscript/ +(see https://bugs.launchpad.net/bugs/384515 and +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519466) + +The get-orig-source target removes the whole java_libs directory so pdftk can +be build with a packaged libitext-java. --- pdftk-1.41+~dfsg.orig/debian/patches/series +++ pdftk-1.41+~dfsg/debian/patches/series @@ -0,0 +1,4 @@ +pdftk-use-internal-itext +build_with_gcc-4.3 +indirect-dispatch +itext-2.1.5 --- pdftk-1.41+~dfsg.orig/debian/patches/build_with_gcc-4.3 +++ pdftk-1.41+~dfsg/debian/patches/build_with_gcc-4.3 @@ -0,0 +1,32 @@ +Index: pdftk-1.41/pdftk/Makefile.Debian +=================================================================== +--- pdftk-1.41.orig/pdftk/Makefile.Debian 2007-11-08 14:03:26.780004635 +0100 ++++ pdftk-1.41/pdftk/Makefile.Debian 2007-11-08 14:03:29.072639728 +0100 +@@ -12,7 +12,7 @@ + + # tools + TOOLPATH= +-VERSUFF=-4.1 ++export VERSUFF= + CXX= $(TOOLPATH)g++$(VERSUFF) + export GCJ= $(TOOLPATH)gcj$(VERSUFF) + export GCJH= $(TOOLPATH)gcjh$(VERSUFF) +@@ -23,7 +23,7 @@ + # if you want pdftk to ask before overwriting a file, set + # ASK_ABOUT_WARNINGS to true; otherwise: false; override this default + # with the dont_ask or do_ask command-line options +-CPPFLAGS= -O3 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers ++CPPFLAGS= -w -O2 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers + CXXFLAGS= -lgcj + + # itext compiler flags +Index: pdftk-1.41/pdftk/Makefile.Base +=================================================================== +--- pdftk-1.41.orig/pdftk/Makefile.Base 2007-11-08 14:03:42.008223078 +0100 ++++ pdftk-1.41/pdftk/Makefile.Base 2007-11-08 14:03:50.490572824 +0100 +@@ -49,4 +49,4 @@ + rm -vf /usr/local/bin/pdftk + + clean: +- rm -vf *.o ++ rm -vf *.o pdftk --- pdftk-1.41+~dfsg.orig/debian/patches/itext-2.1.5 +++ pdftk-1.41+~dfsg/debian/patches/itext-2.1.5 @@ -0,0 +1,13 @@ +Index: pdftk-1.41+~dfsg/pdftk/Makefile.Base +=================================================================== +--- pdftk-1.41+~dfsg.orig/pdftk/Makefile.Base 2009-06-22 11:14:59.000000000 +0200 ++++ pdftk-1.41+~dfsg/pdftk/Makefile.Base 2009-06-22 11:16:33.000000000 +0200 +@@ -15,7 +15,7 @@ + # them into fonts.a resulted in none of these resources appearing in pdftk + # (on MinGW gcj 3.4.1) + # +-itext_libs=$(LIBDIR)/gcj/itext/itext-2.1.4.jar.so ++itext_libs=/usr/lib/gcj/itext-2.1.5.jar.so + + # font metric files, included as resources + afms= $(wildcard $(java_libs_root)/com/lowagie/text/pdf/fonts/*.afm) --- pdftk-1.41+~dfsg.orig/debian/patches/indirect-dispatch +++ pdftk-1.41+~dfsg/debian/patches/indirect-dispatch @@ -0,0 +1,22 @@ +--- ./pdftk/Makefile.Debian~ 2009-04-27 16:43:06.000000000 +0000 ++++ ./pdftk/Makefile.Debian 2009-04-27 17:04:00.000000000 +0000 +@@ -24,7 +24,7 @@ + # ASK_ABOUT_WARNINGS to true; otherwise: false; override this default + # with the dont_ask or do_ask command-line options + CPPFLAGS= -w -O2 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers +-CXXFLAGS= -lgcj ++CXXFLAGS= -findirect-dispatch -lstdc++ + + # itext compiler flags + # -O3 causes pdftk to segfault (during a cat operation) when compiled on sarge using gcc 3.4.4 +--- ./pdftk/Makefile.Base~ 2009-04-27 16:43:07.000000000 +0000 ++++ ./pdftk/Makefile.Base 2009-04-27 17:02:31.000000000 +0000 +@@ -40,7 +40,7 @@ + $(CXX) pdftk.cc -I$(java_libs_root) $(CPPFLAGS) -c + + pdftk : pdftk.o attachments.o report.o $(itext_libs) $(afm_objects) +- $(CXX) pdftk.o attachments.o report.o $(itext_libs) $(afm_objects) -I$(java_libs_root) $(CPPFLAGS) $(CXXFLAGS) -o pdftk ++ $(GCJ) pdftk.o attachments.o report.o $(itext_libs) $(afm_objects) -I$(java_libs_root) $(CXXFLAGS) -o pdftk + + install: + /usr/bin/install pdftk /usr/local/bin --- pdftk-1.41+~dfsg.orig/debian/patches/pdftk-use-internal-itext +++ pdftk-1.41+~dfsg/debian/patches/pdftk-use-internal-itext @@ -0,0 +1,400 @@ +Patch taken from Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=471811 + +Link to the already packaged itext library instead of using the old embedded one. + +diff -r -u /tmp/pdftk-1.41/pdftk/attachments.cc ./pdftk/attachments.cc +--- /tmp/pdftk-1.41/pdftk/attachments.cc 2004-10-27 02:57:44.000000000 +0100 ++++ ./pdftk/attachments.cc 2009-02-12 15:38:08.000000000 +0000 +@@ -51,7 +51,11 @@ + + #include "com/lowagie/text/Document.h" + #include "com/lowagie/text/Rectangle.h" ++// Ewww, PdfName has a field called NULL. ++#undef NULL + #include "com/lowagie/text/pdf/PdfName.h" ++#define NULL __null ++ + #include "com/lowagie/text/pdf/PdfString.h" + #include "com/lowagie/text/pdf/PdfNumber.h" + #include "com/lowagie/text/pdf/PdfArray.h" +@@ -148,8 +152,8 @@ + + itext::Rectangle* crop_box_p= + input_reader_p->getCropBox( m_input_attach_file_pagenum ); +- float corner_top= crop_box_p->top()- margin; +- float corner_left= crop_box_p->left()+ margin; ++ float corner_top= crop_box_p->getTop()- margin; ++ float corner_left= crop_box_p->getLeft()+ margin; + + itext::PdfArray* annots_p= (itext::PdfArray*) + input_reader_p->getPdfObject( page_p->get( itext::PdfName::ANNOTS ) ); +@@ -187,11 +191,11 @@ + string filename= drop_path(*vit); + + // wrap our location over page bounds, if needed +- if( crop_box_p->right() < corner_left+ trans ) { +- corner_left= crop_box_p->left()+ margin; ++ if( crop_box_p->getRight() < corner_left+ trans ) { ++ corner_left= crop_box_p->getLeft()+ margin; + } +- if( corner_top- trans< crop_box_p->bottom() ) { +- corner_top= crop_box_p->top()- margin; ++ if( corner_top- trans< crop_box_p->getBottom() ) { ++ corner_top= crop_box_p->getTop()- margin; + } + + itext::Rectangle* annot_bbox_p= +diff -r -u /tmp/pdftk-1.41/pdftk/Makefile.Base ./pdftk/Makefile.Base +--- /tmp/pdftk-1.41/pdftk/Makefile.Base 2006-10-25 00:44:06.000000000 +0100 ++++ ./pdftk/Makefile.Base 2009-02-12 13:40:04.000000000 +0000 +@@ -15,34 +15,12 @@ + # them into fonts.a resulted in none of these resources appearing in pdftk + # (on MinGW gcj 3.4.1) + # +-itext_libs= \ +-$(java_libs_root)/com/lowagie/text/pdf/pdf.a \ +-$(java_libs_root)/com/lowagie/text/text.a \ +-$(java_libs_root)/com/lowagie/text/pdf/pdf.a \ +-$(java_libs_root)/com/lowagie/text/pdf/codec/codec.a \ +-$(java_libs_root)/com/lowagie/text/pdf/codec/wmf/wmf.a \ +-$(java_libs_root)/com/lowagie/text/pdf/fonts/fonts.a \ +-$(java_libs_root)/com/lowagie/text/markup/markup.a \ +-$(java_libs_root)/com/lowagie/text/xml/xmp/xmp.a \ +-$(java_libs_root)/com/lowagie/bc/asn1/asn1.a \ +-$(java_libs_root)/com/lowagie/text/pdf/codec/postscript/postscript.a \ ++itext_libs=$(LIBDIR)/gcj/itext/itext-2.1.4.jar.so + + # font metric files, included as resources + afms= $(wildcard $(java_libs_root)/com/lowagie/text/pdf/fonts/*.afm) + afm_objects= $(patsubst %.afm, %.o, $(afms)) + +-# older versions of libgcj might not have the MD5 algorithm, +-# so I added it here; these *_local java files were grabbed from +-# libgcj CVS on March 7, 2004; diffed September 5, 2006 w/ gcc 4.1.1 +-# +-# gnu/gcj/convert/Input_UnicodeBig.java was grabbed March 26, 2004; diffed September 5, 2006 w/ gcc 4.1.1 +-# +-libgcj_local_libs = \ +-$(java_libs_root)/java_local/security/security.a \ +-$(java_libs_root)/gnu_local/java/security/provider/provider.a \ +-$(java_libs_root)/gnu_local/java/security/security.a \ +-$(java_libs_root)/gnu/gcj/convert/convert.a +- + # this must already be set according to your platform Makefile; + # we're just appending to it, here + # +@@ -51,19 +29,18 @@ + all : java_libs pdftk + + java_libs : +- $(MAKE) -C $(java_libs_root) + +-attachments.o : attachments.cc attachments.h pdftk.h $(itext_libs) $(libgcj_local_libs) ++attachments.o : attachments.cc attachments.h pdftk.h $(itext_libs) + $(CXX) attachments.cc -I$(java_libs_root) $(CPPFLAGS) -c + +-report.o : report.cc report.h pdftk.h $(itext_libs) $(libgcj_local_libs) ++report.o : report.cc report.h pdftk.h $(itext_libs) + $(CXX) report.cc -I$(java_libs_root) $(CPPFLAGS) -c + +-pdftk.o : pdftk.cc pdftk.h attachments.h report.h $(itext_libs) $(libgcj_local_libs) ++pdftk.o : pdftk.cc pdftk.h attachments.h report.h $(itext_libs) + $(CXX) pdftk.cc -I$(java_libs_root) $(CPPFLAGS) -c + +-pdftk : pdftk.o attachments.o report.o $(itext_libs) $(libgcj_local_libs) $(afm_objects) +- $(CXX) pdftk.o attachments.o report.o $(itext_libs) $(libgcj_local_libs) $(afm_objects) -I$(java_libs_root) $(CPPFLAGS) $(CXXFLAGS) -o pdftk ++pdftk : pdftk.o attachments.o report.o $(itext_libs) $(afm_objects) ++ $(CXX) pdftk.o attachments.o report.o $(itext_libs) $(afm_objects) -I$(java_libs_root) $(CPPFLAGS) $(CXXFLAGS) -o pdftk + + install: + /usr/bin/install pdftk /usr/local/bin +diff -r -u /tmp/pdftk-1.41/pdftk/Makefile.RedHat ./pdftk/Makefile.RedHat +--- /tmp/pdftk-1.41/pdftk/Makefile.RedHat 2006-09-21 18:37:38.000000000 +0100 ++++ ./pdftk/Makefile.RedHat 2009-02-12 12:18:43.000000000 +0000 +@@ -26,12 +26,12 @@ + # if you want pdftk to ask before overwriting a file, set + # ASK_ABOUT_WARNINGS to true; otherwise: false; override this default + # with the dont_ask or do_ask command-line options +-CPPFLAGS= -O2 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers ++CPPFLAGS= ${RPM_OPT_FLAGS} -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers -g -fpic + CXXFLAGS= -lgcj + + # itext compiler flags + # -O3 might cause pdftk to segfault on cat operation (gcc 3.4.4) +-export GCJFLAGS= -O2 ++export GCJFLAGS= ${RPM_OPT_FLAGS} + + # + export ARFLAGS= rs +diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc +--- /tmp/pdftk-1.41/pdftk/pdftk.cc 2006-11-28 22:51:36.000000000 +0000 ++++ ./pdftk/pdftk.cc 2009-02-12 16:28:33.000000000 +0000 +@@ -50,7 +50,12 @@ + + #include "com/lowagie/text/Document.h" + #include "com/lowagie/text/Rectangle.h" ++ ++// Ewww, PdfName has a field called NULL. ++#undef NULL + #include "com/lowagie/text/pdf/PdfName.h" ++#define NULL __null ++ + #include "com/lowagie/text/pdf/PdfString.h" + #include "com/lowagie/text/pdf/PdfNumber.h" + #include "com/lowagie/text/pdf/PdfArray.h" +@@ -191,7 +196,8 @@ + // store in this java object so the gc can trace it + g_dont_collect_p->addElement( reader ); + +- input_pdf_p->m_authorized_b= ( !reader->encrypted || reader->passwordIsOwner ); ++ input_pdf_p->m_authorized_b= ( !reader->encrypted // || reader->passwordIsOwner ++ ); + if( !input_pdf_p->m_authorized_b ) { + open_success_b= false; + } +@@ -203,6 +209,7 @@ + open_success_b= false; + } + catch( java::lang::Throwable* t_p ) { // unexpected error ++ t_p->printStackTrace(); + cerr << "Error: Unexpected Exception in open_reader()" << endl; + open_success_b= false; + +@@ -2017,14 +2024,14 @@ + output_doc_p->addCreator( jv_creator_p ); + + // un/compress output streams? +- if( m_output_uncompress_b ) { +- writer_p->filterStreams= true; +- writer_p->compressStreams= false; +- } +- else if( m_output_compress_b ) { +- writer_p->filterStreams= false; +- writer_p->compressStreams= true; +- } ++// if( m_output_uncompress_b ) { ++// writer_p->filterStreams= true; ++// writer_p->compressStreams= false; ++// } ++// else if( m_output_compress_b ) { ++// writer_p->filterStreams= false; ++// writer_p->compressStreams= true; ++// } + + // encrypt output? + if( m_output_encryption_strength!= none_enc || +@@ -2033,7 +2040,7 @@ + { + // if no stregth is given, default to 128 bit, + // (which is incompatible w/ Acrobat 4) +- bool bit128_b= ++ jboolean bit128_b= + ( m_output_encryption_strength!= bits40_enc ); + + writer_p->setEncryption( output_user_pw_p, +@@ -2057,7 +2064,8 @@ + input_reader_p->getPdfObject( trailer_p->get( itext::PdfName::ID ) ); + if( file_id_p && file_id_p->isArray() ) { + +- writer_p->setFileID( file_id_p ); ++ // Absent from itext-2.1.4 ++// writer_p->setFileID( file_id_p ); + } + } + +@@ -2168,12 +2176,14 @@ + + // un/compress output streams? + if( m_output_uncompress_b ) { +- writer_p->filterStreams= true; +- writer_p->compressStreams= false; ++ // Absent from itext-2.1.4 ++// writer_p->filterStreams= true; ++// writer_p->compressStreams= false; + } + else if( m_output_compress_b ) { +- writer_p->filterStreams= false; +- writer_p->compressStreams= true; ++ // Absent from itext-2.1.4 ++// writer_p->filterStreams= false; ++// writer_p->compressStreams= true; + } + + // encrypt output? +@@ -2183,7 +2193,7 @@ + { + // if no stregth is given, default to 128 bit, + // (which is incompatible w/ Acrobat 4) +- bool bit128_b= ++ jboolean bit128_b= + ( m_output_encryption_strength!= bits40_enc ); + + writer_p->setEncryption( output_user_pw_p, +@@ -2403,13 +2413,15 @@ + // un/compress output streams? + if( m_output_uncompress_b ) { + add_marks_to_pages( input_reader_p ); +- writer_p->filterStreams= true; +- writer_p->compressStreams= false; ++ // Absent from itext-2.1.4 ++// writer_p->filterStreams= true; ++// writer_p->compressStreams= false; + } + else if( m_output_compress_b ) { + remove_marks_from_pages( input_reader_p ); +- writer_p->filterStreams= false; +- writer_p->compressStreams= true; ++ // Absent from itext-2.1.4 ++// writer_p->filterStreams= false; ++// writer_p->compressStreams= true; + } + + // encrypt output? +@@ -2420,13 +2432,13 @@ + + // if no stregth is given, default to 128 bit, + // (which is incompatible w/ Acrobat 4) +- bool bit128_b= ++ jboolean bit128_b= + ( m_output_encryption_strength!= bits40_enc ); + + writer_p->setEncryption( output_user_pw_p, + output_owner_pw_p, + m_output_user_perms, +- bit128_b ); ++ bit128_b ); + } + + // fill form fields? +@@ -2435,8 +2447,11 @@ + { + itext::AcroFields* fields_p= writer_p->getAcroFields(); + fields_p->setGenerateAppearances( true ); // have iText create field appearances +- if( fdf_reader_p && fields_p->setFields( fdf_reader_p ) || +- xfdf_reader_p && fields_p->setFields( xfdf_reader_p ) ) ++ if( fdf_reader_p ) ++ fields_p->setFields( fdf_reader_p ); ++ if( xfdf_reader_p ) ++ fields_p->setFields( xfdf_reader_p ); ++ + { // Rich Text input found + + // set the PDF so that Acrobat will create appearances; +@@ -2486,16 +2501,16 @@ + doc_page_size_p= doc_page_size_p->rotate(); + } + +- jfloat h_scale= doc_page_size_p->width() / mark_page_size_p->width(); +- jfloat v_scale= doc_page_size_p->height() / mark_page_size_p->height(); ++ jfloat h_scale= doc_page_size_p->getWidth() / mark_page_size_p->getWidth(); ++ jfloat v_scale= doc_page_size_p->getHeight() / mark_page_size_p->getHeight(); + jfloat mark_scale= (h_scale< v_scale) ? h_scale : v_scale; + +- jfloat h_trans= (jfloat)(doc_page_size_p->left()- mark_page_size_p->left()* mark_scale + +- (doc_page_size_p->width()- +- mark_page_size_p->width()* mark_scale) / 2.0); +- jfloat v_trans= (jfloat)(doc_page_size_p->bottom()- mark_page_size_p->bottom()* mark_scale + +- (doc_page_size_p->height()- +- mark_page_size_p->height()* mark_scale) / 2.0); ++ jfloat h_trans= (jfloat)(doc_page_size_p->getLeft()- mark_page_size_p->getLeft()* mark_scale + ++ (doc_page_size_p->getWidth()- ++ mark_page_size_p->getWidth()* mark_scale) / 2.0); ++ jfloat v_trans= (jfloat)(doc_page_size_p->getBottom()- mark_page_size_p->getBottom()* mark_scale + ++ (doc_page_size_p->getHeight()- ++ mark_page_size_p->getHeight()* mark_scale) / 2.0); + + com::lowagie::text::pdf::PdfContentByte* content_byte_p= + ( background_b ) ? writer_p->getUnderContent( ii ) : writer_p->getOverContent( ii ); +@@ -2512,20 +2527,20 @@ + 0, -1* mark_scale, + mark_scale, 0, + h_trans, +- v_trans+ mark_page_size_p->height()* mark_scale ); ++ v_trans+ mark_page_size_p->getHeight()* mark_scale ); + } + else if( mark_page_rotation== 180 ) { + content_byte_p->addTemplate( mark_page_p, + -1* mark_scale, 0, + 0, -1* mark_scale, +- h_trans+ mark_page_size_p->width()* mark_scale, +- v_trans+ mark_page_size_p->height()* mark_scale ); ++ h_trans+ mark_page_size_p->getWidth()* mark_scale, ++ v_trans+ mark_page_size_p->getHeight()* mark_scale ); + } + else if( mark_page_rotation== 270 ) { + content_byte_p->addTemplate( mark_page_p, + 0, mark_scale, + -1* mark_scale, 0, +- h_trans+ mark_page_size_p->width()* mark_scale, v_trans ); ++ h_trans+ mark_page_size_p->getWidth()* mark_scale, v_trans ); + } + } + } +@@ -2537,7 +2552,7 @@ + } + + // done; write output +- writer_p->close(); ++ writer_p->close(NULL); + } + break; + +@@ -2663,15 +2678,15 @@ + JvCreateJavaVM(NULL); + JvAttachCurrentThread(NULL, NULL); + +- JvInitClass(&java::System::class$); +- JvInitClass(&java::util::ArrayList::class$); +- JvInitClass(&java::util::Iterator::class$); +- +- JvInitClass(&itext::PdfObject::class$); +- JvInitClass(&itext::PdfName::class$); +- JvInitClass(&itext::PdfDictionary::class$); +- JvInitClass(&itext::PdfOutline::class$); +- JvInitClass(&itext::PdfBoolean::class$); ++// JvInitClass(&java::System::class$); ++// JvInitClass(&java::util::ArrayList::class$); ++// JvInitClass(&java::util::Iterator::class$); ++ ++// JvInitClass(&itext::PdfObject::class$); ++// JvInitClass(&itext::PdfName::class$); ++// JvInitClass(&itext::PdfDictionary::class$); ++// JvInitClass(&itext::PdfOutline::class$); ++// JvInitClass(&itext::PdfBoolean::class$); + + TK_Session tk_session( argc, argv ); + +diff -r -u /tmp/pdftk-1.41/pdftk/report.cc ./pdftk/report.cc +--- /tmp/pdftk-1.41/pdftk/report.cc 2006-09-06 00:49:32.000000000 +0100 ++++ ./pdftk/report.cc 2009-02-12 15:42:56.000000000 +0000 +@@ -50,8 +50,13 @@ + + #include "com/lowagie/text/Document.h" + #include "com/lowagie/text/Rectangle.h" ++#undef NULL ++ ++// Ewww, PdfName has a field called NULL. + #include "com/lowagie/text/pdf/PdfObject.h" + #include "com/lowagie/text/pdf/PdfName.h" ++#define NULL __null ++ + #include "com/lowagie/text/pdf/PdfString.h" + #include "com/lowagie/text/pdf/PdfNumber.h" + #include "com/lowagie/text/pdf/PdfArray.h" +@@ -1315,11 +1320,12 @@ + if( xmp_str_p ) { + xmp_str_p->put( itext::PdfName::TYPE, itext::PdfName::METADATA ); + xmp_str_p->put( itext::PdfName::SUBTYPE, itext::PdfName::XML ); +- +- itext::PdfIndirectReference* xmp_str_ref_p= +- (itext::PdfIndirectReference*)reader_p->getPRIndirectReference( xmp_str_p ); + +- catalog_p->put( itext::PdfName::METADATA, xmp_str_ref_p ); ++// FIXME: PdfReader.getPRIndirectReference is absent from itext-2.1.4 ++// itext::PdfIndirectReference* xmp_str_ref_p= ++// (itext::PdfIndirectReference*)reader_p->getPRIndirectReference( xmp_str_p ); ++ ++// catalog_p->put( itext::PdfName::METADATA, xmp_str_ref_p ); + } + else { + ret_val_b= false;