Blame SPECS/arptables.spec

0890d3
Summary: User space tool to set up tables of ARP rules in kernel
0890d3
Name:    arptables
0890d3
Version: 0.0.5
Justin Vreeland c0386d
Release: 4.1%{?dist}
0890d3
License: GPLv2+
0890d3
0890d3
URL:     http://ebtables.sourceforge.net/
0890d3
Source0: http://ftp.netfilter.org/pub/arptables/%{name}-%{version}.tar.gz
0890d3
Source1: arptables.service
0890d3
Source2: arptables-legacy-helper
0890d3
0890d3
BuildRequires:  gcc
0890d3
BuildRequires: perl-generators
0890d3
BuildRequires: systemd
0890d3
BuildRequires: make
0890d3
0890d3
%description
0890d3
The arptables is a user space tool used to set up and maintain
0890d3
the tables of ARP rules in the Linux kernel. These rules inspect
0890d3
the ARP frames which they see. arptables is analogous to the iptables
0890d3
user space tool, but is less complicated.
0890d3
0890d3
%package legacy
0890d3
Summary: Legacy user space tool to set up tables of ARP rules in kernel
0890d3
Requires(post): %{_sbindir}/update-alternatives
0890d3
Requires(postun): %{_sbindir}/update-alternatives
0890d3
Provides:  arptables-helper
0890d3
0890d3
%description legacy
0890d3
The arptables is a user space tool used to set up and maintain
0890d3
the tables of ARP rules in the Linux kernel. These rules inspect
0890d3
the ARP frames which they see. arptables is analogous to the iptables
0890d3
user space tool, but is less complicated.
0890d3
0890d3
Note that it is considered legacy upstream since nftables provides the same
0890d3
functionality in a much newer code-base. To aid in migration, there is
0890d3
arptables-nft utility, a drop-in replacement for the legacy one which uses
0890d3
nftables internally. It is provided by iptables-arptables package.
0890d3
0890d3
%package services
0890d3
Summary: arptables systemd services
0890d3
%{?systemd_ordering}
0890d3
Requires(post): systemd
0890d3
Requires(preun): systemd
0890d3
Requires(postun): systemd
0890d3
Requires: arptables-helper
0890d3
Obsoletes: arptables-compat < 0.0.4-20
0890d3
0890d3
%description services
0890d3
arptables systemd services
0890d3
0890d3
This package provides the systemd arptables service that has been split
0890d3
out of the base package for better integration with alternatives.
0890d3
0890d3
%prep
0890d3
%autosetup -p1
0890d3
0890d3
%build
0890d3
# Makefile uses $(KERNEL_DIR) to redefine where to look for header files.
0890d3
# But when it's set to standard system include directory gcc ignores it
0890d3
# (see gcc(1)). It however looks that the code is not ready for using 
0890d3
# system headers (instead included ones) so we don't use this option.
0890d3
make all 'COPT_FLAGS=%{optflags}' 'LDFLAGS=%{build_ldflags}' %{_smp_mflags}
0890d3
0890d3
%install
0890d3
make install DESTDIR=%{buildroot} BINDIR=%{_sbindir} MANDIR=%{_mandir}
0890d3
pfx=%{buildroot}%{_sbindir}
0890d3
manpfx=%{buildroot}%{_mandir}/man8
0890d3
for sfx in "-restore" "-save"; do
0890d3
	mv $pfx/arptables$sfx $pfx/arptables-legacy$sfx
0890d3
	touch $pfx/arptables$sfx
0890d3
	mv $manpfx/arptables${sfx}.8 $manpfx/arptables-legacy${sfx}.8
0890d3
	touch $manpfx/arptables${sfx}.8
0890d3
done
0890d3
0890d3
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/arptables.service
0890d3
mkdir -p %{buildroot}%{_libexecdir}/
0890d3
install -p -D -m 755 %{SOURCE2} %{buildroot}%{_libexecdir}/
0890d3
touch %{buildroot}%{_libexecdir}/arptables-helper
0890d3
rm -rf %{buildroot}%{_initrddir}
0890d3
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
0890d3
echo '# Configure prior to use' > %{buildroot}%{_sysconfdir}/sysconfig/arptables
0890d3
0890d3
%post legacy
0890d3
pfx=%{_sbindir}/arptables
0890d3
manpfx=%{_mandir}/man8/arptables
0890d3
lepfx=%{_libexecdir}/arptables
0890d3
for sfx in "" "-restore" "-save"; do
0890d3
	if [ "$(readlink -e $pfx$sfx)" == $pfx$sfx ]; then
0890d3
		rm -f $pfx$sfx
0890d3
	fi
0890d3
	if [ "$(readlink -e $manpfx${sfx}.8.gz)" == $manpfx${sfx}.8.gz ]; then
0890d3
		rm -f $manpfx${sfx}.8.gz
0890d3
	fi
0890d3
done
0890d3
if [ "$(readlink -e $lepfx-helper)" == $lepfx-helper ]; then
0890d3
	rm -f $lepfx-helper
0890d3
fi
0890d3
%{_sbindir}/update-alternatives --install \
0890d3
	$pfx arptables $pfx-legacy 10 \
0890d3
	--slave $pfx-save arptables-save $pfx-legacy-save \
0890d3
	--slave $pfx-restore arptables-restore $pfx-legacy-restore \
0890d3
	--slave $manpfx.8.gz arptables-man $manpfx-legacy.8.gz \
0890d3
	--slave $manpfx-save.8.gz arptables-save-man $manpfx-legacy-save.8.gz \
0890d3
	--slave $manpfx-restore.8.gz arptables-restore-man $manpfx-legacy-restore.8.gz \
0890d3
	--slave $lepfx-helper arptables-helper $lepfx-legacy-helper
0890d3
0890d3
%preun legacy
0890d3
%systemd_preun arptables.service
0890d3
0890d3
%postun legacy
0890d3
%systemd_postun_with_restart arptables.service
0890d3
if [ $1 -eq 0 ]; then
0890d3
	%{_sbindir}/update-alternatives --remove \
0890d3
		arptables %{_sbindir}/arptables-legacy
0890d3
fi
0890d3
0890d3
%post services
0890d3
%systemd_post arptables.service
0890d3
0890d3
%preun services
0890d3
%systemd_preun arptables.service
0890d3
0890d3
%postun services
0890d3
%?ldconfig
0890d3
%systemd_postun arptables.service
0890d3
0890d3
%files legacy
0890d3
%{!?_licensedir:%global license %%doc}
0890d3
%license COPYING
0890d3
%{_sbindir}/arptables-legacy*
0890d3
%{_libexecdir}/arptables-legacy-helper
0890d3
%{_mandir}/*/arptables-legacy*
0890d3
%ghost %{_sbindir}/arptables
0890d3
%ghost %{_sbindir}/arptables-save
0890d3
%ghost %{_sbindir}/arptables-restore
0890d3
%ghost %{_mandir}/man8/arptables.8.gz
0890d3
%ghost %{_mandir}/man8/arptables-save.8.gz
0890d3
%ghost %{_mandir}/man8/arptables-restore.8.gz
0890d3
%ghost %{_libexecdir}/arptables-helper
0890d3
0890d3
%files services
0890d3
%{_unitdir}/arptables.service
0890d3
%config(noreplace) %{_sysconfdir}/sysconfig/arptables
0890d3
0890d3
%changelog
Justin Vreeland c0386d
* Fri Oct  1 2021 Justin Vreeland <jvreeland@twitter.com> - 0.0.5-4.1
Justin Vreeland c0386d
- Bump extraver for aarch64 rebuild
Justin Vreeland c0386d
0890d3
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-4
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
0890d3
0890d3
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-3
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0890d3
0890d3
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-2
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
0890d3
0890d3
* Wed Dec 04 2019 Phil Sutter <psutter@redhat.com> - 0.0.5-1
0890d3
- New version 0.0.5
0890d3
0890d3
* Wed Oct 30 2019 Phil Sutter <psutter@redhat.com> - 0.0.4-20
0890d3
- Make services sub-package obsolete compat to fix upgrade path
0890d3
0890d3
* Tue Oct 22 2019 Phil Sutter <psutter@redhat.com> - 0.0.4-19
0890d3
- Drop compat sub-package again
0890d3
0890d3
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-18
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0890d3
0890d3
* Thu Mar 21 2019 Phil Sutter <psutter@redhat.com> - 0.0.4-17
0890d3
- Fix upgrade from non-legacy arptables package
0890d3
0890d3
* Mon Feb 18 2019 Phil Sutter <psutter@redhat.com> - 0.0.4-16
0890d3
- Integrate with alternatives
0890d3
- Split systemd service into sub-package
0890d3
- Rename arptables RPM into arptables-legacy
0890d3
- Add recent upstream changes
0890d3
0890d3
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-15
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0890d3
0890d3
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-14
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0890d3
0890d3
* Wed Feb 21 2018 Florian Weimer <fweimer@redhat.com> - 0.0.4-13
0890d3
- Use LDFLAGS from redhat-rpm-config
0890d3
0890d3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-12
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0890d3
0890d3
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-11
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
0890d3
0890d3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-10
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0890d3
0890d3
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-9
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
0890d3
0890d3
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-8
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
0890d3
0890d3
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.4-7
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
0890d3
0890d3
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.4-6
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
0890d3
0890d3
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.4-5
0890d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
0890d3
0890d3
* Mon Sep 16 2013 Jiri Popelka <jpopelka@redhat.com> - 0.0.4-4
0890d3
- revert previous change, the code is not ready for this
0890d3
0890d3
* Mon Sep 16 2013 Jiri Popelka <jpopelka@redhat.com> - 0.0.4-3
0890d3
- use system kernel headers
0890d3
0890d3
* Fri Sep 13 2013 Jiri Popelka <jpopelka@redhat.com> - 0.0.4-2
0890d3
- install with '-p' (#1007964)
0890d3
0890d3
* Fri Sep 13 2013 Jiri Popelka <jpopelka@redhat.com> - 0.0.4-1
0890d3
- renamed arptables_jf to arptables