File pdftk.spec of Package pdftk

# spec file for package pdftk
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 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

Name:           pdftk
Version:        1.44
Release:        0
Summary:        A handy tool for manipulating PDF
License:        GPL-2.0+
Group:          Productivity/Publishing/PDF
Source0:        %{name}-%{version}
Source1:        Makefile.SUSE
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  unzip

# 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.
# %jarv is still correct from above for both
%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

BuildRequires:  gcc%{pkgv}-c++
BuildRequires:  gcc%{pkgv}-java
BuildRequires:  libgcj%{pkgv}
BuildRequires:  libgcj%{pkgv}-devel

# after 10.0 java-gcj was separated from gcj-java
%if 0%{suse_version} > 1000
BuildRequires:  java-gcj

%if 0%{?suse_version} > 1010 || 0%{?sles_version} == 10
BuildRequires:  fastjar

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)

%setup -q -n %{name}-%{version}-dist
%patch0 -p1
%__cp %{S:1} pdftk/Makefile
%__sed -i 's/\r$//' changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt

%__make -C pdftk CXXFLAGS="%optflags" LIBGCJ= GXXV=%gxxv
%__strip pdftk/%name

%__install -Dm 0755 pdftk/%name %{buildroot}%{_bindir}/%name
%__install -Dpm 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

%__rm -rf %buildroot

%doc changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt