diff --git a/juliaup.spec b/juliaup.spec index 2761e5f..233654d 100644 --- a/juliaup.spec +++ b/juliaup.spec @@ -130,22 +130,29 @@ cargo install --offline --release --no-default-features --no-track --root="%{bui %endif %if 0%{?rhel} > 7 || 0%{?fedora} -ln -sf %{_bindir}/julia %{buildroot}%{_bindir}/julialauncher +ln -sfv %{_bindir}/julia %{buildroot}%{_bindir}/julialauncher %endif %if 0%{?suse_version} mkdir -p %{buildroot}%{_sysconfdir}/alternatives -ln -sf %{_sysconfdir}/alternatives/julia %{buildroot}%{_bindir}/julia +ln -sfv %{_sysconfdir/alternatives/julia %{buildroot}%{_bindir}/julia +%endif + %post +%if 0%{?suse_version} "%_sbindir/update-alternatives" --install \ - "%{_bindir}/julia" julia "%{_bindir}/julialauncher" $(printf %{latest_julia_version} | sed 's/\.//g') + "%{_bindir}/julia" julia "%{_bindir}/julialauncher" $(echo %{latest_julia_version} | sed 's/\.//g') +%endif %pre +%if 0%{?suse_version} if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then "%{_sbindir}/update-alternatives" --remove julia "%{_bindir}/julialauncher"; fi; +%endif %postun +%if 0%{?suse_version} if [ ! -f %{_bindir}/julia ] ; then "%{_sbindir}/update-alternatives" --remove julia "%{_bindir}/julialauncher" fi @@ -162,4 +169,4 @@ fi %{_bindir}/juliaup %{_bindir}/julia -%changelog \ No newline at end of file +%changelog