74182f
# service legacy actions
74182f
%define legacy_actions %{_libexecdir}/initscripts/legacy-actions
74182f
a0fbec
Name:             ipset
a0fbec
Version:          7.11
74da1b
Release:          8%{?dist}
a0fbec
Summary:          Manage Linux IP sets
a0fbec
a0fbec
License:          GPLv2
a0fbec
URL:              http://ipset.netfilter.org/
a0fbec
Source0:          %{url}/%{name}-%{version}.tar.bz2
a0fbec
Source1:          %{name}.service
a0fbec
Source2:          %{name}.start-stop
74182f
Source3:          %{name}-config
74182f
Source4:          %{name}.save-legacy
a0fbec
a0fbec
Patch1:           0001-Add-deprecation-notice-to-ipset.8.patch
74da1b
Patch2:           0002-lib-split-parser-from-command-execution.patch
74da1b
Patch3:           0003-lib-Detach-restore-routine-from-parser.patch
74da1b
Patch4:           0004-add-ipset-to-nftables-translation-infrastructure.patch
74da1b
Patch5:           0005-tests-add-tests-ipset-to-nftables.patch
74da1b
Patch6:           0006-Fix-typo-in-ipset-translate-man-page.patch
74da1b
Patch7:           0007-Fix-IPv6-sets-nftables-translation.patch
74da1b
Patch8:           0008-ipset-translate-allow-invoking-with-a-path-name.patch
74da1b
Patch9:           0009-Fix-all-debug-mode-warnings.patch
74da1b
Patch10:          0010-Add-missing-function-to-libipset.map-and-bump-librar.patch
a0fbec
a0fbec
BuildRequires:    libmnl-devel
a0fbec
BuildRequires:    automake
a0fbec
BuildRequires:    autoconf
a0fbec
BuildRequires:    make
a0fbec
BuildRequires:    libtool
a0fbec
BuildRequires:    libtool-ltdl-devel
a0fbec
a0fbec
# An explicit requirement is needed here, to avoid cases where a user would
a0fbec
# explicitly update only one of the two (e.g 'yum update ipset')
a0fbec
Requires:         %{name}-libs%{?_isa} = %{version}-%{release}
a0fbec
a0fbec
%description
a0fbec
IP sets are a framework inside the Linux kernel since version 2.4.x, which can
a0fbec
be administered by the ipset utility. Depending on the type, currently an IP
a0fbec
set may store IP addresses, (TCP/UDP) port numbers or IP addresses with MAC
a0fbec
addresses in a way, which ensures lightning speed when matching an entry
a0fbec
against a set.
a0fbec
a0fbec
If you want to:
a0fbec
 - store multiple IP addresses or port numbers and match against the collection
a0fbec
   by iptables at one swoop;
a0fbec
 - dynamically update iptables rules against IP addresses or ports without
a0fbec
   performance penalty;
a0fbec
 - express complex IP address and ports based rulesets with one single iptables
a0fbec
   rule and benefit from the speed of IP sets
a0fbec
then ipset may be the proper tool for you.
a0fbec
a0fbec
a0fbec
%package libs
a0fbec
Summary:       Shared library providing the IP sets functionality
a0fbec
a0fbec
%description libs
a0fbec
This package contains the libraries which provide the IP sets funcionality.
a0fbec
a0fbec
a0fbec
%package devel
a0fbec
Summary:       Development files for %{name}
a0fbec
Requires:      %{name}-libs%{?_isa} == %{version}-%{release}
a0fbec
Requires:      kernel-headers
a0fbec
a0fbec
%description devel
a0fbec
This package contains the files required to develop software using the %{name}
a0fbec
libraries.
a0fbec
a0fbec
a0fbec
%package service
a0fbec
Summary:          %{name} service for %{name}s
a0fbec
Requires:         %{name} = %{version}-%{release}
a0fbec
BuildRequires:    systemd
74182f
Requires:         iptables-nft-services
a0fbec
Requires(post):   systemd
a0fbec
Requires(preun):  systemd
a0fbec
Requires(postun): systemd
a0fbec
BuildArch:        noarch
a0fbec
a0fbec
%description service
a0fbec
This package provides the service %{name} that is split
a0fbec
out of the base package since it is not active by default.
a0fbec
a0fbec
a0fbec
%prep
a0fbec
%autosetup -p1
a0fbec
a0fbec
a0fbec
%build
a0fbec
./autogen.sh
a0fbec
%configure --enable-static=no --with-kmod=no
a0fbec
a0fbec
# Just to make absolutely sure we are not building the bundled kernel module
a0fbec
# I have to do it after the configure run unfortunately
a0fbec
rm -fr kernel
a0fbec
a0fbec
# Prevent libtool from defining rpath
a0fbec
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
a0fbec
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
a0fbec
a0fbec
%make_build
a0fbec
a0fbec
a0fbec
%install
a0fbec
%make_install
a0fbec
find %{buildroot} -name '*.la' -exec rm -f '{}' \;
a0fbec
a0fbec
# install systemd unit file
a0fbec
install -d -m 755 %{buildroot}/%{_unitdir}
a0fbec
install -c -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}
a0fbec
a0fbec
# install supporting script
a0fbec
install -d -m 755 %{buildroot}%{_libexecdir}/%{name}
a0fbec
install -c -m 755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{name}
a0fbec
74182f
# install ipset-config
74182f
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
74182f
install -c -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-config
74182f
74182f
# install legacy actions for service command
74182f
install -d %{buildroot}/%{legacy_actions}/ipset
74182f
install -c -m 755 %{SOURCE4} %{buildroot}/%{legacy_actions}/ipset/save
74182f
a0fbec
# Create directory for configuration
a0fbec
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
a0fbec
74da1b
# Turn absolute symlink into a relative one
74da1b
ln -sf %{name} %{buildroot}/%{_sbindir}/%{name}-translate
a0fbec
a0fbec
%preun
a0fbec
if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
a0fbec
    rmmod xt_set 2>/dev/null
a0fbec
    [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
a0fbec
fi
a0fbec
a0fbec
a0fbec
%ldconfig_scriptlets libs
a0fbec
a0fbec
a0fbec
%post service
a0fbec
%systemd_post %{name}.service
a0fbec
a0fbec
%preun service
a0fbec
if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
a0fbec
    rmmod xt_set 2>/dev/null
a0fbec
    [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
a0fbec
fi
a0fbec
%systemd_preun %{name}.service
a0fbec
a0fbec
%postun service
a0fbec
%systemd_postun_with_restart %{name}.service
a0fbec
a0fbec
a0fbec
%files
a0fbec
%doc ChangeLog
a0fbec
%license COPYING
a0fbec
%{_mandir}/man8/%{name}.8.*
74da1b
%{_mandir}/man8/%{name}-translate.8.*
a0fbec
%{_sbindir}/%{name}
74da1b
%{_sbindir}/%{name}-translate
a0fbec
a0fbec
%files libs
a0fbec
%license COPYING
a0fbec
%{_libdir}/lib%{name}.so.13*
a0fbec
a0fbec
%files devel
a0fbec
%{_includedir}/lib%{name}
a0fbec
%{_libdir}/lib%{name}.so
a0fbec
%{_libdir}/pkgconfig/lib%{name}.pc
a0fbec
%{_mandir}/man3/libipset.3.*
a0fbec
a0fbec
%files service
a0fbec
%{_unitdir}/%{name}.service
a0fbec
%dir %{_libexecdir}/%{name}
74182f
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset-config
74182f
%ghost %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset
a0fbec
%attr(0755,root,root) %{_libexecdir}/%{name}/%{name}.start-stop
74182f
%dir %{legacy_actions}/ipset
74182f
%{legacy_actions}/ipset/save
a0fbec
a0fbec
a0fbec
%changelog
74da1b
* Fri Nov 25 2022 Phil Sutter <psutter@redhat.com> - 7.11-8
74da1b
- Ship iptables-translate utility with ipset package
74da1b
- Add missing function to libipset.map and bump library version
74da1b
- Fix all debug mode warnings
74da1b
- ipset-translate: allow invoking with a path name
74da1b
- Fix IPv6 sets nftables translation
74da1b
- Fix typo in ipset-translate man page
74da1b
- tests: add tests ipset to nftables
74da1b
- add ipset to nftables translation infrastructure
74da1b
- lib: Detach restore routine from parser
74da1b
- lib: split parser from command execution
74da1b
74da1b
* Mon Jan 31 2022 Phil Sutter <psutter@redhat.com> - 7.11-7
74da1b
- Fix for bad performance restoring large sets which are in use
74da1b
74182f
* Mon Nov 08 2021 Phil Sutter <psutter@redhat.com> - 7.11-6
74182f
- Sync ipset.service with RHEL8, fix the required package name
74182f
a0fbec
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 7.11-5
a0fbec
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
a0fbec
  Related: rhbz#1991688
a0fbec
a0fbec
* Fri Jul 02 2021 Phil Sutter <psutter@redhat.com> - 7.11-4
a0fbec
- Improve deprecation notice a bit
a0fbec
a0fbec
* Fri Jun 25 2021 Phil Sutter <psutter@redhat.com> - 7.11-3
a0fbec
- Add deprecation notice to ipset.8
a0fbec
a0fbec
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 7.11-2
a0fbec
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
a0fbec
a0fbec
* Mon Mar 01 2021 Nicolas Chauvet <kwizart@gmail.com> - 7.11-1
a0fbec
- Update to 7.11
a0fbec
a0fbec
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7.10-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
a0fbec
a0fbec
* Mon Dec 21 2020 Nicolas Chauvet <kwizart@gmail.com> - 7.10-1
a0fbec
- Update to 7.10
a0fbec
a0fbec
* Wed Dec 16 2020 Nicolas Chauvet <kwizart@gmail.com> - 7.9-1
a0fbec
- Update to 7.9
a0fbec
a0fbec
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.6-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
a0fbec
a0fbec
* Mon Feb 24 2020 Nicolas Chauvet <kwizart@gmail.com> - 7.6-1
a0fbec
- Update to 7.6
a0fbec
a0fbec
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.5-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a0fbec
a0fbec
* Fri Jan 10 2020 Nicolas Chauvet <kwizart@gmail.com> - 7.5-1
a0fbec
- Update to 7.5
a0fbec
a0fbec
* Mon Nov 04 2019 Eric Garver <eric@garver.life> - 7.4-1
a0fbec
- Update to 7.4
a0fbec
a0fbec
* Mon Aug 19 2019 Nicolas Chauvet <kwizart@gmail.com> - 7.3-1
a0fbec
- Update to 7.3
a0fbec
a0fbec
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.2-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a0fbec
a0fbec
* Thu Jul 11 2019 Nicolas Chauvet <kwizart@gmail.com> - 7.2-1
a0fbec
- Update to 7.2
a0fbec
a0fbec
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.38-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
a0fbec
a0fbec
* Mon Aug 13 2018 Nicolas Chauvet <kwizart@gmail.com> - 6.38-1
a0fbec
- Update to 6.38
a0fbec
- Clean-up spec
a0fbec
a0fbec
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.35-4
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a0fbec
a0fbec
* Mon Feb 12 2018 Eric Garver <egarver@redhat.com> - 6.35-3
a0fbec
- Patch for missing header file (RHBZ#1543596)
a0fbec
a0fbec
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.35-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a0fbec
a0fbec
* Mon Jan 08 2018 Nicolas Chauvet <kwizart@gmail.com> - 6.35-1
a0fbec
- Update to 6.35
a0fbec
a0fbec
* Mon Jul 31 2017 Nicolas Chauvet <kwizart@gmail.com> - 6.32-1
a0fbec
- Update to 6.32
a0fbec
a0fbec
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.29-4
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a0fbec
a0fbec
* Fri Apr 07 2017 Nicolas Chauvet <kwizart@gmail.com> - 6.29-3
a0fbec
- Userspace needs kernel-headers - rhbz#1420864
a0fbec
a0fbec
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.29-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a0fbec
a0fbec
* Mon Apr 18 2016 Thomas Woerner <twoerner@redhat.com> - 6.29-1
a0fbec
- New upstream version 6.29 (RHBZ#1317208)
a0fbec
  - Suppress unnecessary stderr in command loop for resize and list
a0fbec
  - Correction in comment test
a0fbec
  - Support chroot buildroots (reported by Jan Engelhardt)
a0fbec
  - Fix "configure" breakage due to pkg-config related changes
a0fbec
    (reported by Jan Engelhardt)
a0fbec
  - Support older pkg-config packages
a0fbec
  - Add bash completion to the install routine (Mart Frauenlob)
a0fbec
  - Fix misleading error message with comment extension
a0fbec
  - Test added to check 0.0.0.0/0,iface to be matched in hash:net,iface type
a0fbec
  - Fix link with libtool >= 2.4.4 (Olivier Blin)
a0fbec
a0fbec
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 6.27-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a0fbec
a0fbec
* Tue Nov 10 2015 Thomas Woerner <twoerner@redhat.com> - 6.27-1
a0fbec
- New upstream version 6.27 (RHBZ#1145913)
a0fbec
a0fbec
* Sat Oct 10 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 6.26-1
a0fbec
- Upstream 6.26 (RHBZ#1145913)
a0fbec
a0fbec
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.22-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a0fbec
a0fbec
* Thu Sep 18 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.22-1
a0fbec
- New upstream release.
a0fbec
a0fbec
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-4
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a0fbec
a0fbec
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-3
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a0fbec
a0fbec
* Tue Mar 11 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.21.1-2
a0fbec
- Remove runtime requirement on the kernel.
a0fbec
  https://lists.fedoraproject.org/pipermail/devel/2014-March/196565.html
a0fbec
a0fbec
* Tue Oct 29 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.20.1-1
a0fbec
- New upstream release.
a0fbec
a0fbec
* Tue Aug 27 2013 Quentin Armitage <quentin@armitage.org.uk> 6.19-2
a0fbec
- Add service pkg - adds save and reload functionality on shutdown/startup
a0fbec
- Add requires dependency of ipset on matching ipset-libs
a0fbec
a0fbec
* Thu Aug 15 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.19-1
a0fbec
- New upstream release.
a0fbec
a0fbec
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-3
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a0fbec
a0fbec
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a0fbec
a0fbec
* Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.16.1-1
a0fbec
- New upstream release.
a0fbec
- Fix a requirement.
a0fbec
a0fbec
* Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.14-1
a0fbec
- New upstream release.
a0fbec
- Fix scriptlets, ldconfig is needed for the libs subpackage, not the main one.
a0fbec
a0fbec
* Mon Jul 30 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.13-1
a0fbec
- New upstream release.
a0fbec
- Split out the library in its own subpackage.
a0fbec
a0fbec
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.11-2
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
a0fbec
a0fbec
* Mon Feb 06 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.11-1
a0fbec
- New upstream release.
a0fbec
- Removed our patch, it has been integrated upstream. As such, we also don't
a0fbec
  need to re-run autoreconf any more.
a0fbec
a0fbec
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.9.1-3
a0fbec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
a0fbec
a0fbec
* Fri Sep 16 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-2
a0fbec
- Some fixes based on Pierre-Yves' review feedback.
a0fbec
a0fbec
* Wed Sep 14 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-1
a0fbec
- Initial packaging.