From 4e340245f36795eab2a5f76f8a6dd2683180ac25 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 29 Jul 2022 09:08:52 +0200 Subject: [PATCH] Implement ant_minimal bcond --- .ant.metadata | 1 + ant.spec | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .ant.metadata diff --git a/.ant.metadata b/.ant.metadata new file mode 100644 index 0000000..4f43e0c --- /dev/null +++ b/.ant.metadata @@ -0,0 +1 @@ +17df28925d8abfecfbfa99a8bac1e1328e9ac5c5 apache-ant-1.10.12-src.tar.bz2 diff --git a/ant.spec b/ant.spec index 7eb0f70..8ca2c11 100644 --- a/ant.spec +++ b/ant.spec @@ -30,6 +30,12 @@ %bcond_with bootstrap +%if %{without bootstrap} +%bcond_with ant_minimal +%else +%bcond_without ant_minimal +%endif + %global ant_home %{_datadir}/ant Name: ant @@ -61,7 +67,9 @@ BuildRequires: javapackages-local BuildRequires: java-devel >= 1:1.8.0 BuildRequires: ant >= 1.10.2 BuildRequires: ant-junit +%endif +%if %{without ant_minimal} BuildRequires: mvn(antlr:antlr) BuildRequires: mvn(bcel:bcel) BuildRequires: mvn(bsf:bsf) @@ -128,7 +136,7 @@ Optional junit tasks for %{name}. %description junit -l fr Taches junit optionelles pour %{name}. -%if %{without bootstrap} +%if %{without ant_minimal} %package jmf Summary: Optional jmf tasks for %{name} @@ -354,8 +362,12 @@ rm src/main/org/apache/tools/ant/listener/Log4jListener.java %if %{with bootstrap} build-jar-repository -s -p lib/optional javapackages-bootstrap/junit javapackages-bootstrap/hamcrest-core %else +%if %{with ant_minimal} +build-jar-repository -s -p lib/optional junit hamcrest/core hamcrest/library +%else build-jar-repository -s -p lib/optional antlr bcel javamail/mailapi jdepend junit 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 +%endif # fix hardcoded paths in ant script and conf cp -p %{SOURCE2} %{name}.conf @@ -382,7 +394,7 @@ mv LICENSE.utf8 LICENSE %pom_change_dep -r com.sun.mail:jakarta.mail javax.mail:mail src/etc/poms/ant-javamail/pom.xml %build -%if %{with bootstrap} +%if %{with ant_minimal} %{ant} jars %else %{ant} jars test-jar javadocs @@ -408,7 +420,7 @@ mkdir -p $RPM_BUILD_ROOT%{ant_home}/{lib,etc,bin} %mvn_file ':{ant,ant-bootstrap,ant-launcher}' %{name}/@1 @1 -%if %{with bootstrap} +%if %{with ant_minimal} mv build/lib build/lib0 mkdir build/lib/ mv build/lib0/ant.jar build/lib/ @@ -454,7 +466,7 @@ rm -f src/script/*.bat rm -f src/script/*.cmd # XSLs -%if %{with bootstrap} +%if %{with ant_minimal} rm src/etc/jdepend-frames.xsl rm src/etc/jdepend.xsl rm src/etc/maudit-frames.xsl @@ -476,7 +488,7 @@ 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} +%if %{without ant_minimal} echo "ant/ant-jmf" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jmf echo "ant/ant-swing" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/swing @@ -510,7 +522,7 @@ cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} install -d -m 755 %{buildroot}%{_mandir}/man1/ install -p -m 644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 -%if %{without bootstrap} +%if %{without ant_minimal} %check LC_ALL=C.UTF-8 %{ant} test %endif @@ -553,7 +565,7 @@ LC_ALL=C.UTF-8 %{ant} test %{ant_home}/etc/junit-frames-saxon.xsl %{ant_home}/etc/junit-noframes-saxon.xsl -%if %{without bootstrap} +%if %{without ant_minimal} %files jmf -f .mfiles-jmf %{ant_home}/lib/%{name}-jmf.jar