File apache-pdfbox.spec of Package apache-pdfbox.8984

# spec file for package apache-pdfbox
# Copyright (c) 2017 SUSE LINUX 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

# Only fontbox and jempbox are built as pdfbox itself depends on Adobe's pcif.
Name:           apache-pdfbox
Version:        1.8.12
Release:        0
Summary:        Java PDF Library
License:        Apache-2.0
Group:          Development/Libraries/Java
Patch0:         pdfbox-1.8.12-bouncycastle.patch
Patch1:         disable-downloads.patch
Patch2:         fix-javadoc-dep.patch
Patch3:         pdfbox-1.8.12-sourcetarget.patch
Patch4:         fix-infinite-loop.patch
Patch5:         improve-skip-duplicates.patch
BuildRequires:  ant
BuildRequires:  apache-commons-logging
BuildRequires:  bouncycastle
BuildRequires:  fdupes
BuildRequires:  icu4j
BuildRequires:  java-devel >= 1.6
BuildRequires:  javapackages-local
BuildRequires:  javapackages-tools
BuildRequires:  junit
BuildRequires:  unzip
Requires:       apache-commons-logging
Requires:       icu4j
BuildArch:      noarch

The Apache PDFBox library is an open source Java tool for working with PDF documents.
This project allows creation of new PDF documents, manipulation of existing documents
and the ability to extract content from documents.
Apache PDFBox also includes several command line utilities.

%package javadoc
Summary:        API Documentation for PDFBox
Group:          Documentation/HTML
Requires:       %{name} = %{version}-%{release}

%description javadoc
JavaDoc documentation for %{name}

%setup -q -n pdfbox-%{version}
%autopatch -p1

# Build
ant -buildfile pdfbox/build.xml \
    -Dbcprov.jar=$(build-classpath bcprov) -Djunit.jar=$(build-classpath junit4) \
    -Dicu4j.jar=$(build-classpath icu4j) -Dlogging.jar=$(build-classpath commons-logging) \
    -Dbuild.sysclasspath=first -Dcompile.source=1.6 \
    fontbox.package jempbox.package javadoc

# Code
install -d %{buildroot}%{_javadir}
for jar in fontbox jempbox; do
    install -p -m644 ${jar}/target/${jar}-%{version}.jar %{buildroot}%{_javadir}/${jar}.jar

install -d -m 0755 %{buildroot}/%{_mavenpomdir}/
install -m 0644 %{SOURCE2} %{buildroot}/%{_mavenpomdir}/JPP-fontbox.pom
install -m 0644 %{SOURCE3} %{buildroot}/%{_mavenpomdir}/JPP-jempbox.pom

%add_maven_depmap JPP-fontbox.pom fontbox.jar
%add_maven_depmap JPP-jempbox.pom jempbox.jar

# JavaDoc
install -dm 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr pdfbox/target/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%fdupes %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}

%files javadoc

%license LICENSE.txt
%if %{defined _maven_repository}