Add maven metadata

- Few guidelines tweaks (buildroot, clean, defattr)
- Versionless jars & javadocs
This commit is contained in:
Stanislav Ochotnicky 2011-05-06 12:25:31 +02:00
parent 1be8d047b4
commit de5dd5d9d9
3 changed files with 95 additions and 22 deletions

13
xml-apis-2.0.2.pom Normal file
View File

@ -0,0 +1,13 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
<distributionManagement>
<relocation>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.0.b2</version>
</relocation>
</distributionManagement>
</project>

42
xml-apis-ext-1.3.04.pom Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<parent>
<artifactId>apache</artifactId>
<groupId>org.apache</groupId>
<version>3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis-ext</artifactId>
<name>XML Commons External Components XML APIs Extensions</name>
<version>1.3.04</version>
<description>xml-commons provides an Apache-hosted set of DOM, SAX, and
JAXP interfaces for use in other xml-based projects. Our hope is that we
can standardize on both a common version and packaging scheme for these
critical XML standards interfaces to make the lives of both our developers
and users easier. The External Components portion of xml-commons contains
interfaces that are defined by external standards organizations. For DOM,
that's the W3C; for SAX it's David Megginson and sax.sourceforge.net; for
JAXP it's Sun.</description>
<url>http://xml.apache.org/commons/components/external/</url>
<issueManagement>
<system>bugzilla</system>
<url>http://issues.apache.org/bugzilla/</url>
</issueManagement>
<mailingLists>
<mailingList>
<name>XML Commons Developer's List</name>
<subscribe>commons-dev-subscribe@xml.apache.org</subscribe>
<unsubscribe>commons-dev-unsubscribe@xml.apache.org</unsubscribe>
<post>commons-dev@xml.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/xml-commons-dev/</archive>
</mailingList>
</mailingLists>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/xml/commons/tags/xml-commons-external-1_3_04/</connection>
<url>http://svn.apache.org/viewvc/xml/commons/tags/xml-commons-external-1_3_04/</url>
</scm>
<distributionManagement>
<status>deployed</status>
</distributionManagement>
</project>

View File

@ -1,6 +1,6 @@
Name: xml-commons-apis Name: xml-commons-apis
Version: 1.4.01 Version: 1.4.01
Release: 3%{?dist} Release: 4%{?dist}
Summary: APIs for DOM, SAX, and JAXP Summary: APIs for DOM, SAX, and JAXP
Group: Development/Libraries Group: Development/Libraries
License: ASL 2.0 and W3C and Public Domain License: ASL 2.0 and W3C and Public Domain
@ -12,8 +12,8 @@ URL: http://xml.apache.org/commons/
Source0: xml-commons-external-%{version}-src.tar.gz Source0: xml-commons-external-%{version}-src.tar.gz
Source1: %{name}-MANIFEST.MF Source1: %{name}-MANIFEST.MF
Source2: %{name}-ext-MANIFEST.MF Source2: %{name}-ext-MANIFEST.MF
Source3: http://repo1.maven.org/maven2/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.pom
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source4: http://repo1.maven.org/maven2/xml-apis/xml-apis-ext/1.3.04/xml-apis-ext-1.3.04.pom
BuildArch: noarch BuildArch: noarch
@ -23,6 +23,8 @@ BuildRequires: ant
BuildRequires: zip BuildRequires: zip
Requires: java Requires: java
Requires: jpackage-utils Requires: jpackage-utils
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
Obsoletes: xml-commons < %{version}-%{release} Obsoletes: xml-commons < %{version}-%{release}
Provides: xml-commons = %{version}-%{release} Provides: xml-commons = %{version}-%{release}
@ -51,7 +53,6 @@ Group: Documentation
%prep %prep
%setup -q -n external %setup -q -n external
# Make sure upstream hasn't sneaked in any jars we don't know about # Make sure upstream hasn't sneaked in any jars we don't know about
find -name '*.class' -exec rm -f '{}' \; find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \; find -name '*.jar' -exec rm -f '{}' \;
@ -62,12 +63,14 @@ iconv -f iso8859-1 -t utf-8 LICENSE.dom-documentation.txt > \
iconv -f iso8859-1 -t utf-8 LICENSE.dom-software.txt > \ iconv -f iso8859-1 -t utf-8 LICENSE.dom-software.txt > \
LICENSE.dom-sof.temp && mv -f LICENSE.dom-sof.temp LICENSE.dom-software.txt LICENSE.dom-sof.temp && mv -f LICENSE.dom-sof.temp LICENSE.dom-software.txt
# remove bogus section from poms
cp %{SOURCE3} %{SOURCE4} .
sed -i '/distributionManagement/,/\/distributionManagement/ {d}' *.pom
%build %build
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 jar javadoc ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 jar javadoc
%install %install
rm -rf %{buildroot}
# inject OSGi manifests # inject OSGi manifests
mkdir -p META-INF mkdir -p META-INF
cp -p %{SOURCE1} META-INF/MANIFEST.MF cp -p %{SOURCE1} META-INF/MANIFEST.MF
@ -78,46 +81,61 @@ touch META-INF/MANIFEST.MF
zip -u build/xml-apis-ext.jar META-INF/MANIFEST.MF zip -u build/xml-apis-ext.jar META-INF/MANIFEST.MF
# Jars # Jars
install -pD -T build/xml-apis.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar install -pD -T build/xml-apis.jar %{buildroot}%{_javadir}/%{name}.jar
install -pD -T build/xml-apis-ext.jar %{buildroot}%{_javadir}/%{name}-ext-%{version}.jar install -pDm 644 xml-apis-[0-9]*.pom %{buildroot}/%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap xml-apis xml-apis %{version} JPP %{name}
install -pD -T build/xml-apis-ext.jar %{buildroot}%{_javadir}/%{name}-ext.jar
install -pDm 644 xml-apis-ext*.pom %{buildroot}/%{_mavenpomdir}/JPP-%{name}-ext.pom
%add_to_maven_depmap xml-apis xml-apis-ext %{version} JPP %{name}-ext
# Jar versioning
(cd %{buildroot}%{_javadir} && for jar in %{name}-%{version}.jar; do ln -sf ${jar} dom3-${jar}; done)
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# for better interoperability with the jpp apis packages # for better interoperability with the jpp apis packages
ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp13.jar ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp13.jar
ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp.jar ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp.jar
ln -sf %{name}.jar %{buildroot}%{_javadir}/xml-commons-jaxp-1.3-apis.jar ln -sf %{name}.jar %{buildroot}%{_javadir}/xml-commons-jaxp-1.3-apis.jar
# Javadocs # Javadocs
mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version} mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/javadoc/* \ cp -pr build/docs/javadoc/* %{buildroot}%{_javadocdir}/%{name}
%{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# prevent apis javadoc from being included in doc # prevent apis javadoc from being included in doc
rm -rf build/docs/javadoc rm -rf build/docs/javadoc
%clean %pre javadoc
rm -rf %{buildroot} # workaround for rpm bug, can be removed in F-18
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files %files
%defattr(-,root,root,-)
%doc LICENSE NOTICE %doc LICENSE NOTICE
%doc LICENSE.dom-documentation.txt README.dom.txt %doc LICENSE.dom-documentation.txt README.dom.txt
%doc LICENSE.dom-software.txt LICENSE.sac.html %doc LICENSE.dom-software.txt LICENSE.sac.html
%doc LICENSE.sax.txt README-sax README.sax.txt %doc LICENSE.sax.txt README-sax README.sax.txt
%{_javadir}/* %{_javadir}/*
%{_mavendepmapfragdir}/%{name}
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavenpomdir}/JPP-%{name}-ext.pom
%files manual %files manual
%defattr(-,root,root,-)
%doc build/docs/* %doc build/docs/*
%files javadoc %files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/* %{_javadocdir}/*
%changelog %changelog
* Fri May 6 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.4.01-4
- Add maven metadata
- Few guidelines tweaks (buildroot, clean, defattr)
- Versionless jars & javadocs
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.01-3 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.01-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild