File pdftk.spec of Package pdftk

#
# spec file for package pdftk
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, 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:        1.44
Release:        3
License:        GPLv2+
Summary:        A handy tool for manipulating PDF
Url:            http://www.pdflabs.com/
Group:          Productivity/Publishing/PDF
Source0:        %{name}-%{version}-src.zip
Source1:        Makefile.SUSE
Patch0:         bug-427046_pdftk.cc.patch
AutoReqProv:    on
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
# ligcj.jar version suffix : "-4.1" for "/usr/share/java/libgcj-4.1.jar"
%define jarv %nil

%if 0%{?suse_version} > 1140
%define jarv -4.6
%endif

%if 0%{?suse_version} <= 1140
%define jarv -4.5
%endif

%if 0%{?suse_version} <= 1120
%define jarv -4.4
%endif

%if 0%{?suse_version} <= 1110
%define jarv -4.3
%endif

# 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
%endif

%if 0%{?suse_version} == 1020
%define jarv -4.1.2
%endif

%if 0%{?suse_version} == 1010
%define jarv -4.1.0
%endif

%if 0%{?suse_version} == 1000
%define jarv -4.0.2
%endif

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

%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 -p1
%__cp %{S:1} pdftk/Makefile
%__sed -i 's/\r$//' changelog.txt license_gpl_pdftk/*.txt license_gpl_pdftk/*/*.txt

%build
%__make -C pdftk CXXFLAGS="%optflags" LIBGCJ=%{_javadir}/libgcj%{jarv}.jar GXXV=%gxxv
%__strip pdftk/%name

%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
openSUSE Build Service is sponsored by