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