Install with XMvn

This commit is contained in:
Michael Simacek 2017-03-21 16:23:43 +01:00
parent 0467e5fdb4
commit af06a106a7

145
ant.spec
View File

@ -36,7 +36,7 @@
Name: ant
Version: 1.10.1
Release: 4%{?dist}
Release: 5%{?dist}
Epoch: 0
Summary: Java build tool
Summary(it): Tool per la compilazione di programmi java
@ -49,24 +49,31 @@ Source2: apache-ant-1.8.ant.conf
# Fix some places where copies of classes are included in the wrong jarfiles
Patch4: apache-ant-class-path-in-manifest.patch
BuildRequires: jpackage-utils >= 0:1.7.5
BuildRequires: javapackages-local
BuildRequires: java-devel >= 1:1.8.0
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: junit
BuildRequires: hamcrest
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
BuildRequires: xz-java
BuildRequires: mvn(antlr:antlr)
BuildRequires: mvn(bcel:bcel)
BuildRequires: mvn(bsf:bsf)
BuildRequires: mvn(com.jcraft:jsch)
BuildRequires: mvn(commons-logging:commons-logging-api)
BuildRequires: mvn(commons-net:commons-net)
BuildRequires: mvn(javax.mail:mail)
BuildRequires: mvn(jdepend:jdepend)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(log4j:log4j:1.2.13)
BuildRequires: mvn(org.tukaani:xz)
BuildRequires: mvn(oro:oro)
BuildRequires: mvn(regexp:regexp)
BuildRequires: mvn(xalan:xalan)
BuildRequires: mvn(xml-resolver:xml-resolver)
# Theoretically Ant might be usable with just JRE, but typical Ant
# workflow requires full JDK, so we recommend it here.
%{?fedora:Recommends}%{!?fedora:Requires}: java-devel >= 1:1.8.0
Requires: xerces-j2
Requires: xml-commons-apis
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-scripts < %{epoch}:%{version}-%{release}
@ -103,7 +110,6 @@ Core part of Apache Ant that can be used as a library.
%package jmf
Summary: Optional jmf tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description jmf
Optional jmf tasks for %{name}.
@ -113,7 +119,6 @@ Taches jmf optionelles pour %{name}.
%package swing
Summary: Optional swing tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description swing
Optional swing tasks for %{name}.
@ -123,9 +128,6 @@ Taches swing optionelles pour %{name}.
%package antlr
Summary: Optional antlr tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: antlr
BuildRequires: antlr
%description antlr
Optional antlr tasks for %{name}.
@ -135,9 +137,6 @@ Taches antlr optionelles pour %{name}.
%package apache-bsf
Summary: Optional apache bsf tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: bsf
BuildRequires: bsf
%description apache-bsf
Optional apache bsf tasks for %{name}.
@ -147,9 +146,6 @@ Taches apache bsf optionelles pour %{name}.
%package apache-resolver
Summary: Optional apache resolver tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: xml-commons-resolver
BuildRequires: xml-commons-resolver
%description apache-resolver
Optional apache resolver tasks for %{name}.
@ -159,9 +155,6 @@ Taches apache resolver optionelles pour %{name}.
%package commons-logging
Summary: Optional commons logging tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: apache-commons-logging
BuildRequires: apache-commons-logging
%description commons-logging
Optional commons logging tasks for %{name}.
@ -171,9 +164,6 @@ Taches commons logging optionelles pour %{name}.
%package commons-net
Summary: Optional commons net tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: apache-commons-net
BuildRequires: apache-commons-net
%description commons-net
Optional commons net tasks for %{name}.
@ -185,9 +175,6 @@ Taches commons net optionelles pour %{name}.
%if 0
%package jai
Summary: Optional jai tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jai
BuildRequires: jai
%description jai
Optional jai tasks for %{name}.
@ -198,9 +185,6 @@ Taches jai optionelles pour %{name}.
%package apache-bcel
Summary: Optional apache bcel tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: bcel
BuildRequires: bcel
%description apache-bcel
Optional apache bcel tasks for %{name}.
@ -210,9 +194,6 @@ Taches apache bcel optionelles pour %{name}.
%package apache-log4j
Summary: Optional apache log4j tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: log4j12
BuildRequires: log4j12
%description apache-log4j
Optional apache log4j tasks for %{name}.
@ -222,9 +203,6 @@ Taches apache log4j optionelles pour %{name}.
%package apache-oro
Summary: Optional apache oro tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jakarta-oro
BuildRequires: jakarta-oro
%description apache-oro
Optional apache oro tasks for %{name}.
@ -234,9 +212,6 @@ Taches apache oro optionelles pour %{name}.
%package apache-regexp
Summary: Optional apache regexp tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: regexp
BuildRequires: regexp
%description apache-regexp
Optional apache regexp tasks for %{name}.
@ -246,10 +221,6 @@ Taches apache regexp optionelles pour %{name}.
%package apache-xalan2
Summary: Optional apache xalan2 tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: regexp
BuildRequires: regexp
Requires: xalan-j2
%description apache-xalan2
Optional apache xalan2 tasks for %{name}.
@ -259,9 +230,6 @@ Taches apache xalan2 optionelles pour %{name}.
%package javamail
Summary: Optional javamail tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: javamail >= 0:1.2-5jpp
BuildRequires: javamail >= 0:1.2-5jpp
%description javamail
Optional javamail tasks for %{name}.
@ -271,9 +239,6 @@ Taches javamail optionelles pour %{name}.
%package jdepend
Summary: Optional jdepend tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jdepend
BuildRequires: jdepend
%description jdepend
Optional jdepend tasks for %{name}.
@ -283,9 +248,6 @@ Taches jdepend optionelles pour %{name}.
%package jsch
Summary: Optional jsch tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jsch
BuildRequires: jsch
%description jsch
Optional jsch tasks for %{name}.
@ -295,9 +257,6 @@ Taches jsch optionelles pour %{name}.
%package junit
Summary: Optional junit tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: junit
Requires: xalan-j2
%description junit
Optional junit tasks for %{name}.
@ -307,16 +266,12 @@ Taches junit optionelles pour %{name}.
%package testutil
Summary: Test utility classes for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: junit
%description testutil
Test utility tasks for %{name}.
%package xz
Summary: Optional xz tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: xz-java
%description xz
Optional xz tasks for %{name}.
@ -380,6 +335,12 @@ mv KEYS.utf8 KEYS
iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
mv LICENSE.utf8 LICENSE
# It's part of the JDK now
%pom_remove_dep javax.activation src/etc/poms/ant-javamail/pom.xml
# We want a hard dep on antlr
%pom_xpath_remove pom:optional src/etc/poms/ant-antlr/pom.xml
%build
%{ant} jars test-jar
@ -395,9 +356,10 @@ rm -fr build/lib/ant-jai.jar build/lib/ant-netrexx.jar
# ANT_HOME and subdirs
mkdir -p $RPM_BUILD_ROOT%{ant_home}/{lib,etc,bin}
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
%mvn_alias :ant org.apache.ant:ant-nodeps apache:ant ant:ant
%mvn_alias :ant-launcher ant:ant-launcher
%mvn_file ':{ant,ant-bootstrap,ant-launcher}' %{name}/@1 @1
for jar in build/lib/*.jar
do
@ -405,34 +367,30 @@ do
jar tf ${jar} | egrep -q *.class
jarname=$(basename $jar .jar)
pomname="JPP.%{name}-${jarname}.pom"
#instal jar
install -m 644 ${jar} $RPM_BUILD_ROOT%{_javadir}/%{name}/${jarname}.jar
# jar aliases
ln -sf ../../java/%{name}/${jarname}.jar $RPM_BUILD_ROOT%{ant_home}/lib/${jarname}.jar
#bootstrap does not have a pom
[ $jarname == ant-bootstrap ] && continue
pom=src/etc/poms/${jarname}/pom.xml
# add backward compatibility for nodeps jar that is now part of main
# jar
alias=
[ $jarname == ant ] && alias=org.apache.ant:ant-nodeps,apache:ant,ant:ant
[ $jarname == ant-launcher ] && alias=ant:ant-launcher
# bootstrap does not have a pom, generate one
[ $jarname == ant-bootstrap ] && pom='org.apache.ant:ant-bootstrap:%{version}'
#install pom
install -p -m 644 src/etc/poms/${jarname}/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/${pomname}
%add_maven_depmap ${pomname} %{name}/${jarname}.jar -a "${alias}" -f ${jarname/ant-/}
%mvn_artifact ${pom} ${jar}
done
for mod in ant ant-bootstrap ant-launcher; do
ln -sf %{name}/${mod}.jar $RPM_BUILD_ROOT%{_javadir}
done
# ant-parent pom
%mvn_artifact src/etc/poms/pom.xml
#ant-parent pom
install -p -m 644 src/etc/poms/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}-parent.pom
%add_maven_depmap JPP-%{name}-parent.pom
%mvn_package :ant lib
%mvn_package :ant-launcher lib
%mvn_package :ant-bootstrap lib
%mvn_package :ant-parent lib
%mvn_package :ant-junit4 junit
# catchall rule for the rest
%mvn_package ':ant-{*}' @1
%mvn_install
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
@ -489,7 +447,8 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%endif
%files
%doc KEYS LICENSE NOTICE README WHATSNEW
%doc KEYS README WHATSNEW
%license LICENSE NOTICE
%config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/ant
%attr(0755,root,root) %{_bindir}/antRun
@ -509,12 +468,8 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%{ant_home}/etc/printFailingTests.xsl
%dir %{_sysconfdir}/%{name}.d
%files lib -f .mfiles -f .mfiles-ant -f .mfiles-launcher
%files lib -f .mfiles-lib
%dir %{ant_home}/lib
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-bootstrap.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}/%{name}-bootstrap.jar
%{ant_home}/lib/%{name}.jar
%{ant_home}/lib/%{name}-launcher.jar
%{ant_home}/lib/%{name}-bootstrap.jar
@ -591,7 +546,6 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.d/jsch
%files junit -f .mfiles-junit
%files junit -f .mfiles-junit4
%{ant_home}/lib/%{name}-junit.jar
%{ant_home}/lib/%{name}-junit4.jar
%config(noreplace) %{_sysconfdir}/%{name}.d/junit
@ -608,18 +562,21 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.d/xz
%files manual
%doc LICENSE NOTICE
%license LICENSE NOTICE
%doc manual/*
%if %with javadoc
%files javadoc
%doc LICENSE NOTICE
%license LICENSE NOTICE
%{_javadocdir}/%{name}
%endif
# -----------------------------------------------------------------------------
%changelog
* Tue Mar 21 2017 Michael Simacek <msimacek@redhat.com> - 0:1.10.1-5
- Install with XMvn
* Wed Mar 1 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.10.1-4
- Fix hardcoded paths in ant script and conf
- Fix requires on xz-java