Expand conditionals

This commit is contained in:
Mikolaj Izdebski 2018-11-29 12:42:46 +00:00
parent 16e292d076
commit 8d8f44adbb

View File

@ -28,11 +28,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%bcond_without tests
%bcond_without javadoc
# Disabled for now, asi it doesn't work (tests fail) and nobody needs it
%bcond_with junit5
%global ant_home %{_datadir}/ant
@ -76,9 +73,6 @@ BuildRequires: mvn(xml-resolver:xml-resolver)
BuildRequires: mvn(org.hamcrest:hamcrest-core)
BuildRequires: mvn(org.hamcrest:hamcrest-library)
%if %{with junit5}
BuildRequires: junit5
%endif
# Theoretically Ant might be usable with just JRE, but typical Ant
# workflow requires full JDK, so we recommend it here.
@ -189,17 +183,6 @@ Optional commons net tasks for %{name}.
Taches commons net optionelles pour %{name}.
# Disable because we don't ship the dependencies
%if 0
%package jai
Summary: Optional jai tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description jai
Optional jai tasks for %{name}.
%description jai -l fr
Taches jai optionelles pour %{name}.
%endif
%package apache-bcel
Summary: Optional apache bcel tasks for %{name}
@ -291,17 +274,6 @@ Optional junit tasks for %{name}.
%description junit -l fr
Taches junit optionelles pour %{name}.
%if %{with junit5}
%package junit5
Summary: Optional junit5 tasks for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description junit5
Optional junit5 tasks for %{name}.
%description junit5 -l fr
Taches junit5 optionelles pour %{name}.
%endif
%package testutil
Summary: Test utility classes for %{name}
@ -358,9 +330,6 @@ rm src/tests/junit/org/apache/tools/ant/types/selectors/SignedSelectorTest.java
#install jars
build-jar-repository -s -p lib/optional antlr bcel javamail/mailapi jdepend junit log4j-1 oro regexp bsf commons-logging commons-net jsch xalan-j2 xml-commons-resolver xalan-j2-serializer hamcrest/core hamcrest/library xz-java
%if %{with junit5}
build-jar-repository -s -p lib/optional junit5 opentest4j
%endif
# fix hardcoded paths in ant script and conf
cp -p %{SOURCE2} %{name}.conf
@ -383,16 +352,12 @@ mv LICENSE.utf8 LICENSE
# We want a hard dep on antlr
%pom_xpath_remove pom:optional src/etc/poms/ant-antlr/pom.xml
%if %{without junit5}
%pom_xpath_inject 'target[@name="javadocs"]/javadoc/packageset' '<exclude name="**/junitlauncher"/>' build.xml
%endif
%build
%{ant} jars test-jar
%if %with javadoc
%{ant} javadocs
%endif
# typeset the manpage
mkdir man
@ -401,9 +366,7 @@ xmlto man man/%{name}.xml -o man
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -fr build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%if %{without junit5}
rm -f build/lib/ant-junitlauncher.jar
%endif
# -----------------------------------------------------------------------------
%install
@ -486,15 +449,10 @@ echo "junit hamcrest/core ant/ant-junit4" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name
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
%if %{with junit5}
echo "junit5 hamcrest/core junit opentest4j ant/ant-junitlauncher" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junitlauncher
%endif
%if %with javadoc
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%endif
# fix link between manual and javadoc
(cd manual; ln -sf %{_javadocdir}/%{name} api)
@ -503,10 +461,8 @@ 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 %with tests
%check
LC_ALL=en_US.utf8 %{ant} test
%endif
%files
%doc KEYS README WHATSNEW
@ -564,11 +520,6 @@ LC_ALL=en_US.utf8 %{ant} test
%config(noreplace) %{_sysconfdir}/%{name}.d/commons-net
# Disable as we dont ship the dependencies
%if 0
%files jai -f .mfiles-jai
%{ant_home}/lib/%{name}-jai.jar
%config(noreplace) %{_sysconfdir}/%{name}.d/jai
%endif
%files apache-bcel -f .mfiles-apache-bcel
%{ant_home}/lib/%{name}-apache-bcel.jar
@ -616,11 +567,6 @@ LC_ALL=en_US.utf8 %{ant} test
%{ant_home}/etc/junit-frames-saxon.xsl
%{ant_home}/etc/junit-noframes-saxon.xsl
%if %{with junit5}
%files junit5 -f .mfiles-junitlauncher
%{ant_home}/lib/%{name}-junitlauncher.jar
%config(noreplace) %{_sysconfdir}/%{name}.d/junitlauncher
%endif
%files testutil -f .mfiles-testutil
%{ant_home}/lib/%{name}-testutil.jar
@ -634,11 +580,9 @@ LC_ALL=en_US.utf8 %{ant} test
%license LICENSE NOTICE
%doc manual/*
%if %with javadoc
%files javadoc
%license LICENSE NOTICE
%{_javadocdir}/%{name}
%endif
# -----------------------------------------------------------------------------