xml-commons-apis/xml-commons-apis.spec

204 lines
6.7 KiB
RPMSpec

#%define majver %(echo %version | cut -d. -f 1-2)
%define repodir %{_javadir}/repository.jboss.com/apache-xml-commons/%{version}-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src
Name: xml-commons-apis
Version: 1.4.01
Release: 3mamba
Summary: APIs for DOM, SAX, and JAXP
Group: Applications/Publishing
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
URL: http://xml.apache.org/commons/
#Source: http://apache.panu.it/xml/commons/xml-commons-external-%{version}-src.tar.gz
# svn export http://svn.apache.org/repos/asf/xml/commons/tags/xml-commons-external-1_4_01/java/external/
# tar czf xml-commons-external-1.4.01-src-svn.tar.gz external
Source0: xml-commons-external-%{version}-src-svn.tar.gz
Source1: java-component-info10.xml
Source2: xml-commons-apis-MANIFEST.MF
Source3: xml-commons-apis-ext-MANIFEST.MF
License: Apache License 2.0, W3C, Public Domain
BuildRequires: apache-ant
BuildRequires: coreutils
BuildRequires: jpackage-utils
#BuildRequires: java-openjdk
Requires: jpackage-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
%{name} is designed to organize and have common packaging for
the various externally-defined standard interfaces for XML. This
includes the DOM, SAX, and JAXP.
%package manual
Summary: Manual for %{name}
Group: Documentation
%description manual
%{name} is designed to organize and have common packaging for
the various externally-defined standard interfaces for XML. This
includes the DOM, SAX, and JAXP.
Manual for %{name}.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation
%description javadoc
%{name} is designed to organize and have common packaging for
the various externally-defined standard interfaces for XML. This
includes the DOM, SAX, and JAXP.
Javadoc for %{name}.
%package repolib
Group: Development/Libraries/Java
Summary: Artifacts to be uploaded to a repository library
Requires: xml-commons-resolver-repolib
%description repolib
%{name} is designed to organize and have common packaging for
the various externally-defined standard interfaces for XML. This
includes the DOM, SAX, and JAXP.
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 external
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
for j in $(find . -name "*.gz"); do
rm -rf $j
done
iconv -f iso8859-1 -t utf-8 LICENSE.dom-documentation.txt > \
LICENSE.dom-doc.temp && mv -f LICENSE.dom-doc.temp LICENSE.dom-documentation.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
rm -rf build
%build
export OPT_JAR_LIST="./external/build/xml-apis.jar"
export JAVA_HOME=%java_home
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 jar javadoc
mkdir -p META-INF
cp -p %{SOURCE2} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/xml-apis.jar META-INF/MANIFEST.MF
cp -p %{SOURCE3} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/xml-apis-ext.jar META-INF/MANIFEST.MF
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -pm 644 build/xml-apis.jar \
%{buildroot}%{_javadir}/%{name}-%{version}.jar
install -pm 644 build/xml-apis-ext.jar \
%{buildroot}%{_javadir}/%{name}-ext-%{version}.jar
(
pushd %{buildroot}%{_javadir}
for jar in %{name}-%{version}.jar; do
ln -sf ${jar} dom3-${jar}
done
popd
)
(
pushd %{buildroot}%{_javadir}
for jar in *-%{version}.jar; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done
popd
)
ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp13.jar
ln -sf %{name}.jar %{buildroot}%{_javadir}/jaxp.jar
ln -sf %{name}.jar %{buildroot}%{_javadir}/xml-commons-jaxp-1.3-apis.jar
mkdir -p %{buildroot}%{_javadocdir}/xml-commons-apis-%{version}
cp -pr build/docs/javadoc/* %{buildroot}%{_javadocdir}/xml-commons-apis-%{version}
ln -s xml-commons-apis-%{version} %{buildroot}%{_javadocdir}/xml-commons-apis
rm -rf docs/javadoc
mkdir -p %{buildroot}%{repodir}
mkdir -p %{buildroot}%{repodirlib}
install -pm 644 %{SOURCE1} %{buildroot}%{repodir}/component-info.xml
sed -i "s/@NAME@/apache-xerces-component-info/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ID@/apache-xml-commons/g" %{buildroot}%{repodir}/component-info.xml
tag=`echo xml-commons-%{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@/Common code for XML projects/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID1@/resolver.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID2@/xml-apis.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT1@/resolver.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT2@/xml-apis.jar/g" %{buildroot}%{repodir}/component-info.xml
mkdir -p %{buildroot}%{repodirsrc}
install -pm 644 %{SOURCE0} %{buildroot}%{repodirsrc}
cp -p %{buildroot}%{_javadir}/%{name}-%{version}.jar %{buildroot}%{repodirlib}/xml-apis.jar
#%{_bindir}/aot-compile-rpm
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_javadir}/dom3-xml-commons-apis-%{version}.jar
%{_javadir}/dom3-xml-commons-apis.jar
%{_javadir}/jaxp.jar
%{_javadir}/jaxp13.jar
%{_javadir}/xml-commons-apis-%{version}.jar
%{_javadir}/xml-commons-apis-ext-%{version}.jar
%{_javadir}/xml-commons-apis-ext.jar
%{_javadir}/xml-commons-apis.jar
%{_javadir}/xml-commons-jaxp-1.3-apis.jar
%doc LICENSE* NOTICE README*
%files manual
%defattr(-,root,root)
%doc build/docs/*
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/*
%files repolib
%defattr(-,root,root)
%{repodir}
%changelog
* Wed Mar 23 2011 gil <puntogil@libero.it> 1.4.01-3mamba
- rebuilt with java-openjdk support
* Wed Dec 22 2010 gil <puntogil@libero.it> 1.4.01-2mamba
- add OSGi manifest (eclipe,)
* Tue Aug 24 2010 gil <puntogil@libero.it> 1.4.01-1mamba
- update to 1.4.01
* Sun Jan 10 2010 gil <puntogil@libero.it> 1.3.04-2mamba
- added new sub package repolib
* Thu Feb 26 2009 gil <puntogil@libero.it> 1.3.04-1mamba
- rebuilt for compatibility with previous releases
* Mon Dec 22 2008 gil <puntogil@libero.it> 1.3.04svn-1mamba
- package created by autospec