From c9ae62152d18942a8131bc5d3915448764f80e87 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: May 14 2021 12:54:53 +0000 Subject: Implement bootstrap mode --- diff --git a/ant.spec b/ant.spec index 6c501ee..852eb52 100644 --- a/ant.spec +++ b/ant.spec @@ -28,6 +28,8 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +%bcond_with bootstrap + %global ant_home %{_datadir}/ant Name: ant @@ -43,14 +45,17 @@ Source2: apache-ant-1.8.ant.conf # manpage Source3: ant.asciidoc +BuildRequires: asciidoc +BuildRequires: xmlto + BuildRequires: javapackages-local +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: java-devel >= 1:1.8.0 BuildRequires: ant >= 1.10.2 BuildRequires: ant-junit -BuildRequires: asciidoc -BuildRequires: xmlto - BuildRequires: mvn(antlr:antlr) BuildRequires: mvn(bcel:bcel) BuildRequires: mvn(bsf:bsf) @@ -70,6 +75,7 @@ BuildRequires: mvn(org.hamcrest:hamcrest-core) BuildRequires: mvn(org.hamcrest:hamcrest-library) BuildRequires: junit5 +%endif # Theoretically Ant might be usable with just JRE, but typical Ant # workflow requires full JDK, so we recommend it here. @@ -109,6 +115,18 @@ Summary: Core part of %{name} %description lib Core part of Apache Ant that can be used as a library. +%package junit +Summary: Optional junit tasks for %{name} +Requires: %{name} = %{version}-%{release} + +%description junit +Optional junit tasks for %{name}. + +%description junit -l fr +Taches junit optionelles pour %{name}. + +%if %{without bootstrap} + %package jmf Summary: Optional jmf tasks for %{name} Requires: %{name} = %{version}-%{release} @@ -266,16 +284,6 @@ Optional jsch tasks for %{name}. %description jsch -l fr Taches jsch optionelles pour %{name}. -%package junit -Summary: Optional junit tasks for %{name} -Requires: %{name} = %{version}-%{release} - -%description junit -Optional junit tasks for %{name}. - -%description junit -l fr -Taches junit optionelles pour %{name}. - %package junit5 Summary: Optional junit5 tasks for %{name} Requires: %{name} = %{version}-%{release} @@ -321,6 +329,8 @@ Javadoc for %{name}. %description javadoc -l fr Javadoc pour %{name}. +%endif + # ----------------------------------------------------------------------------- %prep @@ -340,7 +350,11 @@ rm src/tests/junit/org/apache/tools/ant/types/selectors/SignedSelectorTest.java src/tests/junit/org/apache/tools/mail/MailMessageTest.java #install jars +%if %{with bootstrap} +build-jar-repository -s -p lib/optional javapackages-bootstrap/junit javapackages-bootstrap/hamcrest-core +%else build-jar-repository -s -p lib/optional antlr bcel javamail/mailapi jdepend junit log4j/log4j-1.2-api oro regexp bsf commons-logging commons-net jsch xalan-j2 xml-commons-resolver xalan-j2-serializer hamcrest/core hamcrest/library xz-java junit5 opentest4j +%endif # fix hardcoded paths in ant script and conf cp -p %{SOURCE2} %{name}.conf @@ -370,7 +384,11 @@ mv LICENSE.utf8 LICENSE %pom_change_dep log4j:log4j org.apache.logging.log4j:log4j-1.2-api:2.13.3 src/etc/poms/ant-apache-log4j/pom.xml %build +%if %{with bootstrap} +%{ant} jars +%else %{ant} jars test-jar javadocs +%endif # typeset the manpage mkdir man @@ -390,6 +408,16 @@ mkdir -p $RPM_BUILD_ROOT%{ant_home}/{lib,etc,bin} %mvn_file ':{ant,ant-bootstrap,ant-launcher}' %{name}/@1 @1 +%if %{with bootstrap} +mv build/lib build/lib0 +mkdir build/lib/ +mv build/lib0/ant.jar build/lib/ +mv build/lib0/ant-bootstrap.jar build/lib/ +mv build/lib0/ant-launcher.jar build/lib/ +mv build/lib0/ant-junit.jar build/lib/ +mv build/lib0/ant-junit4.jar build/lib/ +%endif + for jar in build/lib/*.jar do # Make sure that installed JARs are not empty @@ -426,6 +454,11 @@ rm -f src/script/*.bat rm -f src/script/*.cmd # XSLs +%if %{with bootstrap} +rm src/etc/jdepend-frames.xsl +rm src/etc/jdepend.xsl +rm src/etc/maudit-frames.xsl +%endif cp -p src/etc/*.xsl $RPM_BUILD_ROOT%{ant_home}/etc # install everything else @@ -440,6 +473,11 @@ cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf # OPT_JAR_LIST fragments mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d +echo "junit hamcrest/core ant/ant-junit" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junit +echo "junit hamcrest/core ant/ant-junit4" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junit4 + +%if %{without bootstrap} + echo "ant/ant-jmf" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jmf echo "ant/ant-swing" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/swing echo "antlr ant/ant-antlr" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/antlr @@ -456,8 +494,6 @@ echo "ant/ant-imageio" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/imageio echo "javamail jaf ant/ant-javamail" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/javamail echo "jdepend ant/ant-jdepend" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jdepend echo "jsch ant/ant-jsch" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jsch -echo "junit hamcrest/core ant/ant-junit" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junit -echo "junit hamcrest/core ant/ant-junit4" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junit4 echo "junit5 hamcrest/core junit opentest4j ant/ant-junitlauncher" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junitlauncher echo "testutil ant/ant-testutil" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/testutil echo "xz-java ant/ant-xz" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/xz @@ -469,12 +505,16 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} # fix link between manual and javadoc (cd manual; ln -sf %{_javadocdir}/%{name} api) +%endif + # manpage install -d -m 755 %{buildroot}%{_mandir}/man1/ install -p -m 644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 +%if %{without bootstrap} %check LC_ALL=C.UTF-8 %{ant} test +%endif %files %doc KEYS README WHATSNEW @@ -503,6 +543,19 @@ LC_ALL=C.UTF-8 %{ant} test %{ant_home}/lib/%{name}-launcher.jar %{ant_home}/lib/%{name}-bootstrap.jar +%files junit -f .mfiles-junit +%{ant_home}/lib/%{name}-junit.jar +%{ant_home}/lib/%{name}-junit4.jar +%config(noreplace) %{_sysconfdir}/%{name}.d/junit +%config(noreplace) %{_sysconfdir}/%{name}.d/junit4 +%{ant_home}/etc/junit-frames.xsl +%{ant_home}/etc/junit-noframes.xsl +%{ant_home}/etc/junit-frames-xalan1.xsl +%{ant_home}/etc/junit-frames-saxon.xsl +%{ant_home}/etc/junit-noframes-saxon.xsl + +%if %{without bootstrap} + %files jmf -f .mfiles-jmf %{ant_home}/lib/%{name}-jmf.jar %config(noreplace) %{_sysconfdir}/%{name}.d/jmf @@ -570,17 +623,6 @@ LC_ALL=C.UTF-8 %{ant} test %{ant_home}/lib/%{name}-jsch.jar %config(noreplace) %{_sysconfdir}/%{name}.d/jsch -%files junit -f .mfiles-junit -%{ant_home}/lib/%{name}-junit.jar -%{ant_home}/lib/%{name}-junit4.jar -%config(noreplace) %{_sysconfdir}/%{name}.d/junit -%config(noreplace) %{_sysconfdir}/%{name}.d/junit4 -%{ant_home}/etc/junit-frames.xsl -%{ant_home}/etc/junit-noframes.xsl -%{ant_home}/etc/junit-frames-xalan1.xsl -%{ant_home}/etc/junit-frames-saxon.xsl -%{ant_home}/etc/junit-noframes-saxon.xsl - %files junit5 -f .mfiles-junitlauncher %{ant_home}/lib/%{name}-junitlauncher.jar %config(noreplace) %{_sysconfdir}/%{name}.d/junitlauncher @@ -601,6 +643,8 @@ LC_ALL=C.UTF-8 %{ant} test %license LICENSE NOTICE %{_javadocdir}/%{name} +%endif + # ----------------------------------------------------------------------------- %changelog