xmlgraphics-fop/xmlgraphics-fop.spec

231 lines
7.5 KiB
RPMSpec

#
# spec file for package xmlgraphics-fop
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# 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/
#
%define section free
%define bname fop
%bcond_with tests
Name: xmlgraphics-fop
Version: 1.1
Release: 0
Summary: Formatter for Printing XSLT Processed XML Files
License: Apache-2.0
Group: Productivity/Publishing/XML
Source0: http://ftp.halifax.rwth-aachen.de/apache/xmlgraphics/fop/source/fop-1.1-src.tar.gz
#FIX-OPENSUSE: add xmlgraphics-commons to classpath
Source1: %{name}.script
Source2: http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_0/xmlgraphics-fop-pom-template.pom
Source3: %{name}-fontmetrics.script
Source4: %{name}-fontlist.script
Source5: http://heanet.dl.sourceforge.net/project/offo/offo-hyphenation/2.0/offo-hyphenation_v2.0.zip
# Manpage(s)
Source10: %{name}.xml
Source11: %{name}-fontmetrics.xml
Source12: %{name}-fontlist.xml
Source1000: http://ftp.halifax.rwth-aachen.de/apache/xmlgraphics/fop/source/fop-1.1-src.tar.gz.asc
Patch1: xmlgraphics-fop-cli.patch
Url: http://xmlgraphics.apache.org/fop/
Requires(post): jpackage-utils >= 1.7.4
Requires(postun): jpackage-utils >= 1.7.4
Requires: commons-io >= 2.4
Requires: commons-logging
Requires: excalibur-avalon-framework-api
Requires: excalibur-avalon-framework-impl
Requires: java >= 1.6.0
Requires: jpackage-utils >= 1.7.4
Requires: xmlgraphics-batik
Requires: xmlgraphics-commons >= 1.5
BuildRequires: ant >= 1.6.5
BuildRequires: ant-junit
BuildRequires: ant-trax
BuildRequires: docbook-xsl-stylesheets
BuildRequires: excalibur-avalon-framework-api
BuildRequires: excalibur-avalon-framework-impl
BuildRequires: gpg2
BuildRequires: java-devel >= 1.6.0
BuildRequires: java-javadoc
BuildRequires: jpackage-utils >= 1.7.4
BuildRequires: junit
BuildRequires: libxslt
BuildRequires: qdox >= 1.12
BuildRequires: servlet_api
BuildRequires: unzip
BuildRequires: xmlgraphics-batik
BuildRequires: xmlgraphics-batik-javadoc
BuildRequires: xmlgraphics-commons >= 1.5
BuildRequires: xmlunit
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
#!BuildIgnore: saxon
Provides: %{bname} = %{version}-%{release}
Obsoletes: %{bname} < %{version}-%{release}
Provides: fo-formatter = %{version}-%{release}
%description
FOP (Formatting Objects Processor) is driven by XSL formatting objects
(XSL-FO). It is a Java application that reads a formatting object (FO)
tree and renders the resulting pages to one of the following output
formats: PDF (primary output target), PCL, PS, SVG, XML (area tree
representation), Print, AWT, MIF, and TXT.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name} automatically extracted from comments in source files.
%prep
%setup -q -n %{bname}-%{version} -a5
ln -thyph offo-hyphenation/hyph/*.xml
find -name "*.jar" | xargs -t rm
%patch1 -p1 -b .cli
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} .
# Replace keyword "VERSION" in XML files with the real one:
for x in %{SOURCE10} %{SOURCE11} %{SOURCE12}; do
sed -i "s=@VERSION@=%{version}=" $x
done
%build
pushd lib
ln -s $(build-classpath excalibur/avalon-framework-api)
ln -s $(build-classpath excalibur/avalon-framework-impl)
ln -s $(build-classpath commons-io)
ln -s $(build-classpath commons-logging)
ln -s $(build-classpath servlet_api)
ln -s $(build-classpath xml-commons-jaxp-1.3-apis)
ln -s $(build-classpath xml-commons-jaxp-1.3-apis-ext)
ln -s $(build-classpath xmlgraphics-batik/anim)
ln -s $(build-classpath xmlgraphics-batik/awt-util)
ln -s $(build-classpath xmlgraphics-batik/bridge)
ln -s $(build-classpath xmlgraphics-batik/css)
ln -s $(build-classpath xmlgraphics-batik/dom)
ln -s $(build-classpath xmlgraphics-batik/ext)
ln -s $(build-classpath xmlgraphics-batik/extension)
ln -s $(build-classpath xmlgraphics-batik/gvt)
ln -s $(build-classpath xmlgraphics-batik/parser)
ln -s $(build-classpath xmlgraphics-batik/svg-dom)
ln -s $(build-classpath xmlgraphics-batik/svggen)
ln -s $(build-classpath xmlgraphics-batik/script)
ln -s $(build-classpath xmlgraphics-batik/transcoder)
ln -s $(build-classpath xmlgraphics-batik/util)
ln -s $(build-classpath xmlgraphics-batik/xml)
ln -s $(build-classpath xmlgraphics-commons)
ln -s $(build-classpath xmlunit)
ln -s $(build-classpath qdox)
popd
export CLASSPATH= LANG=en_US.UTF-8
export OPT_JAR_LIST=`%{__cat} %{_sysconfdir}/ant.d/{junit,trax}`
%{ant} \
-Dbatik.javadoc=%{_javadocdir}/xmlgraphics-batik \
package \
%if %{with tests}
junit \
%endif
maven-artifacts
# false
# Build the manpage(s) and HTML
DB=/usr/share/xml/docbook/stylesheet/nwalsh/current
for m in %{SOURCE10} %{SOURCE11} %{SOURCE12}; do
xsltproc $DB/manpages/docbook.xsl $m
# Only filename for HTML is needed, remove anything before /
xml=${m##*/}
xsltproc --output ${xml%%.xml}.html $DB/html/docbook.xsl $m
done
%install
# jars
mkdir -p %{buildroot}%{_javadir}
install -m 644 build/%{bname}.jar %{buildroot}%{_javadir}/%{name}.jar
%add_to_maven_depmap org.apache.xmlgraphics %{bname} %{version} JPP %{name}
# pom
install -d -m 755 %{buildroot}%{_datadir}/maven2/poms
install -pm 644 build/maven/pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
# script
mkdir -p %{buildroot}%{_bindir}
cp -p %{SOURCE1} %{buildroot}%{_bindir}/%{name}
cp -p %{SOURCE3} %{buildroot}%{_bindir}/%{name}-fontmetrics
cp -p %{SOURCE4} %{buildroot}%{_bindir}/%{name}-fontlist
# compat symlink
ln -s %{name} %{buildroot}%{_bindir}/%{bname}
ln -s %{name}-fontmetrics %{buildroot}%{_bindir}/%{bname}-fontmetrics
ln -s %{name}-fontlist %{buildroot}%{_bindir}/%{bname}-fontlist
# data
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr hyph %{buildroot}%{_datadir}/%{name}
cp -pr conf %{buildroot}%{_datadir}/%{name}
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/javadocs/* %{buildroot}%{_javadocdir}/%{name}
# Manpages
mkdir -p %{buildroot}%_mandir/man1
for m in *.1; do
gzip $m
done
cp -vi *.1.gz %{buildroot}%_mandir/man1
# Remove prefix xmlgraphics to make also the linked manpage version available
pushd %{buildroot}%_mandir/man1
for m in *.1.gz; do
ln -s $m ${m#*-}
done
popd
%clean
rm -rf %{buildroot}
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(0644,root,root,0755)
%doc NOTICE LICENSE README known-issues.xml status.xml
%doc *.html
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{bname}
%attr(0755,root,root) %{_bindir}/%{name}-fontmetrics
%attr(0755,root,root) %{_bindir}/%{bname}-fontmetrics
%attr(0755,root,root) %{_bindir}/%{name}-fontlist
%attr(0755,root,root) %{_bindir}/%{bname}-fontlist
%{_javadir}/%{name}.jar
%{_datadir}/%{name}
%{_datadir}/maven2/*
%config %{_mavendepmapfragdir}/*
%{_mandir}/man1/*
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}
%changelog