ebtables/ebtables.spec
2019-09-30 10:37:43 -04:00

107 lines
3.8 KiB
RPMSpec

%global ebminor 4
Name: ebtables
Version: 2.0.10
Release: 30
Summary: A filtering tool for a Linux-based bridging firewall
License: GPLv2+
URL: http://ebtables.sourceforge.net/
Source0: http://downloads.sourceforge.net/ebtables/ebtables-v%{version}-%{ebminor}.tar.gz
Source1: ebtables-save
Source2: ebtables.systemd
Source3: ebtables.service
#patches from fedora/redhat repository
Patch0001: ebtables-2.0.10-norootinst.patch
Patch0002: ebtables-2.0.9-lsb.patch
Patch0003: ebtables-2.0.10-linkfix.patch
Patch0004: ebtables-2.0.0-audit.patch
Patch0005: 0001-add-RARP-and-update-iana-url.patch
Patch0006: ebtables-2.0.10-lockdirfix.patch
Patch0007: ebtables-2.0.10-noflush.patch
# patch0008 from https://patchwork.ozlabs.org
Patch0008: ebtables-use-flock-for-concurrent-option.patch
BuildRequires: systemd
Requires: systemd %{_sbindir}/update-alternatives
Conflicts: setup < 2.10.4-1
%description
The ebtables program is a filtering tool for a Linux-based bridging firewall.It enables transparent filtering of network traffic passing through a Linux bridge.The filtering possibilities are limited to link layer filtering and some basic filtering on higher network layers.
The ebtables tool can be combined with the other Linux filtering tools to make a bridging firewall that is also capable of filtering these higher network layers. This is enabled through the bridge-netfilter architecture which is a part of the standard Linux kernel.
%package help
Summary: help documents for ebtables
%description help
Help package contains some doc and man help files for ebtables.
%prep
%autosetup -n %{name}-v%{version}-%{ebminor} -p1
f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
%build
%make_build CFLAGS="${RPM_OPT_FLAGS}" LIBDIR="/%{_lib}/ebtables" BINDIR="%{_sbindir}" MANDIR="%{_mandir}" LDFLAGS="${RPM_LD_FLAGS} -Wl,-z,now"
%install
install -d %{buildroot}{%{_initrddir},%{_unitdir},%{_libexecdir},%{_sysconfdir}/sysconfig}
install -p %{SOURCE3} %{buildroot}%{_unitdir}/
chmod -x %{buildroot}%{_unitdir}/*.service
install -m0755 %{SOURCE2} %{buildroot}%{_libexecdir}/ebtables
%make_install LIBDIR="/%{_lib}/ebtables" BINDIR="%{_sbindir}" MANDIR="%{_mandir}"
touch %{buildroot}%{_sysconfdir}/sysconfig/{ebtables.nat,ebtables.filter,ebtables.broute}
rm -f %{buildroot}%{_sbindir}/ebtables-save
install %{SOURCE1} %{buildroot}%{_sbindir}/ebtables-save
mv %{buildroot}/%{_lib}/ebtables/libebtc.so %{buildroot}/%{_lib}/
mv %{buildroot}%{_sbindir}/ebtables %{buildroot}%{_sbindir}/ebtables-legacy
touch %{buildroot}%{_sbindir}/ebtables
%post
%systemd_post ebtables.service
%?ldconfig
if [ "$(readlink -e %{_sbindir}/ebtables)" == %{_sbindir}/ebtables ]; then
rm -f %{_sbindir}/ebtables
fi
%{_sbindir}/update-alternatives --install %{_sbindir}/ebtables ebtables %{_sbindir}/ebtables-legacy 10
%preun
%systemd_preun ebtables.service
%postun
%systemd_postun_with_restart ebtables.service
%?ldconfig
if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives --remove ebtables %{_sbindir}/ebtables-legacy
fi
%files
%license COPYING
%{_unitdir}/ebtables.service
%{_libexecdir}/ebtables
/%{_lib}/libebtc.so
/%{_lib}/ebtables/
%{_sbindir}/ebtables-*
%exclude %{_initrddir}
%exclude %{_sysconfdir}/ethertypes
%config(noreplace) %{_sysconfdir}/sysconfig/ebtables-config
%ghost %{_sbindir}/ebtables
%ghost %{_sysconfdir}/sysconfig/{ebtables.filter,ebtables.nat,ebtables.broute}
%files help
%doc ChangeLog THANKS
%doc %{_mandir}/man8/ebtables.8*
%changelog
* Thu Sep 24 2019 gaoguanghui <gaoguanghui1@huawei.com> - 2.0.10-30
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:this patch made future ebtables processes wait indefinitely for the lock to
become free
* Mon Sep 16 2019 yanzhihua <yanzhihua4@huawei.com> - 2.0.10-29
- Package init