Build with maven 3.

- Adapt to current guidelines.
This commit is contained in:
Alexander Kurtakov 2011-11-29 17:46:29 +02:00
parent 0893d08412
commit 09ecd47741

View File

@ -1,7 +1,7 @@
Name: msv
Epoch: 1
Version: 2009.1
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Multi-Schema Validator
Group: Development/Libraries
License: BSD
@ -45,7 +45,6 @@ BuildRequires: xml-commons-resolver >= 0:1.2-4
BuildRequires: junit4
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
The Sun Multi-Schema XML Validator (MSV) is a Java technology tool to validate
@ -193,44 +192,32 @@ for m in $(find . -name copyright.txt) ; do
done
%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
install javadoc:aggregate
mvn-rpmbuild install javadoc:aggregate
%install
rm -rf %{buildroot}
# Jars
install -pD -T msv/target/%{name}-core-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-core-%{version}.jar
%{buildroot}%{_javadir}/%{name}-core.jar
install -pD -T relames/target/%{name}-relames-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-relames-%{version}.jar
%{buildroot}%{_javadir}/%{name}-relames.jar
install -pD -T rngconverter/target/%{name}-rngconverter-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-rngconverter-%{version}.jar
%{buildroot}%{_javadir}/%{name}-rngconverter.jar
install -pD -T generator/target/%{name}-generator-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-generator-%{version}.jar
%{buildroot}%{_javadir}/%{name}-generator.jar
install -pD -T xsdlib/target/xsdlib-%{version}.jar \
%{buildroot}%{_javadir}/xsdlib-%{version}.jar
%{buildroot}%{_javadir}/xsdlib.jar
install -pD -T testharness/target/%{name}-testharness-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-testharness-%{version}.jar
%{buildroot}%{_javadir}/%{name}-testharness.jar
# Alternate jar names
ln -s %{name}-core-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-msv-%{version}.jar
ln -s %{name}-rngconverter-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-rngconv-%{version}.jar
ln -s %{name}-generator-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-xmlgen-%{version}.jar
ln -s xsdlib-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-xsdlib-%{version}.jar
# Versionless jar names
(cd %{buildroot}%{_javadir} &&
for jar in *-%{version}.jar ; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done)
ln -s %{name}-core.jar \
%{buildroot}%{_javadir}/%{name}-msv.jar
ln -s %{name}-rngconverter.jar \
%{buildroot}%{_javadir}/%{name}-rngconv.jar
ln -s %{name}-generator.jar \
%{buildroot}%{_javadir}/%{name}-xmlgen.jar
ln -s xsdlib.jar \
%{buildroot}%{_javadir}/%{name}-xsdlib.jar
# Poms
install -pD -T -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-msv.pom
@ -253,9 +240,8 @@ install -pD -T -m 644 xsdlib/pom.xml %{buildroot}%{_mavenpomdir}/JPP-xsdli
%add_to_maven_depmap com.sun.msv.datatype.xsd xsdlib %{version} JPP xsdlib
# Javadocs
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
# Manuals
install -d -m 755 %{buildroot}%{_docdir}/%{name}-%{version}/msv
@ -289,63 +275,40 @@ cp -pr xsdlib/examples/* %{buildroot}%{_datadir}/%{name}-%{version}/xsdlib
%jpackage_script com.sun.msv.schematron.Driver "" "" msv-relames:msv-msv:msv-xsdlib:relaxngDatatype:isorelax:xalan-j2 relames true
%jpackage_script com.sun.msv.writer.relaxng.Driver "" "" msv-rngconv:msv-msv:msv-xsdlib:relaxngDatatype:isorelax:xerces-j2 rngconv true
%clean
rm -rf %{buildroot}
%post xsdlib
%update_maven_depmap
%postun xsdlib
%update_maven_depmap
%files msv
%defattr(-,root,root,-)
%{_bindir}/msv
%{_mavenpomdir}/JPP-%{name}-core.pom
%{_mavenpomdir}/JPP-%{name}-testharness.pom
%{_javadir}/%{name}-core-%{version}.jar
%{_javadir}/%{name}-core.jar
%{_javadir}/%{name}-msv-%{version}.jar
%{_javadir}/%{name}-msv.jar
%{_javadir}/%{name}-testharness*
%doc msv/doc/license.txt
%files relames
%defattr(-,root,root,-)
%{_bindir}/relames
%{_mavenpomdir}/JPP-%{name}-relames.pom
%{_javadir}/%{name}-relames-%{version}.jar
%{_javadir}/%{name}-relames.jar
%doc relames/doc/copyright.txt
%files rngconv
%defattr(-,root,root,-)
%{_bindir}/rngconv
%{_mavenpomdir}/JPP-%{name}-rngconverter.pom
%{_javadir}/%{name}-rngconverter-%{version}.jar
%{_javadir}/%{name}-rngconverter.jar
%{_javadir}/%{name}-rngconv-%{version}.jar
%{_javadir}/%{name}-rngconv.jar
%doc rngconverter/doc/license.txt
%doc rngconverter/doc/copyright.txt
%files xmlgen
%defattr(-,root,root,-)
%{_bindir}/xmlgen
%{_mavenpomdir}/JPP-%{name}-generator.pom
%{_javadir}/%{name}-generator-%{version}.jar
%{_javadir}/%{name}-generator.jar
%{_javadir}/%{name}-xmlgen-%{version}.jar
%{_javadir}/%{name}-xmlgen.jar
%doc generator/doc/license.txt
%doc generator/doc/copyright.txt
%files xsdlib
%defattr(-,root,root,-)
%{_mavenpomdir}/JPP-xsdlib.pom
%{_javadir}/xsdlib-%{version}.jar
%{_javadir}/xsdlib.jar
%{_javadir}/%{name}-xsdlib-%{version}.jar
%{_javadir}/%{name}-xsdlib.jar
%doc xsdlib/doc/license.txt
%doc xsdlib/doc/copyright.txt
@ -357,19 +320,19 @@ rm -rf %{buildroot}
%{_mavendepmapfragdir}/*
%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%files manual
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-%{version}
%files demo
%defattr(-,root,root,-)
%{_datadir}/%{name}-%{version}
%changelog
* Tue Nov 29 2011 Alexander Kurtakov <akurtako@redhat.com> 1:2009.1-9
- Build with maven 3.
- Adapt to current guidelines.
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:2009.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild