Implement Ivy build conditional

This commit is contained in:
Mikolaj Izdebski 2021-06-05 10:52:22 +02:00
parent 42d151c2f2
commit b88118db6b

View File

@ -1,5 +1,11 @@
%bcond_with bootstrap
%if 0%{?fedora}
%bcond_without ivy
%else
%bcond_with ivy
%endif
# Don't generate requires on jpackage-utils and java-headless for
# provided pseudo-artifacts: com.sun:tools and sun.jdk:jconsole.
%global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}/maven-metadata/javapackages-metadata.xml$
@ -77,6 +83,7 @@ Requires: mvn(org.apache.maven.plugins:maven-surefire-plugin)
%description -n maven-local
This package provides macros and scripts to support packaging Maven artifacts.
%if %{with ivy}
%package -n ivy-local
Summary: Local mode for Apache Ivy
Requires: %{name} = %{version}-%{release}
@ -87,6 +94,7 @@ Requires: xmvn-connector-ivy
%description -n ivy-local
This package implements local mode for Apache Ivy, which allows
artifact resolution using XMvn resolver.
%endif
%package -n %{python_prefix}-javapackages
Summary: Module for handling various files for Java packaging
@ -149,6 +157,10 @@ sed -e 's/.[17]$/&*/' -i files-*
rm -rf %{buildroot}%{_bindir}/gradle-local
rm -rf %{buildroot}%{_datadir}/gradle-local
rm -rf %{buildroot}%{_mandir}/man7/gradle_build.7
%if %{without ivy}
rm -rf %{buildroot}%{_sysconfdir}/ivy
rm -rf %{buildroot}%{_sysconfdir}/ant.d
%endif
mkdir -p %{buildroot}%{_datadir}/xmvn/conf/
cp -p %{SOURCE2} %{buildroot}%{_datadir}/xmvn/conf/toolchains.xml
@ -170,7 +182,9 @@ install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/java/javapackages-config
%files -n maven-local
%if %{with ivy}
%files -n ivy-local -f files-ivy
%endif
%files -n maven-local-openjdk8
%{_datadir}/xmvn/conf