Use %jpackage_script to generate scripts.

- Add OSGi metadata to manifest instead of discarding everything else in it.
- Drop dependency on xml-commons-api, add one on java(-headless).
- Crosslink javadocs with Java's.
- Include NOTICE* in docs.
- Update URLs.
- Specfile cleanups.
This commit is contained in:
Ville Skyttä 2013-12-23 13:54:33 +02:00
parent faff5a96d1
commit f4be5169b1
7 changed files with 63 additions and 105 deletions

View File

@ -0,0 +1,11 @@
diff -up xml-commons-resolver-1.2/resolver.xml~ xml-commons-resolver-1.2/resolver.xml
--- xml-commons-resolver-1.2/resolver.xml~ 2006-11-20 22:23:07.000000000 +0200
+++ xml-commons-resolver-1.2/resolver.xml 2011-10-19 00:43:22.186668155 +0300
@@ -148,6 +148,7 @@ Also, you may need to adjust src/documen
use="true"
windowtitle="${name.resolver} API"
doctitle="${name.resolver}"
+ link="/usr/share/javadoc/java"
bottom="${copyright.message}">
<package name="org.apache.xml.resolver"/>
<package name="org.apache.xml.resolver.helpers"/>

View File

@ -0,0 +1,19 @@
diff -up xml-commons-resolver-1.2/src/manifest.resolver~ xml-commons-resolver-1.2/src/manifest.resolver
--- xml-commons-resolver-1.2/src/manifest.resolver~ 2006-11-20 22:23:06.000000000 +0200
+++ xml-commons-resolver-1.2/src/manifest.resolver 2011-10-19 01:38:13.954802303 +0300
@@ -1,5 +1,15 @@
Manifest-Version: 1.0
Main-Class: org.apache.xml.resolver.apps.resolver
+Bundle-RequiredExecutionEnvironment: J2SE-1.2
+Bundle-SymbolicName: org.apache.xml.resolver
+Bundle-ManifestVersion: 2
+Bundle-Name: XML Commons Resolver
+Bundle-Localization: plugin
+Bundle-Version: 1.2.0.v200806030312
+Bundle-Vendor: Apache Software Foundation
+Export-Package: org.apache.env,org.apache.xml.resolver,org.apache.xml.
+ resolver.apps,org.apache.xml.resolver.etc,org.apache.xml.resolver.hel
+ pers,org.apache.xml.resolver.readers,org.apache.xml.resolver.tools
Name: org/apache/xml/resolver
Comment: xml-commons Resolver code

View File

@ -1,12 +0,0 @@
Manifest-Version: 1.0
Bundle-RequiredExecutionEnvironment: J2SE-1.2
Main-Class: org.apache.xml.resolver.apps.resolver
Bundle-SymbolicName: org.apache.xml.resolver
Bundle-ManifestVersion: 2
Bundle-Name: XML Commons Resolver
Bundle-Localization: plugin
Bundle-Version: 1.2.0.v200806030312
Bundle-Vendor: Apache Software Foundation
Export-Package: org.apache.env,org.apache.xml.resolver,org.apache.xml.
resolver.apps,org.apache.xml.resolver.etc,org.apache.xml.resolver.hel
pers,org.apache.xml.resolver.readers,org.apache.xml.resolver.tools

View File

@ -1,21 +0,0 @@
#!/bin/sh
#
# xml-commons-resolver resolver script
# JPackage Project (http://www.jpackage.org/)
# $Id: xml-commons-resolver-resolver.sh,v 1.1 2004/09/09 14:51:13 cvsdist Exp $
# Source functions library
. /usr/share/java-utils/java-functions
# Configuration
MAIN_CLASS=org.apache.xml.resolver.apps.resolver
BASE_JARS="xml-commons-resolver.jar xml-commons-apis.jar jaxp_parser_impl.jar"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,21 +0,0 @@
#!/bin/sh
#
# xml-commons-resolver xparse script
# JPackage Project (http://www.jpackage.org/)
# $Id: xml-commons-resolver-xparse.sh,v 1.1 2004/09/09 14:51:13 cvsdist Exp $
# Source functions library
. /usr/share/java-utils/java-functions
# Configuration
MAIN_CLASS=org.apache.xml.resolver.apps.xparse
BASE_JARS="xml-commons-resolver.jar xml-commons-apis.jar jaxp_parser_impl.jar"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,21 +0,0 @@
#!/bin/sh
#
# xml-commons-resolver xread script
# JPackage Project (http://www.jpackage.org/)
# $Id: xml-commons-resolver-xread.sh,v 1.1.2.1 2004/03/03 15:01:33 fche Exp $
# Source functions library
. /usr/share/java-utils/java-functions
# Configuration
MAIN_CLASS=org.apache.xml.resolver.apps.xread
BASE_JARS="xml-commons-resolver.jar xml-commons-apis.jar jaxp_parser_impl.jar"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,26 +1,27 @@
%if %{?fedora} > 19 || 0%{?rhel} > 6
%global headless -headless
%endif
Name: xml-commons-resolver Name: xml-commons-resolver
Version: 1.2 Version: 1.2
Release: 14%{?dist} Release: 15%{?dist}
Epoch: 0 Epoch: 0
Summary: Resolver subproject of xml-commons Summary: Resolver subproject of xml-commons
License: ASL 2.0 License: ASL 2.0
URL: http://xml.apache.org/commons/ URL: http://xerces.apache.org/xml-commons/components/resolver/
Source0: http://www.apache.org/dist/xml/commons/xml-commons-resolver-%{version}.tar.gz Source0: http://www.apache.org/dist/xerces/xml-commons/%{name}-%{version}.tar.gz
Source1: xml-commons-resolver-resolver.sh
Source2: xml-commons-resolver-xread.sh
Source3: xml-commons-resolver-xparse.sh
Source4: %{name}-MANIFEST.MF
Source5: %{name}-pom.xml Source5: %{name}-pom.xml
Source6: %{name}-resolver.1 Source6: %{name}-resolver.1
Source7: %{name}-xparse.1 Source7: %{name}-xparse.1
Source8: %{name}-xread.1 Source8: %{name}-xread.1
Patch0: %{name}-1.2-crosslink.patch
Patch1: %{name}-1.2-osgi.patch
Requires: xml-commons-apis Requires: java%{?headless} >= 1:1.6.0
Requires: jpackage-utils Requires: jpackage-utils
BuildRequires: java-devel >= 1:1.6.0 BuildRequires: java-devel >= 1:1.6.0
BuildRequires: ant BuildRequires: ant
BuildRequires: jpackage-utils BuildRequires: jpackage-utils
BuildRequires: zip
Group: Development/Libraries Group: Development/Libraries
BuildArch: noarch BuildArch: noarch
@ -30,33 +31,26 @@ Resolver subproject of xml-commons.
%package javadoc %package javadoc
Summary: Javadoc for %{name} Summary: Javadoc for %{name}
Group: Documentation Group: Documentation
Requires: jpackage-utils BuildRequires: java-javadoc
Requires: java-javadoc
%description javadoc %description javadoc
Javadoc for %{name}. Javadoc for %{name}.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1
# remove all binary libs and prebuilt javadocs # remove all binary libs and prebuilt javadocs
find . -name "*.jar" -exec rm -f {} \; find . -name "*.jar" -exec rm -f {} \;
rm -rf docs rm -rf docs
sed -i 's/\r//' KEYS LICENSE.resolver.txt sed -i 's/\r//' KEYS LICENSE.resolver.txt NOTICE-resolver.txt
%build %build
sed -i -e 's|call Resolver|call resolver|g' resolver.xml %ant -f resolver.xml jar javadocs
sed -i -e 's|classname="org.apache.xml.resolver.Catalog"|fork="yes" classname="org.apache.xml.resolver.apps.resolver"|g' resolver.xml
sed -i -e 's|org.apache.xml.resolver.Catalog|org.apache.xml.resolver.apps.resolver|g' src/manifest.resolver
ant -f resolver.xml jar javadocs
%install %install
# inject OSGi manifests
mkdir -p META-INF
cp -p %{SOURCE4} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/resolver.jar META-INF/MANIFEST.MF
# Jars # Jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir} install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -p -m 644 build/resolver.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar install -p -m 644 build/resolver.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
@ -68,9 +62,9 @@ cp -pr build/apidocs/resolver/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# Scripts # Scripts
mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/xml-resolver %jpackage_script org.apache.xml.resolver.apps.resolver "" "" %{name} xml-resolver true
cp %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/xml-xread %jpackage_script org.apache.xml.resolver.apps.xread "" "" %{name} xml-xread true
cp %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/xml-xparse %jpackage_script org.apache.xml.resolver.apps.xparse "" "" %{name} xml-xparse true
# Man pages # Man pages
install -d -m 755 ${RPM_BUILD_ROOT}%{_mandir}/man1 install -d -m 755 ${RPM_BUILD_ROOT}%{_mandir}/man1
@ -84,18 +78,27 @@ install -p -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar %add_maven_depmap JPP-%{name}.pom %{name}.jar
%files %files
%doc KEYS LICENSE.resolver.txt %doc KEYS LICENSE.resolver.txt NOTICE-resolver.txt
%{_mavendepmapfragdir}/* %{_mavendepmapfragdir}/*
%{_mavenpomdir}/* %{_mavenpomdir}/*
%{_javadir}/* %{_javadir}/*
%{_mandir}/man1/* %{_mandir}/man1/*
%attr(0755,root,root) %{_bindir}/* %{_bindir}/xml-*
%files javadoc %files javadoc
%{_javadocdir}/%{name} %{_javadocdir}/%{name}
%doc LICENSE.resolver.txt %doc LICENSE.resolver.txt NOTICE-resolver.txt
%changelog %changelog
* Mon Dec 23 2013 Ville Skyttä <ville.skytta@iki.fi> - 0:1.2-15
- Use %%jpackage_script to generate scripts.
- Add OSGi metadata to manifest instead of discarding everything else in it.
- Drop dependency on xml-commons-api, add one on java(-headless).
- Crosslink javadocs with Java's.
- Include NOTICE* in docs.
- Update URLs.
- Specfile cleanups.
* Thu Aug 15 2013 Mat Booth <fedora@matbooth.co.uk> - 0:1.2-14 * Thu Aug 15 2013 Mat Booth <fedora@matbooth.co.uk> - 0:1.2-14
- Fix FTBFS rhbz #993143 - Fix FTBFS rhbz #993143
@ -147,7 +150,7 @@ install -p -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
- Add dos2unix BR and fix line endings - Add dos2unix BR and fix line endings
- Use upstream tarball - Use upstream tarball
* Sat Aug 8 2009 Ville Skyttä <ville.skytta at iki.fi> - 0:1.1-4.16 * Sat Aug 8 2009 Ville Skyttä <ville.skytta@iki.fi> - 0:1.1-4.16
- Fix specfile UTF-8 encoding. - Fix specfile UTF-8 encoding.
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.1-4.15 * Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.1-4.15
@ -213,5 +216,5 @@ install -p -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
* Tue May 06 2003 David Walluck <david@anti-microsoft.org> 0:1.0-2jpp * Tue May 06 2003 David Walluck <david@anti-microsoft.org> 0:1.0-2jpp
- update for JPackage 1.5 - update for JPackage 1.5
* Wed Nov 13 2002 Ville Skyttä <ville.skytta at iki.fi> - 1.0-1jpp * Wed Nov 13 2002 Ville Skyttä <ville.skytta@iki.fi> - 1.0-1jpp
- Follow upstream changes, split out of xml-commons. - Follow upstream changes, split out of xml-commons.