File pdftk.spec of Package pdftk
#
# spec file for package pdftk
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012-2013 B1 Systems GmbH, Vohburg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: pdftk
Version: 2.02
Release: 0
Summary: A handy tool for manipulating PDF
License: GPL-2.0+
Group: Productivity/Publishing/PDF
Url: http://www.pdflabs.com/
Source0: %{name}-%{version}-src.zip
Source1: Makefile.SUSE
Patch0: bug-427046_pdftk.cc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: unzip
# There is a stack of fall-through logic from here to %%description.
# Be careful inserting stuff in here as order matters.
# BuildRequires package version suffix : "41" for "gcc41-java"
%define pkgv %nil
# gcc/gcj binaries version suffix : "-4.1" for "gcj-4.1"
%define gxxv %nil
# openSUSE 11.0 and SLE_11 are odd cases.
%if 0%{?suse_version} == 1100 || 0%{?sles_version} == 11
# "Nothing provides libgcj"
%define pkgv 43
# "gcj command not found", "gcjh command not found"
%define gxxv -4.3
%endif
BuildRequires: gcc%{pkgv}-c++
BuildRequires: gcc%{pkgv}-java
# Unversioned libgcj does not exist after 12.2,
# but libgcj-devel pulls in libgcj$VERSION
%if 0%{suse_version} < 1230
BuildRequires: libgcj%{pkgv}
%endif
BuildRequires: libgcj%{pkgv}-devel
# java-gcj was separated from gcj-java after 10.0
%if 0%{suse_version} > 1000
BuildRequires: java-gcj
%endif
%if 0%{?suse_version} > 1010 || 0%{?sles_version} == 10
BuildRequires: fastjar
%endif
%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.
Use it to:
* Merge PDF Documents
* Split PDF Pages into a New Document
* Rotate PDF Documents or Pages
* Decrypt Input as Necessary (Password Required)
* Encrypt Output as Desired
* Fill PDF Forms with X/FDF Data and/or Flatten Forms
* Generate FDF Data Stencil from PDF Forms
* Apply a Background Watermark or a Foreground Stamp
* Report PDF Metrics such as Metadata and Bookmarks
* Update PDF Metadata
* Attach Files to PDF Pages or the PDF Document
* Unpack PDF Attachments
* Burst a PDF Document into Single Pages
* Uncompress and Re-Compress Page Streams
* Repair Corrupted PDF (Where Possible)
%prep
%setup -q -n %{name}-%{version}-dist
%patch0 -p0
%__cp %{S:1} pdftk/Makefile
%__sed -i 's/\r$//' changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt
%__chmod 644 changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt
%build
%__make -C pdftk CXXFLAGS="%optflags" GCJFLAGS="$(echo " %optflags" | sed 's/ -D/ -Wp,-D/g')" GXXV=%gxxv
%install
%__install -Dm 0755 pdftk/%name %{buildroot}%{_bindir}/%name
%__install -Dpm 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%clean
%__rm -rf %buildroot
%files
%defattr(-,root,root)
%{_bindir}/%name
%{_mandir}/man1/%{name}.*
%doc changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt
%changelog