[pdftk] - Updated to 1.44. No need to regenerate the tarball since the files with problematic licenses are
Orcan Ogetbil
oget at fedoraproject.org
Mon Jan 10 01:58:54 UTC 2011
commit b58646a34d49204aef02d8a695946ebb8d00c33c
Author: Orcan Ogetbil <oget.fedora at gmail.com>
Date: Sun Jan 9 20:58:41 2011 -0500
- Updated to 1.44. No need to regenerate the tarball since the files with
problematic licenses are removed by upstream.
.gitignore | 1 +
pdftk-1.41-gcc44.patch | 12 --
pdftk-1.41-make.patch | 12 --
pdftk-use-internal-itext.patch | 399 +++++++++++++++++-----------------------
pdftk.spec | 47 +++--
sources | 2 +-
6 files changed, 201 insertions(+), 272 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index bb91db4..93f2bc0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
pdftk-1.41-noitext.tar.bz2
+/pdftk-1.44-src.zip
diff --git a/pdftk-use-internal-itext.patch b/pdftk-use-internal-itext.patch
index 01b1c54..1507c25 100644
--- a/pdftk-use-internal-itext.patch
+++ b/pdftk-use-internal-itext.patch
@@ -1,166 +1,119 @@
-
-
-
-
-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}
+diff -rupN pdftk-1.44-dist.old/pdftk/attachments.cc pdftk-1.44-dist/pdftk/attachments.cc
+--- pdftk-1.44-dist.old/pdftk/attachments.cc 2010-10-27 15:16:19.000000000 -0400
++++ pdftk-1.44-dist/pdftk/attachments.cc 2011-01-09 15:19:32.000000000 -0500
+@@ -56,7 +56,10 @@
+ #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"
+@@ -151,8 +154,8 @@ TK_Session::attach_files
+
+ 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 ) );
+@@ -190,11 +193,11 @@ TK_Session::attach_files
+ 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 -rupN pdftk-1.44-dist.old/pdftk/Makefile.Base pdftk-1.44-dist/pdftk/Makefile.Base
+--- pdftk-1.44-dist.old/pdftk/Makefile.Base 2010-10-28 17:19:18.000000000 -0400
++++ pdftk-1.44-dist/pdftk/Makefile.Base 2011-01-09 15:24:09.000000000 -0500
+@@ -16,7 +16,7 @@
+
+ export JAVALIBPATH= ../java
+
+-JAVALIB= $(JAVALIBPATH)/java_lib.o
++JAVALIB= $(LIBDIR)/gcj/itext/itext-$(ITEXTVERS).jar.so
+
+ ifdef USE_LOCAL_LIBGCJ
+ # passed on to next makefile
+@@ -29,7 +29,7 @@ endif
+ #
+ CPPFLAGS+= -DPDFTK_VER=\"1.44\"
+
+-all : javalib pdftk
++all : pdftk
+
+ javalib :
+ $(MAKE) -f Makefile -iC $(JAVALIBPATH) all
+diff -rupN pdftk-1.44-dist.old/pdftk/Makefile.Redhat pdftk-1.44-dist/pdftk/Makefile.Redhat
+--- pdftk-1.44-dist.old/pdftk/Makefile.Redhat 2010-09-16 14:23:20.000000000 -0400
++++ pdftk-1.44-dist/pdftk/Makefile.Redhat 2011-01-09 17:00:40.000000000 -0500
+@@ -72,9 +72,9 @@ export RMFLAGS= -vf
+ # only effects libraries following option on the command line
#
- 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 @@
+ #
+-export CPPFLAGS= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers
+-export CXXFLAGS= -Wall -Wextra -Weffc++ -O2
+-export GCJFLAGS= -Wall -Wextra -O2
++export CPPFLAGS= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers ${CFLAGS} -fpic
++export CXXFLAGS= -Wall -Wextra -Weffc++ -O2 ${CFLAGS} -fpic
++export GCJFLAGS= -Wall -Wextra -O2 ${CFLAGS} -fpic
+ export GCJHFLAGS= -force
+ export LDLIBS= -lgcj
+
+diff -rupN pdftk-1.44-dist.old/pdftk/pdftk.cc pdftk-1.44-dist/pdftk/pdftk.cc
+--- pdftk-1.44-dist.old/pdftk/pdftk.cc 2010-10-28 17:18:31.000000000 -0400
++++ pdftk-1.44-dist/pdftk/pdftk.cc 2011-01-09 18:28:28.000000000 -0500
+@@ -59,7 +59,10 @@
#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 @@
+@@ -193,15 +196,20 @@ TK_Session::add_reader( InputPdf* input_
// 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
-+ );
++ input_pdf_p->m_authorized_b= reader->isOpenedWithFullPermissions();
if( !input_pdf_p->m_authorized_b ) {
open_success_b= false;
}
-@@ -203,6 +209,7 @@
+ }
+ catch( java::io::IOException* ioe_p ) { // file open error
+- if( ioe_p->getMessage()->equals( JvNewStringUTF( "Bad password" ) ) ) {
++ if( ioe_p->getMessage()->equals( JvNewStringUTF( "Bad user password" ) ) ) {
+ input_pdf_p->m_authorized_b= false;
+ }
++ else {
++ cerr << string((const char*) elements(ioe_p->getMessage()->getBytes()),
++ (int) ioe_p->getMessage()->getBytes()->length)
++ << endl;
++ }
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 @@
+@@ -2182,14 +2190,14 @@ TK_Session::create_output()
output_doc_p->addCreator( jv_creator_p );
// un/compress output streams?
@@ -172,18 +125,18 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
- 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;
-+// }
++// 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 @@
+@@ -2198,7 +2206,7 @@ TK_Session::create_output()
{
// if no stregth is given, default to 128 bit,
// (which is incompatible w/ Acrobat 4)
@@ -192,36 +145,36 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
( m_output_encryption_strength!= bits40_enc );
writer_p->setEncryption( output_user_pw_p,
-@@ -2057,7 +2064,8 @@
+@@ -2222,7 +2230,8 @@ TK_Session::create_output()
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 );
++ // Absent from itext-2.1.7
++// writer_p->setFileID( file_id_p );
}
}
-@@ -2168,12 +2176,14 @@
+@@ -2328,12 +2337,14 @@ TK_Session::create_output()
// 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;
++ // Absent from itext-2.1.7
++// 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;
++ // Absent from itext-2.1.7
++// writer_p->filterStreams= false;
++// writer_p->compressStreams= true;
}
// encrypt output?
-@@ -2183,7 +2193,7 @@
+@@ -2343,7 +2354,7 @@ TK_Session::create_output()
{
// if no stregth is given, default to 128 bit,
// (which is incompatible w/ Acrobat 4)
@@ -230,27 +183,27 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
( m_output_encryption_strength!= bits40_enc );
writer_p->setEncryption( output_user_pw_p,
-@@ -2403,13 +2413,15 @@
+@@ -2589,13 +2600,15 @@ TK_Session::create_output()
// 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;
++ // Absent from itext-2.1.7
++// 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;
++ // Absent from itext-2.1.7
++// writer_p->filterStreams= false;
++// writer_p->compressStreams= true;
}
// encrypt output?
-@@ -2420,13 +2432,13 @@
+@@ -2606,7 +2619,7 @@ TK_Session::create_output()
// if no stregth is given, default to 128 bit,
// (which is incompatible w/ Acrobat 4)
@@ -259,28 +212,20 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
( 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 @@
+@@ -2621,8 +2634,10 @@ TK_Session::create_output()
{
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 )
+- 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 )
++ 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 @@
+@@ -2688,16 +2703,16 @@ TK_Session::create_output()
doc_page_size_p= doc_page_size_p->rotate();
}
@@ -305,7 +250,7 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
com::lowagie::text::pdf::PdfContentByte* content_byte_p=
( background_b ) ? writer_p->getUnderContent( ii ) : writer_p->getOverContent( ii );
-@@ -2512,20 +2527,20 @@
+@@ -2714,20 +2729,20 @@ TK_Session::create_output()
0, -1* mark_scale,
mark_scale, 0,
h_trans,
@@ -330,7 +275,7 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
}
}
}
-@@ -2537,7 +2552,7 @@
+@@ -2739,7 +2754,7 @@ TK_Session::create_output()
}
// done; write output
@@ -339,7 +284,7 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
}
break;
-@@ -2663,15 +2678,15 @@
+@@ -2903,15 +2918,15 @@ Bug-Debian: http://bugs.debian.org/56059
JvCreateJavaVM(NULL);
JvAttachCurrentThread(NULL, NULL);
@@ -352,49 +297,47 @@ diff -r -u /tmp/pdftk-1.41/pdftk/pdftk.cc ./pdftk/pdftk.cc
- 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(&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(&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;
+diff -rupN pdftk-1.44-dist.old/pdftk/report.cc pdftk-1.44-dist/pdftk/report.cc
+--- pdftk-1.44-dist.old/pdftk/report.cc 2010-10-27 16:09:41.000000000 -0400
++++ pdftk-1.44-dist/pdftk/report.cc 2011-01-09 15:19:32.000000000 -0500
+@@ -55,8 +55,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/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"
+@@ -1363,11 +1366,12 @@ ReplaceXmp( itext::PdfReader* reader_p,
+ 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.7
++// 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;
diff --git a/pdftk.spec b/pdftk.spec
index 49315bc..7c85bca 100644
--- a/pdftk.spec
+++ b/pdftk.spec
@@ -2,15 +2,12 @@
Summary: The PDF Tool Kit
Name: pdftk
-Version: 1.41
-Release: 27%{?dist}
+Version: 1.44
+Release: 1%{?dist}
License: GPLv2+
-URL: http://www.pdfhacks.com/pdftk/
-# Remove java-lib/com because it's contains licensing issue
-Source0: http://www.pdfhacks.com/pdftk/%{name}-%{version}-noitext.tar.bz2
+URL: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
+Source0: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/%{name}-%{version}-src.zip
Patch0: pdftk-use-internal-itext.patch
-Patch1: pdftk-1.41-make.patch
-Patch2: pdftk-1.41-gcc44.patch
# Solves ".afm files not found" error. RHBZ#494785:
Patch4: pdftk-classpath.patch
Group: Applications/Publishing
@@ -21,7 +18,7 @@ BuildRequires: java-devel >= 1:1.6.0
BuildRequires: itext >= %{itextvers}
-Requires: itext%{?_isa} >= 2.1.7-1
+Requires: itext%{?_isa} >= 2.1.7-6
%description
If PDF is electronic paper, then pdftk is an electronic staple-remover,
@@ -43,29 +40,35 @@ stand-alone C++ program. Specifically, it demonstrates how GCJ and CNI allow
C++ code to use iText's (itext-paulo) Java classes.
%prep
-%setup -q
+%setup -q -n %{name}-%{version}-dist
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
%patch4 -p0 -b .classpath
-rm -rf java_libs
+# Remove bundled libraries from the source tree
+rm -rf java
+
+# Fix EOL encoding
+for file in *.txt license_gpl_pdftk//*.txt; do
+ sed 's|\r||' $file > $file.tmp
+ touch -r $file $file.tmp
+ mv $file.tmp $file
+done
%build
# Requires as a workaround for gcc BZ #39380
export CFLAGS="${RPM_OPT_FLAGS}"
jar tf %{_javadir}/itext-%{itextvers}.jar | grep '\.class$' | sed 's/\.class//' | sed 's|/|\.|g' > classes
- gjavah -d java_libs -cni -classpath=%{_javadir}/itext-%{itextvers}.jar \
+ gjavah -d java -cni -classpath=%{_javadir}/itext-%{itextvers}.jar \
`cat classes`
cd pdftk
- make -f Makefile.RedHat LIBDIR=%{_libdir} %{?_smp_mflags} ITEXTVERS="%{itextvers}"
+ make -f Makefile.Redhat LIBDIR=%{_libdir} %{?_smp_mflags} ITEXTVERS="%{itextvers}"
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
install -m 0755 pdftk/pdftk $RPM_BUILD_ROOT/%{_bindir}/pdftk
-install -m 0644 debian/pdftk.1 $RPM_BUILD_ROOT/%{_mandir}/man1/pdftk.1
+install -m 0644 pdftk.1 $RPM_BUILD_ROOT/%{_mandir}/man1/pdftk.1
# Fix the weird dependency, e.g.
# /usr/lib64/gcj/itext/itext-x.y.z.jar.so()(64bit) to
# /usr/lib64/gcj/itext/itext-x.y.z.jar.so
@@ -76,7 +79,7 @@ grep -v %{_docdir} - | %{__find_requires} $* \
| sed 's@\(itext-[0-9.]*\.jar\.so at d'
EOF
-%define __find_requires %{_builddir}/%{name}-%{version}/%{name}.req
+%define __find_requires %{_builddir}/%{name}-%{version}-dist/%{name}.req
chmod +x %{__find_requires}
%clean
@@ -84,11 +87,17 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%doc pdftk.1.html pdftk.1.txt
-%{_bindir}/*
-%{_mandir}/man1/*
+%doc changelog.html changelog.notes changelog.txt
+%doc pdftk.1.html pdftk.1.notes pdftk.1.txt
+%doc license_gpl_pdftk/pdftk_gpl_license.txt license_gpl_pdftk/readme.txt
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}*
%changelog
+* Sun Jan 9 2011 Orcan Ogetbil <oget[DOT]fedora[AT]gmail[DOT]com> 1.44-1
+- Updated to 1.44. No need to regenerate the tarball since the files with
+ problematic licenses are removed by upstream.
+
* Wed Aug 4 2010 Jochen Schmitt <Jochen herr-schmitt de> 1.41-27
- Rebuild for new gcj release (#619187)
diff --git a/sources b/sources
index 263e729..960146b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5da5c9387bdcc683eecdc54ea358c2e7 pdftk-1.41-noitext.tar.bz2
+9eb50fffcd621a627d387750c60982b4 pdftk-1.44-src.zip
More information about the scm-commits
mailing list