Generally, the amount of magic that has to be implemented in spec to have the
alternatives makes me sad. As openSUSE distributions implements a lot of
alternatives, in every aspect of the system, this makes a lot of specs just
look awfully busy for no reason. This could also be beneficial from the
scriplets standpoint.
This is typically what goes into adding alternatives:
```sh
Requires(post): update-alternatives
Requires(postun): update-alternatives
%install
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/%{name} %{buildroot}%{link}
%post
update-alternatives --install %{link} %{name} %{path} %{priority}
%postun
if [ ! -f %{path} ] ; then
update-alternatives --remove %{name} %{path}
fi
%files
%ghost %{_sysconfdir}/alternatives/%{name}
```
Which could be abbreviated with correct implementation into:
```sh
%files
%alternatives %{link} %{name} %{path} %{priority}
```
Which as it turns out, is way more readable ;)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/993#issuecomment-578650603
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint