diff --git a/maven.changes b/maven.changes index 7206eaf..9f72b46 100644 --- a/maven.changes +++ b/maven.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Sep 14 14:44:11 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue May 11 09:57:12 UTC 2021 - Fridrich Strba diff --git a/maven.spec b/maven.spec index 95582bc..ccee50b 100644 --- a/maven.spec +++ b/maven.spec @@ -19,6 +19,11 @@ %global bundled_slf4j_version 1.7.25 %global homedir %{_datadir}/%{name}%{?maven_version_suffix} %global confdir %{_sysconfdir}/%{name}%{?maven_version_suffix} +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %bcond_with logback Name: maven Version: 3.8.1 @@ -99,6 +104,12 @@ Requires(postun):aaa_base %if %{with logback} BuildRequires: mvn(ch.qos.logback:logback-classic) %endif +%if %{with libalternatives} +BuildRequires: alts +%else +Requires(post): update-alternatives +Requires(postun):update-alternatives +%endif %description Maven is a software project management and comprehension tool. Based on the @@ -357,9 +368,28 @@ ln -sf %{confdir}/settings.xml %{buildroot}%{homedir}/conf/settings.xml mv %{buildroot}%{homedir}/conf/logging %{buildroot}%{confdir}/ ln -sf %{confdir}/logging %{buildroot}%{homedir}/conf -# Ghosts for alternatives install -d -m 755 %{buildroot}%{_bindir}/ install -d -m 755 %{buildroot}%{_mandir}/man1/ + +%if %{with libalternatives} +ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/mvn +mkdir -p %{buildroot}%{_datadir}/libalternatives/mvn +cat > %{buildroot}%{_datadir}/libalternatives/mvn/%{?maven_alternatives_priority}1.conf < %{buildroot}%{_datadir}/libalternatives/mvnDebug/%{?maven_alternatives_priority}1.conf < 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + update-alternatives --remove mvn %{homedir}/bin/mvn +fi +%endif %files lib -f .mfiles %doc README.md @@ -385,11 +423,22 @@ fi %config(noreplace) %{confdir}/logging/simplelogger.properties %files +%{_datadir}/bash-completion +%if ! 0%{with libalternatives} %ghost %{_bindir}/mvn %ghost %{_bindir}/mvnDebug -%{_datadir}/bash-completion %ghost %{_mandir}/man1/mvn.1.gz %ghost %{_mandir}/man1/mvnDebug.1.gz +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/mvn +%dir %{_datadir}/libalternatives/mvnDebug +%{_datadir}/libalternatives/mvn/%{?maven_alternatives_priority}1.conf +%{_datadir}/libalternatives/mvnDebug/%{?maven_alternatives_priority}1.conf +%{_bindir}/mvn +%{_bindir}/mvnDebug +%{_mandir}/man1/mvn.1%{?ext_man} +%endif %files javadoc -f .mfiles-javadoc %license LICENSE NOTICE