Accepting request 631770 from home:jengelh:branches:security:netfilter

- Move ebtables to ebtables-legacy and use update-alternatives to
  offer a selection mechanism.

OBS-URL: https://build.opensuse.org/request/show/631770
OBS-URL: https://build.opensuse.org/package/show/security:netfilter/ebtables?expand=0&rev=51
This commit is contained in:
Jan Engelhardt 2018-09-01 13:12:51 +00:00 committed by Git OBS Bridge
parent 0d0fc20bd3
commit a5722ab5b9
2 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Aug 24 10:20:05 UTC 2018 - jengelh@inai.de
- Move ebtables to ebtables-legacy and use update-alternatives to
offer a selection mechanism.
-------------------------------------------------------------------
Thu Mar 15 13:30:35 UTC 2018 - kstreitova@suse.com

View File

@ -25,7 +25,7 @@ Name: ebtables
Version: 2.0.10.4
Release: 0
Summary: Ethernet Bridge Tables
License: GPL-2.0+
License: GPL-2.0-or-later
Group: Productivity/Networking/Security
Url: http://ebtables.sf.net/
#Git-Clone: git://git.netfilter.org/ebtables
@ -47,6 +47,8 @@ BuildRequires: xz
Requires: netcfg >= 11.6
Requires(pre): %fillup_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): update-alternatives
Requires(postun): update-alternatives
%{?systemd_requires}
%description
@ -111,11 +113,21 @@ touch %{buildroot}%{_fillupdir}/sysconfig.%{name}.broute
rm -rf %{buildroot}%{_initrddir}
# not used
rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config"
mv "%{buildroot}/%{_sbindir}/ebtables" "%{buildroot}/%{_sbindir}/ebtables-legacy"
mv "%{buildroot}/%{_sbindir}/ebtables-restore" "%{buildroot}/%{_sbindir}/ebtables-legacy-restore"
mv "%{buildroot}/%{_sbindir}/ebtables-save" "%{buildroot}/%{_sbindir}/ebtables-legacy-save"
ln -s ebtables-legacy "%{buildroot}/%{_sbindir}/ebtables"
ln -s ebtables-legacy-restore "%{buildroot}/%{_sbindir}/ebtables-restore"
ln -s ebtables-legacy-save "%{buildroot}/%{_sbindir}/ebtables-save"
%pre
%service_add_pre %{name}.service
%post
update-alternatives --force \
--install "%{_sbindir}/ebtables" ebtables "%{_sbindir}/ebtables-legacy" 1 \
--slave "%{_sbindir}/ebtables-restore" ebtables-restore "%{_sbindir}/ebtables-legacy-restore" \
--slave "%{_sbindir}/ebtables-save" ebtables-save "%{_sbindir}/ebtables-legacy-save"
%service_add_post %{name}.service
%fillup_only
@ -123,6 +135,7 @@ rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config"
%service_del_preun %{name}.service
%postun
update-alternatives --remove ebtables "%{_sbindir}/ebtables-legacy"
%service_del_postun %{name}.service
%files
@ -131,6 +144,7 @@ rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config"
%{_mandir}/man8/ebtables.8*
%{_libexecdir}/%{name}
%{_unitdir}/%{name}.service
%ghost %{_sysconfdir}/alternatives/ebtables*
%ghost %{_fillupdir}/sysconfig.%{name}.filter
%ghost %{_fillupdir}/sysconfig.%{name}.nat
%ghost %{_fillupdir}/sysconfig.%{name}.broute
@ -138,9 +152,10 @@ rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config"
%exclude %{_sysconfdir}/ethertypes
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so
%{_sbindir}/ebtables
%{_sbindir}/ebtables-restore
%{_sbindir}/ebtables-save
%ghost %{_sbindir}/ebtables
%ghost %{_sbindir}/ebtables-restore
%ghost %{_sbindir}/ebtables-save
%{_sbindir}/ebtables-legacy*
%{_sbindir}/rcebtables
%changelog