2007-01-16 00:11:02 +01:00
|
|
|
#
|
2011-06-01 09:32:44 +02:00
|
|
|
# spec file for package ebtables
|
2007-01-16 00:11:02 +01:00
|
|
|
#
|
2021-11-05 11:54:24 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2007-01-16 00:11:02 +01:00
|
|
|
#
|
2008-09-01 02:30:46 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-03-02 08:29:23 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:11:02 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-11-05 11:54:24 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
2017-11-24 17:53:08 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
2021-11-11 09:38:17 +01:00
|
|
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
2017-11-24 17:53:08 +01:00
|
|
|
%endif
|
2007-08-09 18:41:37 +02:00
|
|
|
Name: ebtables
|
2019-12-05 12:18:03 +01:00
|
|
|
Version: 2.0.11
|
2012-07-20 01:24:30 +02:00
|
|
|
Release: 0
|
2007-08-09 18:41:37 +02:00
|
|
|
Summary: Ethernet Bridge Tables
|
2018-09-01 15:12:51 +02:00
|
|
|
License: GPL-2.0-or-later
|
2011-06-06 13:54:04 +02:00
|
|
|
Group: Productivity/Networking/Security
|
2019-12-05 12:18:03 +01:00
|
|
|
URL: http://ebtables.sf.net/
|
2014-05-30 14:20:47 +02:00
|
|
|
#Git-Clone: git://git.netfilter.org/ebtables
|
2021-11-11 09:38:17 +01:00
|
|
|
Source0: http://ftp.netfilter.org/pub/ebtables/ebtables-%{version}.tar.gz
|
|
|
|
Source1: http://ftp.netfilter.org/pub/ebtables/ebtables-%{version}.tar.gz.sig
|
2019-12-12 10:24:07 +01:00
|
|
|
Source2: ebtables.keyring
|
2019-12-05 12:18:03 +01:00
|
|
|
Source3: ebtables.service
|
|
|
|
Source4: ebtables.systemd
|
2014-09-23 17:29:08 +02:00
|
|
|
BuildRequires: linux-glibc-devel >= 2.6.20
|
2014-03-19 10:14:03 +01:00
|
|
|
BuildRequires: sed
|
2016-06-02 17:28:01 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2017-03-30 21:17:04 +02:00
|
|
|
BuildRequires: xz
|
2018-02-22 20:00:56 +01:00
|
|
|
Requires: netcfg >= 11.6
|
2016-06-02 17:28:01 +02:00
|
|
|
Requires(pre): %fillup_prereq
|
2021-11-11 09:38:17 +01:00
|
|
|
%{?systemd_ordering}
|
2021-11-05 11:54:24 +01:00
|
|
|
%if %{with libalternatives}
|
2021-11-11 09:38:17 +01:00
|
|
|
BuildRequires: alts
|
2021-11-05 11:54:24 +01:00
|
|
|
Requires: alts
|
|
|
|
%else
|
2018-09-01 15:12:51 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-11-11 09:38:17 +01:00
|
|
|
Requires(postun):update-alternatives
|
2021-11-05 11:54:24 +01:00
|
|
|
%endif
|
2007-01-16 00:11:02 +01:00
|
|
|
|
|
|
|
%description
|
2007-08-09 18:41:37 +02:00
|
|
|
A firewalling tool to transparently filter network traffic passing a
|
2007-01-16 00:11:02 +01:00
|
|
|
bridge. The filtering possibilities are limited to link layer filtering
|
|
|
|
and some basic filtering on higher network layers. The ebtables tool
|
|
|
|
can be used together with the other Linux filtering tools, like
|
|
|
|
iptables. There are no incompatibility issues.
|
|
|
|
|
2019-12-05 12:18:03 +01:00
|
|
|
%package -n libebtc0
|
|
|
|
Summary: Library for the ebtables low-level ruleset generation and parsing
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libebtc0
|
|
|
|
libebtc ("ebtables cache") is used to retrieve from the kernel, parse,
|
|
|
|
construct, and load rulesets into the kernel.
|
|
|
|
|
2007-01-16 00:11:02 +01:00
|
|
|
%prep
|
2019-12-05 12:18:03 +01:00
|
|
|
%autosetup -p1
|
|
|
|
|
2010-01-12 15:48:48 +01:00
|
|
|
# delete all kernel headers, but keep ebt_ip6.h and ebt_nflog.h
|
|
|
|
mv include/linux/netfilter_bridge/ebt_ip6.{h,h.save}
|
|
|
|
mv include/linux/netfilter_bridge/ebt_nflog.{h,h.save}
|
2014-11-20 13:58:51 +01:00
|
|
|
mv include/linux/netfilter_bridge/ebt_ulog.{h,h.save}
|
2010-01-12 15:48:48 +01:00
|
|
|
rm -f include/linux/*.h
|
|
|
|
rm -f include/linux/netfilter_bridge/*.h
|
|
|
|
mv include/linux/netfilter_bridge/ebt_ip6.{h.save,h}
|
|
|
|
mv include/linux/netfilter_bridge/ebt_nflog.{h.save,h}
|
2014-11-20 13:58:51 +01:00
|
|
|
mv include/linux/netfilter_bridge/ebt_ulog.{h.save,h}
|
2015-08-31 09:54:43 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
# The way ebtables is built requires ASNEEDED=0 forever [bnc#567267]
|
|
|
|
export SUSE_ASNEEDED=0
|
2019-12-05 12:18:03 +01:00
|
|
|
%configure
|
2021-11-11 09:38:17 +01:00
|
|
|
%make_build
|
2007-01-16 00:11:02 +01:00
|
|
|
|
|
|
|
%install
|
2010-01-27 18:48:02 +01:00
|
|
|
# The way ebtables is built requires ASNEEDED=0 forever [bnc#567267]
|
|
|
|
export SUSE_ASNEEDED=0
|
2016-05-06 10:56:44 +02:00
|
|
|
mkdir -p "%{buildroot}/%{_sysconfdir}/init.d"
|
2019-12-05 12:18:03 +01:00
|
|
|
%make_install
|
2017-11-24 17:53:08 +01:00
|
|
|
mkdir -p %{buildroot}%{_fillupdir}
|
2016-06-02 17:28:01 +02:00
|
|
|
mkdir -p %{buildroot}%{_unitdir}
|
2021-11-11 09:38:17 +01:00
|
|
|
install -p %{_sourcedir}/ebtables.service %{buildroot}%{_unitdir}/
|
2020-09-02 17:26:54 +02:00
|
|
|
sed -i "s|@LIBEXECDIR@|%{_libexecdir}|g" %{buildroot}%{_unitdir}/*.service
|
2016-06-02 17:28:01 +02:00
|
|
|
chmod -x %{buildroot}%{_unitdir}/*.service
|
|
|
|
mkdir -p %{buildroot}%{_libexecdir}
|
2021-11-11 09:38:17 +01:00
|
|
|
install -m0755 %{_sourcedir}/ebtables.systemd %{buildroot}%{_libexecdir}/%{name}-helper
|
2017-03-30 21:17:04 +02:00
|
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
2017-11-24 17:53:08 +01:00
|
|
|
touch %{buildroot}%{_fillupdir}/sysconfig.%{name}.filter
|
|
|
|
touch %{buildroot}%{_fillupdir}/sysconfig.%{name}.nat
|
|
|
|
touch %{buildroot}%{_fillupdir}/sysconfig.%{name}.broute
|
2021-11-11 09:38:17 +01:00
|
|
|
rm -rfv %{buildroot}%{_initddir}
|
2011-05-31 14:57:59 +02:00
|
|
|
# not used
|
2016-05-06 10:56:44 +02:00
|
|
|
rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config"
|
2018-09-07 14:56:57 +02:00
|
|
|
for i in ebtables ebtables-restore ebtables-save; do
|
2021-11-11 09:38:17 +01:00
|
|
|
%if ! %{with libalternatives}
|
|
|
|
ln -fsv "%{_sysconfdir}/alternatives/$i" "%{buildroot}/%{_sbindir}/$i"
|
2021-11-05 11:54:24 +01:00
|
|
|
%else
|
2021-11-11 09:38:17 +01:00
|
|
|
ln -fsv %{_bindir}/alts "%{buildroot}/%{_sbindir}/$i"
|
|
|
|
%endif
|
2018-09-07 14:56:57 +02:00
|
|
|
done
|
2021-11-11 09:38:17 +01:00
|
|
|
echo ".so ebtables-legacy.8" >"%{buildroot}/%{_mandir}/man8/ebtables.8"
|
2019-12-05 12:18:03 +01:00
|
|
|
# no headers to make use of it
|
2021-11-11 09:38:17 +01:00
|
|
|
rm -f "%{buildroot}/%{_libdir}/libebtc.la" "%{buildroot}/%{_libdir}/libebtc.so"
|
2007-10-13 00:07:43 +02:00
|
|
|
|
2021-11-05 11:54:24 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/ebtables/1.conf <<EOF
|
|
|
|
binary=%{_sbindir}/ebtables-legacy
|
|
|
|
group=ebtables, ebtables-restore, ebtables-save
|
|
|
|
EOF
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables-restore
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/ebtables-restore/1.conf <<EOF
|
|
|
|
binary=%{_sbindir}/ebtables-legacy-restore
|
|
|
|
group=ebtables, ebtables-restore, ebtables-save
|
|
|
|
EOF
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables-save
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/ebtables-save/1.conf <<EOF
|
|
|
|
binary=%{_sbindir}/ebtables-legacy-save
|
|
|
|
group=ebtables, ebtables-restore, ebtables-save
|
|
|
|
EOF
|
|
|
|
%endif
|
|
|
|
|
2016-06-02 17:28:01 +02:00
|
|
|
%pre
|
2021-11-05 11:54:24 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
# removing old update-alternatives entries
|
|
|
|
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
|
|
|
update-alternatives --remove ebtables "%{_sbindir}/ebtables-legacy"
|
|
|
|
fi
|
|
|
|
%endif
|
2016-06-02 17:28:01 +02:00
|
|
|
%service_add_pre %{name}.service
|
|
|
|
|
2010-01-12 15:48:48 +01:00
|
|
|
%post
|
2021-11-05 11:54:24 +01:00
|
|
|
%if ! %{with libalternatives}
|
2018-09-01 15:12:51 +02:00
|
|
|
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"
|
2021-11-05 11:54:24 +01:00
|
|
|
%endif
|
2016-06-02 17:28:01 +02:00
|
|
|
%service_add_post %{name}.service
|
|
|
|
%fillup_only
|
2010-01-12 15:48:48 +01:00
|
|
|
|
2007-10-13 00:07:43 +02:00
|
|
|
%preun
|
2016-06-02 17:28:01 +02:00
|
|
|
%service_del_preun %{name}.service
|
2007-10-13 00:07:43 +02:00
|
|
|
|
|
|
|
%postun
|
2021-11-05 11:54:24 +01:00
|
|
|
%if ! %{with libalternatives}
|
2018-09-01 15:13:17 +02:00
|
|
|
if test "$1" = 0; then
|
|
|
|
update-alternatives --remove ebtables "%{_sbindir}/ebtables-legacy"
|
|
|
|
fi
|
2021-11-05 11:54:24 +01:00
|
|
|
%endif
|
2016-06-02 17:28:01 +02:00
|
|
|
%service_del_postun %{name}.service
|
2007-01-16 00:11:02 +01:00
|
|
|
|
2019-12-05 12:18:03 +01:00
|
|
|
%post -n libebtc0 -p /sbin/ldconfig
|
|
|
|
%postun -n libebtc0 -p /sbin/ldconfig
|
|
|
|
|
2007-01-16 00:11:02 +01:00
|
|
|
%files
|
2020-09-02 17:26:54 +02:00
|
|
|
%license COPYING
|
|
|
|
%doc ChangeLog
|
2021-11-11 09:38:17 +01:00
|
|
|
%{_mandir}/man8/ebtables*.8%{?ext_man}
|
2020-01-15 10:23:27 +01:00
|
|
|
%{_libexecdir}/%{name}-helper
|
2016-06-02 17:28:01 +02:00
|
|
|
%{_unitdir}/%{name}.service
|
2021-11-05 11:54:24 +01:00
|
|
|
%if ! %{with libalternatives}
|
2018-09-05 17:01:56 +02:00
|
|
|
%ghost %{_sysconfdir}/alternatives/ebtables
|
|
|
|
%ghost %{_sysconfdir}/alternatives/ebtables-restore
|
|
|
|
%ghost %{_sysconfdir}/alternatives/ebtables-save
|
2021-11-05 11:54:24 +01:00
|
|
|
%else
|
|
|
|
%dir %{_datadir}/libalternatives
|
|
|
|
%dir %{_datadir}/libalternatives/ebtables
|
|
|
|
%dir %{_datadir}/libalternatives/ebtables-restore
|
|
|
|
%dir %{_datadir}/libalternatives/ebtables-save
|
|
|
|
%{_datadir}/libalternatives/ebtables/1.conf
|
|
|
|
%{_datadir}/libalternatives/ebtables-restore/1.conf
|
|
|
|
%{_datadir}/libalternatives/ebtables-save/1.conf
|
|
|
|
%endif
|
2017-11-24 17:53:08 +01:00
|
|
|
%ghost %{_fillupdir}/sysconfig.%{name}.filter
|
|
|
|
%ghost %{_fillupdir}/sysconfig.%{name}.nat
|
|
|
|
%ghost %{_fillupdir}/sysconfig.%{name}.broute
|
2018-02-22 20:00:56 +01:00
|
|
|
# is provided by the netcfg package
|
2018-03-16 16:10:08 +01:00
|
|
|
%exclude %{_sysconfdir}/ethertypes
|
2018-09-07 13:41:38 +02:00
|
|
|
%{_sbindir}/ebtables*
|
2016-05-06 10:56:44 +02:00
|
|
|
%{_sbindir}/rcebtables
|
2008-09-01 02:30:46 +02:00
|
|
|
|
2019-12-05 12:18:03 +01:00
|
|
|
%files -n libebtc0
|
2021-11-11 09:38:17 +01:00
|
|
|
%{_libdir}/libebtc.so.0*
|
2019-12-05 12:18:03 +01:00
|
|
|
|
2007-08-09 18:41:37 +02:00
|
|
|
%changelog
|