apache-pdfbox/apache-pdfbox.spec

118 lines
3.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package apache-pdfbox
#
# Copyright (c) 2017 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/
#
# 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
Url: https://pdfbox.apache.org/
Source0: http://www-us.apache.org/dist/pdfbox/%{version}/pdfbox-%{version}-src.zip
Source1: http://central.maven.org/maven2/org/apache/pdfbox/pdfbox/%{version}/pdfbox-%{version}.pom
Source2: http://central.maven.org/maven2/org/apache/pdfbox/fontbox/%{version}/fontbox-%{version}.pom
Source3: http://central.maven.org/maven2/org/apache/pdfbox/jempbox/%{version}/jempbox-%{version}.pom
BuildRequires: ant
BuildRequires: apache-commons-logging
BuildRequires: icu4j
BuildRequires: java-devel >= 1.5
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: junit
BuildRequires: unzip
Requires: apache-commons-logging
Requires: icu4j
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Patch1: disable-downloads.patch
Patch2: fix-javadoc-dep.patch
%description
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}
%prep
%setup -q -n pdfbox-%{version}
%patch1 -p1
%patch2 -p1
%build
# Link dependencies
mkdir -p pdfbox/external
DEPS="junit4 icu4j commons-logging"
build-jar-repository -s -p pdfbox/external $DEPS
# build.xml uses hardcoded version numbers, so it doesn't find the jars...
for dep in $DEPS; do
CLASSPATH="$PWD/pdfbox/external/${dep}.jar:$CLASSPATH"
done
export CLASSPATH
# Build
ant -buildfile pdfbox/build.xml -Dbuild.sysclasspath=first fontbox.package jempbox.package javadoc
%install
# Code
install -d %{buildroot}%{_javadir}
for jar in fontbox jempbox; do
install -p -m644 ${jar}/target/${jar}-%{version}.jar %{buildroot}%{_javadir}/${jar}.jar
done
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}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%files
%defattr(-,root,root,-)
%doc RELEASE-NOTES.txt LICENSE.txt NOTICE.txt README.txt
%{_javadir}/fontbox.jar
%{_javadir}/jempbox.jar
%{_mavenpomdir}/JPP-fontbox.pom
%{_mavenpomdir}/JPP-jempbox.pom
%if %suse_version >= 1330
%{_datadir}/maven-metadata/%{name}.xml*
%else
%{_mavendepmapfragdir}/%{name}
%endif
%changelog