xalan-j2/xalan-j2.spec

357 lines
12 KiB
RPMSpec
Raw Permalink Normal View History

%define repodir %{_javadir}/repository.jboss.com/apache-xalan/%{version}-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src
%define pkgver %(echo %version | tr . _)
Name: xalan-j2
Version: 2.7.1
Release: 6mamba
Summary: Java XSLT processor
Group: Applications/Publishing
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://xml.apache.org/xalan-j/
Source0: ftp://mirror.nohup.it/apache/xml/xalan-j/source/xalan-j_%{pkgver}-src.zip
Source1: java-component-info7.xml
Source2: xalan-j2-2.7.1-serializer-OSGi-MANIFEST.MF
Patch0: xalan-j2-2.7.0-noxsltcdeps.patch
Patch1: xalan-j2-2.7.0-manifest.patch
Patch2: xalan-j2-2.7.0-crosslink.patch
#This patch uses xalan-j2-serializer.jar in the MANIFEST files instead of serializer
Patch3: xalan-j2-2.7.0-MANIFEST-MF.patch
Patch4: xalan-j2-2.7.1-maxmemory.patch
#Patch5: xalan-j2-2.7.1-pdfdoc.patch
License: Apache Software License 1.1, Apache Software License 2.0, W3C
BuildRequires: apache-ant
%if "%{stage1}" != "1"
BuildRequires: apache-tomcat5-servletapi5
BuildRequires: xerces-j2
BuildRequires: jakarta-regexp
BuildRequires: java-lex
BuildRequires: apache-xml-stylebook
%endif
BuildRequires: jakarta-bcel
BuildRequires: coreutils
BuildRequires: java_cup
BuildRequires: xml-commons-apis
#BuildRequires: apache-batik
#BuildRequires: apache-fop == 0.95
#BuildRequires: jakarta-commons-logging
#BuildRequires: java-dom
#BuildRequires: java-excalibur-avalon-framework
#BuildRequires: xmlgraphics-commons == 1.3.1
%if "%{stage1}" != "1"
Requires: apache-tomcat5-servletapi5
Requires: apache-xml-stylebook
%endif
Requires: coreutils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line, in an applet or a servlet, or as a module in other program.
%package xsltc
Group: Applications/Publishing
Summary: XSLT compiler
Requires: jakarta-bcel
%if "%{stage1}" != "1"
Requires: jakarta-regexp
Requires: java-lex
%endif
Requires: java_cup
%description xsltc
The XSLT Compiler is a Java-based tool for compiling XSLT stylesheets into lightweight and portable Java byte codes called translets.
%package manual
Group: Documentation
Summary: Manual for %{name}
Requires: %{name}-javadoc = %{version}-%{release}
%description manual
Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types.
This package contains documentation for %{name}.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types.
This package contains javadoc for %{name}.
%package demo
Group: Applications/Publishing
Summary: Demo for %{name}
Requires: %{name} = %{version}-%{release}
%if "%{stage1}" != "1"
Requires: apache-tomcat5-servletapi5
%endif
%description demo
Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types.
This package contains demonstrations and samples for %{name}.
%package repolib
Group: Development/Libraries/Java
Summary: Artifacts to be uploaded to a repository library
%description repolib
Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types.
This package contains artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents can be extracted through rpm2cpio
%prep
%setup -q -n xalan-j_%{pkgver}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4
#%patch5
#%patch6
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
pushd lib
ln -sf $(build-classpath java_cup-runtime) runtime.jar
ln -sf $(build-classpath bcel) BCEL.jar
%if "%{stage1}" != "1"
ln -sf $(build-classpath xerces-j2) xercesImpl.jar
ln -sf $(build-classpath regexp) regexp.jar
%endif
ln -sf $(build-classpath xml-commons-apis) xml-apis.jar
popd
mkdir -p bin
%if "%{stage1}" != "1"
ln -sf $(build-classpath fop) bin/
ln -sf $(build-classpath xml-commons-apis-ext) bin/w3c.jar
%endif
pushd tools
ln -sf $(build-classpath java_cup) java_cup.jar
ln -sf $(build-classpath ant-1.7.1) ant.jar
%if "%{stage1}" != "1"
ln -sf $(build-classpath jlex) JLex.jar
ln -sf $(build-classpath xml-stylebook-1.0) stylebook-1.0-b3_xalan-2.jar
%endif
mv xalan2jdoc.jar.no xalan2jdoc.jar
mv xalan2jtaglet.jar.no xalan2jtaglet.jar
popd
chmod 0755 samples/extensions/sql/*.sh
%build
#BUILD_PDF="fop fop-pdf-transcoder fop-hyph fop-sandbox fop-transcoder-allinone jdom batik-all commons-logging xmlgraphics-commons excalibur/avalon-framework" $BUILD_PDF
export JAVA_HOME=%{_jvmdir}/jdk ANT_OPTS="-Xmx1024m -Djava.awt.headless=true"
%if "%{stage1}" != "1"
export CLASSPATH=$(build-classpath servletapi5 xml-commons-apis-ext):$JAVA_HOME/lib/tools.jar:build/classes:build/serializer
%endif
ant \
-Dbuild.xalan-interpretive.jar=build/xalan-interpretive.jar \
-Dbin.dir=bin \
-Dapi.j2se=%{_javadocdir}/java \
xalan-interpretive.jar \
xsltc.unbundledjar \
docs \
xsltc.docs \
javadocs \
samples \
%if "%{stage1}" != "1"
servlet
%endif
# \
# printerdocs
# TODO
# printerdocs:
# [echo] NOTICE: requires fop.jar and xml.jar on the classpath
# [java] Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/apps/CommandLine
mkdir -p META-INF
cp -p %{SOURCE2} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/serializer.jar META-INF/MANIFEST.MF
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -p -m 644 build/xalan-interpretive.jar \
%{buildroot}%{_javadir}/xalan-j2-interpretive-%{version}.jar
install -p -m 644 build/xsltc.jar \
%{buildroot}%{_javadir}/xsltc-%{version}.jar
install -p -m 644 build/serializer.jar \
%{buildroot}%{_javadir}/xalan-j2-serializer-%{version}.jar
install -p -m 644 build/xalan.jar \
%{buildroot}%{_javadir}/xalan-j2-%{version}.jar
install -p -m 644 build/xalansamples.jar \
%{buildroot}%{_javadir}/xalan-j2-samples.jar
(
cd %{buildroot}%{_javadir}
for jar in *-%{version}*; do
ln -s ${jar} `echo $jar | sed "s|-%{version}||g"`
done
)
mkdir -p %{buildroot}%{_javadocdir}/xalan-j2-%{version}
cp -pr build/docs/apidocs/* %{buildroot}%{_javadocdir}/xalan-j2-%{version}
ln -s xalan-j2-%{version} %{buildroot}%{_javadocdir}/xalan-j2
rm -rf build/docs/apidocs
mkdir -p %{buildroot}%{_datadir}/xalan-j2
cp -pr samples %{buildroot}%{_datadir}/xalan-j2
%if "%{stage1}" != "1"
install -pm 644 build/xalanservlet.war \
%{buildroot}%{_datadir}/xalan-j2/
%endif
#ln -sf $JAVA_HOME/db/lib/derby.jar samples/extensions/sql/derby.jar
#ln -sf $JAVA_HOME/db/lib/derbytools.jar samples/extensions/sql/derbytools.jar
mkdir -p %{buildroot}%{_datadir}/xalan-j2/docs
cp -pr build/docs/* %{buildroot}%{_datadir}/xalan-j2/docs/
(
cd %{buildroot}%{_datadir}/xalan-j2/docs
ln -sf ../../javadoc/xalan-j2-%{version} apidocs
)
sed -i "s|docs/whatsnew.html|../../xalan-j2/docs/whatsnew.html|" readme.html
# jaxp_transform_impl ghost symlink
ln -s %{_sysconfdir}/alternatives \
%{buildroot}%{_javadir}/jaxp_transform_impl.jar
mkdir -p %{buildroot}%{repodir}
mkdir -p %{buildroot}%{repodirlib}
install -pm 644 %{SOURCE1} %{buildroot}%{repodir}/component-info.xml
sed -i "s/@NAME@/apache-xalan-component-info/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ID@/apache-xalan/g" %{buildroot}%{repodir}/component-info.xml
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/@TAG@/$tag/g" %{buildroot}%{repodir}/component-info.xml
sed -i 's/@VERSION@/%{version}-brew/g' %{buildroot}%{repodir}/component-info.xml
sed -i "s/@LICENSE@/Apache Software License 2.0/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s|@PROJECTHOME@|%{url}|g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@DESCRIPTION@/Xalan-Java is an XSLT processor for transforming XML documents/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@COMPONENTREF@/apache-xerces/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@VERSION_COMPONENTREF1@/2.9.1/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@VERSION_COMPONENTREF2@/2.9.1-brew/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID1@/xalan.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID2@/serializer.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT1@/xalan.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT2@/serializer.jar/g" %{buildroot}%{repodir}/component-info.xml
mkdir -p %{buildroot}%{repodirsrc}
install -pm 644 %{PATCH0} %{buildroot}%{repodirsrc}
install -pm 644 %{PATCH1} %{buildroot}%{repodirsrc}
install -pm 644 %{PATCH2} %{buildroot}%{repodirsrc}
install -pm 644 %{PATCH3} %{buildroot}%{repodirsrc}
install -pm 644 %{SOURCE0} %{buildroot}%{repodirsrc}
cp -p %{buildroot}%{_javadir}/xalan-j2-serializer-%{version}.jar %{buildroot}%{repodirlib}/serializer.jar
cp -p %{buildroot}%{_javadir}/xalan-j2-%{version}.jar %{buildroot}%{repodirlib}/xalan.jar
#%{_bindir}/aot-compile-rpm --exclude %{_datadir}/xalan-j2/xalan-j2-servlet.war
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
update-alternatives --install %{_javadir}/jaxp_transform_impl.jar jaxp_transform_impl %{_javadir}/xalan-j2.jar 30
%preun
{
[ $1 = 0 ] || exit 0
update-alternatives --remove jaxp_transform_impl %{_javadir}/xalan-j2.jar
} >/dev/null 2>&1 || :
%files
%defattr(-,root,root)
%{_javadir}/xalan-j2-%{version}.jar
%{_javadir}/xalan-j2.jar
%{_javadir}/xalan-j2-interpretive-%{version}.jar
%{_javadir}/xalan-j2-interpretive.jar
%{_javadir}/xalan-j2-serializer-%{version}.jar
%{_javadir}/xalan-j2-serializer.jar
%{_javadir}/xalan-j2-samples.jar
%ghost %{_javadir}/jaxp_transform_impl.jar
%doc KEYS LICENSE.txt NOTICE.txt readme.html
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/xalan-j2-%{version}
%{_javadocdir}/xalan-j2
%files xsltc
%defattr(-,root,root)
%{_javadir}/xsltc-%{version}.jar
%{_javadir}/xsltc.jar
%files manual
%defattr(-,root,root)
%doc %{_datadir}/xalan-j2/docs
%files demo
%defattr(-,root,root)
%if "%{stage1}" != "1"
%{_datadir}/xalan-j2/*.war
%endif
%{_datadir}/xalan-j2/samples
%files repolib
%defattr(-,root,root)
%{repodir}
%changelog
* Wed Mar 23 2011 gil <puntogil@libero.it> 2.7.1-6mamba
- rebuilt with java-openjdk support
* Tue Mar 09 2010 gil <puntogil@libero.it> 2.7.1-5mamba
- fix java.lang.OutOfMemoryError during javadocs task
* Tue Nov 24 2009 gil <puntogil@libero.it> 2.7.1-4mamba
- rebuilt
- added new sub package: repolib
* Fri Mar 13 2009 gil <puntogil@libero.it> 2.7.1-3mamba
- rebuilt with new xerces-j2
* Mon Mar 09 2009 gil <puntogil@libero.it> 2.7.1-2mamba
- added tomcat support
* Sat Mar 07 2009 gil <puntogil@libero.it> 2.7.1-1mamba
- update to 2.7.1
* Fri Feb 27 2009 gil <puntogil@libero.it> 2.7.0-6mamba
- rebuilt
* Thu Feb 26 2009 gil <puntogil@libero.it> 2.7.0-5mamba
- rebuilt with new xerces-j2
* Wed Feb 25 2009 gil <puntogil@libero.it> 2.7.0-4mamba
- fixed some errors
* Tue Feb 24 2009 gil <puntogil@libero.it> 2.7.0-3mamba
- rebuilt with system xerces-j2
- todo: tomcat support
* Tue Feb 24 2009 gil <puntogil@libero.it> 2.7.0-1mamba
- update to 2.7.0
* Mon Dec 22 2008 gil <puntogil@libero.it> 2.7.1-1mamba
- package created by autospec