xmlgraphics-fop/xmlgraphics-fop.spec

190 lines
6.2 KiB
RPMSpec

#
# spec file for package xmlgraphics-fop (Version 1.0)
#
# Copyright (c) 2010 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/
#
# norootforbuild
%define section free
%define bname fop
Name: xmlgraphics-fop
Version: 1.0
Release: 1
Summary: Formatter for Printing XSLT Processed XML Files
License: ASLv..
Group: Productivity/Publishing/XML
Source0: http://www.apache.org/dist/xmlgraphics/fop/source/fop-%{version}-src.tar.gz
#FIX-OPENSUSE: add xmlgraphics-commons to classpath
Source1: %{name}.script
Source2: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/xmlgraphics-fop-pom-template.pom
Patch0: xmlgraphics-fop-build.patch
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: jpackage-utils >= 1.7.4
Requires: java >= 1.5.0
Requires: xmlgraphics-batik
Requires: excalibur-avalon-logkit
Requires: excalibur-avalon-framework-api
Requires: excalibur-avalon-framework-impl
Requires: xalan-j2
Requires: xerces-j2
Requires: xmlgraphics-commons
Requires: xml-commons-jaxp-1.3-apis
BuildRequires: jpackage-utils >= 1.7.4
BuildRequires: java-devel >= 1.5.0
BuildRequires: java-javadoc
BuildRequires: ant >= 1.6.5
BuildRequires: ant-trax
BuildRequires: ant-junit
BuildRequires: junit
BuildRequires: xmlgraphics-batik
BuildRequires: xmlgraphics-batik-javadoc
BuildRequires: excalibur-avalon-logkit
BuildRequires: excalibur-avalon-framework-api
BuildRequires: excalibur-avalon-framework-impl
BuildRequires: servlet_api
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: xmlgraphics-commons >= 1.2
BuildRequires: xmlunit
BuildRequires: xml-commons-jaxp-1.3-apis
BuildRequires: qdox
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
#!BuildIgnore: saxon
Provides: %{bname} = %{name}-%{version}
Obsoletes: %{bname} < %{name}-%{version}
%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
License: ASLv..
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
Javadoc for %{name}.
%prep
%setup -q -n %{bname}-%{version}
find -name "*.jar" | xargs -t rm
%patch0 -p0 -b .build
%patch1 -p1 -b .cli
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 xalan-j2)
ln -s $(build-classpath xalan-j2-serializer)
ln -s $(build-classpath xerces-j2)
ln -s $(build-classpath xmlgraphics-commons)
ln -s $(build-classpath xmlunit)
ln -s $(build-classpath qdox)
popd
cp %{SOURCE2} .
%build
export CLASSPATH=
export OPT_JAR_LIST=`%{__cat} %{_sysconfdir}/ant.d/{junit,trax}`
%{ant} \
-Dbatik.javadoc=%{_javadocdir}/xmlgraphics-batik \
package junit maven-artifacts
%install
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
install -m 644 build/%{bname}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
%add_to_maven_depmap org.apache.xmlgraphics %{bname} %{version} JPP %{name}
# pom
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 build/maven/pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
# script
mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
# compat symlink
ln -s %{name} %{buildroot}%{_bindir}/%{bname}
# data
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr hyph $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr conf $RPM_BUILD_ROOT%{_datadir}/%{name}
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(0644,root,root,0755)
%doc NOTICE LICENSE README known-issues.xml status.xml
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{bname}
%{_javadir}/%{name}*.jar
%{_datadir}/%{name}
%{_datadir}/maven2/*
%{_mavendepmapfragdir}/*
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog