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