- Use non-versioned jar name, RHBZ#800463

- Cleanup in spec file to follow new guidelines
- Consolidated javadocs packages
- Removed manual subpackage because of stylebook issues, see comment on obsolete
This commit is contained in:
Marek Goldmann 2012-03-06 15:15:27 +01:00
parent 54933bd8b0
commit d825465b7d

View File

@ -2,7 +2,7 @@
Name: xerces-j2
Version: 2.11.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Java XML parser
Group: Development/Libraries
License: ASL 2.0
@ -27,8 +27,6 @@ Patch0: %{name}-build.patch
# Patch the manifest so that it includes OSGi stuff
Patch1: %{name}-manifest.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0
@ -37,7 +35,6 @@ BuildRequires: xalan-j2 >= 2.7.1
BuildRequires: xml-commons-apis >= 1.4.01
BuildRequires: xml-commons-resolver >= 1.2
BuildRequires: ant
BuildRequires: xml-stylebook
BuildRequires: jaxp_parser_impl
BuildRequires: dejavu-sans-fonts
Requires: java
@ -50,12 +47,13 @@ Provides: jaxp_parser_impl = 1.4
Requires(post): chkconfig jaxp_parser_impl
Requires(preun): chkconfig jaxp_parser_impl
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
# This documentation is provided by xml-commons-apis
Obsoletes: %{name}-javadoc-apis < %{version}-%{release}
# http://mail-archives.apache.org/mod_mbox/xerces-j-dev/201008.mbox/%3COF8D7E2F83.0271A181-ON8525777F.00528302-8525777F.0054BBE0@ca.ibm.com%3E
Obsoletes: %{name}-manual < %{version}-%{release}
%description
Welcome to the future! Xerces2 is the next generation of high performance,
fully compliant XML parsers in the Apache Xerces family. This new version of
@ -83,45 +81,19 @@ also handles name spaces according to the XML Namespaces 1.1 Recommendation,
and will correctly serialize XML 1.1 documents if the DOM level 3 load/save
APIs are in use.
%package javadoc-impl
Summary: Javadoc for %{name} implementation
%package javadoc
Summary: Javadocs for %{name}
Group: Documentation
Requires: jpackage-utils
%description javadoc-impl
%{summary}.
# Consolidating all javadocs into one package
Obsoletes: %{name}-javadoc-impl < %{version}-%{release}
Obsoletes: %{name}-javadoc-xs < %{version}-%{release}
Obsoletes: %{name}-javadoc-xni < %{version}-%{release}
Obsoletes: %{name}-javadoc-other < %{version}-%{release}
%package javadoc-xs
Summary: Javadoc for %{name} XML schema API
Group: Documentation
%description javadoc-xs
%{summary}.
%package javadoc-xni
Summary: Javadoc for %{name} XNI
Group: Documentation
%description javadoc-xni
%{summary}.
%package javadoc-other
Summary: Javadoc for other %{name} components
Group: Documentation
%description javadoc-other
%{summary}.
%package manual
Summary: Manual for %{name}
Group: Documentation
Requires: xml-commons-apis-javadoc
Requires: %{name}-javadoc-impl = %{version}-%{release}
Requires: %{name}-javadoc-xs = %{version}-%{release}
Requires: %{name}-javadoc-xni = %{version}-%{release}
Requires: %{name}-javadoc-other = %{version}-%{release}
%description manual
%{summary}.
%description javadoc
This package contains the API documentation for %{name}.
%package demo
Summary: Demonstrations and samples for %{name}
@ -169,55 +141,29 @@ jar cf bin/xerces2taglets.jar org/apache/xerces/util/*Taglet.class
ln -sf $(build-classpath xalan-j2) serializer.jar
ln -sf $(build-classpath xml-commons-apis) xml-apis.jar
ln -sf $(build-classpath xml-commons-resolver) resolver.jar
ln -sf $(build-classpath xml-stylebook) stylebook-1.0-b2.jar
popd
# Build everything
export ANT_OPTS="-Xmx256m -Djava.endorsed.dirs=$(pwd)/tools -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true"
ant -Djavac.source=1.5 -Djavac.target=1.5 \
-Dbuild.compiler=modern \
clean jars javadocs docs
# Fix line endings in generated docs
sed -i 's/\r//' build/docs/download.cgi build/docs/resources/script.js
clean jars javadocs
%install
rm -rf %{buildroot}
# jars
install -pD -T build/xercesImpl.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
install -pD -T build/xercesImpl.jar %{buildroot}%{_javadir}/%{name}.jar
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}-impl-%{version}
cp -pr build/docs/javadocs/xerces2/* %{buildroot}%{_javadocdir}/%{name}-impl-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-impl-%{version} %{name}-impl)
mkdir -p %{buildroot}%{_javadocdir}/%{name}
mkdir -p %{buildroot}%{_javadocdir}/%{name}/impl
mkdir -p %{buildroot}%{_javadocdir}/%{name}/xs
mkdir -p %{buildroot}%{_javadocdir}/%{name}/xni
mkdir -p %{buildroot}%{_javadocdir}/%{name}/other
mkdir -p %{buildroot}%{_javadocdir}/%{name}-xs-%{version}
cp -pr build/docs/javadocs/api/* %{buildroot}%{_javadocdir}/%{name}-xs-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-xs-%{version} %{name}-xs)
mkdir -p %{buildroot}%{_javadocdir}/%{name}-xni-%{version}
cp -pr build/docs/javadocs/xni/* %{buildroot}%{_javadocdir}/%{name}-xni-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-xni-%{version} %{name}-xni)
mkdir -p %{buildroot}%{_javadocdir}/%{name}-other-%{version}
cp -pr build/docs/javadocs/other/* %{buildroot}%{_javadocdir}/%{name}-other-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-other-%{version} %{name}-other)
rm -rf build/docs/javadocs/*
# manual
install -d %{buildroot}%{_docdir}/%{name}-%{version}/manual
cp -pr build/docs/* %{buildroot}%{_docdir}/%{name}-%{version}/manual
ln -s ../../../../javadoc/xml-commons-apis/ %{buildroot}%{_docdir}/%{name}-%{version}/manual/javadocs/api
ln -s ../../../../javadoc/%{name}-impl/ %{buildroot}%{_docdir}/%{name}-%{version}/manual/javadocs/xerces2
ln -s ../../../../javadoc/%{name}-xs/ %{buildroot}%{_docdir}/%{name}-%{version}/manual/javadocs/xs
ln -s ../../../../javadoc/%{name}-xni/ %{buildroot}%{_docdir}/%{name}-%{version}/manual/javadocs/xni
ln -s ../../../../javadoc/%{name}-other/ %{buildroot}%{_docdir}/%{name}-%{version}/manual/javadocs/other
# other docs
install -p -m644 LICENSE README NOTICE %{buildroot}%{_docdir}/%{name}-%{version}
cp -pr build/docs/javadocs/xerces2/* %{buildroot}%{_javadocdir}/%{name}/impl
cp -pr build/docs/javadocs/api/* %{buildroot}%{_javadocdir}/%{name}/xs
cp -pr build/docs/javadocs/xni/* %{buildroot}%{_javadocdir}/%{name}/xni
cp -pr build/docs/javadocs/other/* %{buildroot}%{_javadocdir}/%{name}/other
# scripts
install -pD -m755 -T %{SOURCE1} %{buildroot}%{_bindir}/%{name}-version
@ -229,27 +175,18 @@ cp -pr data %{buildroot}%{_datadir}/%{name}
# Pom
install -pD -T -m 644 %{SOURCE7} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap xerces xercesImpl %{version} JPP %{name}
# Legacy depmaps for compatability
%add_to_maven_depmap xerces xerces %{version} JPP %{name}
%add_to_maven_depmap xerces xmlParserAPIs %{version} JPP %{name}
# Depmap with legacy depmaps for compatability
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "xerces:xerces" -a "xerces:xmlParserAPIs"
# jaxp_parser_impl ghost symlink
ln -s %{_sysconfdir}/alternatives \
%{buildroot}%{_javadir}/jaxp_parser_impl.jar
%clean
rm -rf %{buildroot}
%post
%update_maven_depmap
update-alternatives --install %{_javadir}/jaxp_parser_impl.jar \
jaxp_parser_impl %{_javadir}/%{name}.jar 40
%postun
%update_maven_depmap
%preun
{
[ $1 = 0 ] || exit 0
@ -257,40 +194,17 @@ update-alternatives --install %{_javadir}/jaxp_parser_impl.jar \
} >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/LICENSE
%doc %{_docdir}/%{name}-%{version}/NOTICE
%doc %{_docdir}/%{name}-%{version}/README
%doc LICENSE NOTICE README
%{_mavendepmapfragdir}/*
%{_mavenpomdir}/*
%{_javadir}/%{name}*
%ghost %{_javadir}/jaxp_parser_impl.jar
%files javadoc-impl
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-impl-%{version}
%{_javadocdir}/%{name}-impl
%files javadoc-xs
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-xs-%{version}
%{_javadocdir}/%{name}-xs
%files javadoc-other
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-other-%{version}
%{_javadocdir}/%{name}-other
%files javadoc-xni
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-xni-%{version}
%{_javadocdir}/%{name}-xni
%files manual
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}
%{_docdir}/%{name}-%{version}/manual
%files javadoc
%{_javadocdir}/%{name}/impl
%{_javadocdir}/%{name}/xs
%{_javadocdir}/%{name}/xni
%{_javadocdir}/%{name}/other
%files demo
%defattr(-,root,root,-)
@ -301,6 +215,12 @@ update-alternatives --install %{_javadir}/jaxp_parser_impl.jar \
%{_bindir}/*
%changelog
* Tue Mar 06 2012 Marek Goldmann <mgoldman@redhat.com> - 2.11.0-5
- Use non-versioned jar name, RHBZ#800463
- Cleanup in spec file to follow new guidelines
- Consolidated javadocs packages
- Removed manual subpackage because of stylebook issues, see comment on obsolete
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild