Spec file: --------------------------------------------------------- Summary: pdftk - the pdf tool kit Name: pdftk Version: 1.12 Release: 1 Packager: Les Bell (lesbell@lesbell.com.au) License: GPL URL: http://www.accesspdf.com/pdftk/ Source0: %{name}-%{version}.tar.bz2 Patch0: gcj4.patch Group: Applications/Publishing BuildRoot: %{_tmppath}/%{name}-root Requires: libgcj BuildRequires: gcc-java BuildRequires: libgcj-devel
%description If PDF is electronic paper, then pdftk is an electronic staple-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 top drawer of your desktop and use it to:
* Merge PDF Documents * Split PDF Pages into a New Document * Decrypt Input as Necessary (Password Required) * Encrypt Output as Desired * Burst a PDF Document into Single Pages * 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.
%prep %setup -q %patch0 -p1
%build unset CLASSPATH && cd pdftk && make -f Makefile.RedHat && cd -
%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 gzip $RPM_BUILD_ROOT/%{_mandir}/man1/pdftk.1
%clean rm -rf $RPM_BUILD_ROOT
%files %defattr(-,root,root) %doc pdftk.1.html pdftk.1.notes pdftk.1.txt %{_bindir}/* %{_mandir}/man1/* ---------------------------------------------------------
Source RPM URL: http://www.lesbell.org/pdftk-1.12-1.src.rpm
Binary RPM's are also available at http://www.lesbell.org if anyone just can't wait.
Back-story:
I had pdftk working fine under CentOS 4.4, but upgrading to 5.0 (with gcj 4.1.1) broke the compile process with the following error:
PngImage.java:568: error: Class 'ImgRaw' not found in type declaration.
So I googled like crazy, worked out a fix, tested it, built a patch file and packaged it up to save others the trouble. There is a spec file for pdftk at svn.rpmforge.net, but it does not use a patch for this problem.
Best,
--- Les Bell, RHCE, CISSP [http://www.lesbell.com.au] Tel: +61 2 9451 1144 FreeWorldDialup: 800909
Les Bell wrote:
Spec file:
Summary: pdftk - the pdf tool kit Name: pdftk Version: 1.12
Thanks for this, I'll look at this shortly - although, my gcj skills are rather non-existent!
- KB