392340
# service legacy actions
392340
%define legacy_actions %{_libexecdir}/initscripts/legacy-actions
392340
392340
Name:             ipset
392340
Version:          7.1
392340
Release:          1%{?dist}
392340
Summary:          Manage Linux IP sets
392340
392340
License:          GPLv2
392340
URL:              http://ipset.netfilter.org/
392340
Source0:          http://ipset.netfilter.org/%{name}-%{version}.tar.bz2
392340
Source1:          %{name}.service
392340
Source2:          %{name}.start-stop
392340
Source3:          %{name}-config
392340
Source4:          %{name}.save-legacy
392340
392340
BuildRequires:    libmnl-devel
392340
392340
# An explicit requirement is needed here, to avoid cases where a user would
392340
# explicitly update only one of the two (e.g 'yum update ipset')
392340
Requires:         %{name}-libs%{?_isa} = %{version}-%{release}
392340
392340
%description
392340
IP sets are a framework inside the Linux kernel since version 2.4.x, which can
392340
be administered by the ipset utility. Depending on the type, currently an IP
392340
set may store IP addresses, (TCP/UDP) port numbers or IP addresses with MAC
392340
addresses in a way, which ensures lightning speed when matching an entry
392340
against a set.
392340
392340
If you want to:
392340
 - store multiple IP addresses or port numbers and match against the collection
392340
   by iptables at one swoop;
392340
 - dynamically update iptables rules against IP addresses or ports without
392340
   performance penalty;
392340
 - express complex IP address and ports based rulesets with one single iptables
392340
   rule and benefit from the speed of IP sets
392340
then ipset may be the proper tool for you.
392340
392340
392340
%package libs
392340
Summary:       Shared library providing the IP sets functionality
392340
392340
%description libs
392340
This package contains the libraries which provide the IP sets funcionality.
392340
392340
392340
%package devel
392340
Summary:       Development files for %{name}
392340
Requires:      %{name}-libs%{?_isa} == %{version}-%{release}
392340
392340
%description devel
392340
This package contains the files required to develop software using the %{name}
392340
libraries.
392340
392340
392340
%package service
392340
Summary:          %{name} service for %{name}s
392340
Requires:         %{name} = %{version}-%{release}
392340
BuildRequires:    systemd
392340
Requires:         iptables-services
392340
Requires(post):   systemd
392340
Requires(preun):  systemd
392340
Requires(postun): systemd
392340
BuildArch:        noarch
392340
392340
%description service
392340
This package provides the service %{name} that is split
392340
out of the base package since it is not active by default.
392340
392340
392340
%prep
392340
%setup -q
392340
392340
392340
%build
392340
%configure --enable-static=no --with-kmod=no
392340
392340
# Just to make absolutely sure we are not building the bundled kernel module
392340
# I have to do it after the configure run unfortunately
392340
rm -fr kernel
392340
392340
# Prevent libtool from defining rpath
392340
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
392340
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
392340
392340
make %{?_smp_mflags}
392340
392340
392340
%install
392340
make install DESTDIR=%{buildroot}
392340
find %{buildroot} -name '*.la' -exec rm -f '{}' \;
392340
392340
# install systemd unit file
392340
install -d -m 755 %{buildroot}/%{_unitdir}
392340
install -c -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}
392340
392340
# install supporting script
392340
install -d -m 755 %{buildroot}%{_libexecdir}/%{name}
392340
install -c -m 755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{name}
392340
392340
# install ipset-config
392340
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
392340
install -c -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-config
392340
392340
# install legacy actions for service command
392340
install -d %{buildroot}/%{legacy_actions}/ipset
392340
install -c -m 755 %{SOURCE4} %{buildroot}/%{legacy_actions}/ipset/save
392340
392340
# Create directory for configuration
392340
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
392340
392340
392340
%preun
392340
if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
392340
    rmmod xt_set 2>/dev/null
392340
    [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
392340
fi
392340
392340
392340
%post libs -p /sbin/ldconfig
392340
392340
%postun libs -p /sbin/ldconfig
392340
392340
392340
%post service
392340
%systemd_post %{name}.service
392340
392340
%preun service
392340
if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
392340
    rmmod xt_set 2>/dev/null
392340
    [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
392340
fi
392340
%systemd_preun %{name}.service
392340
392340
%postun service
392340
%systemd_postun_with_restart %{name}.service
392340
392340
%triggerin service -- ipset-service < 6.38-1.el7
392340
# Before 6.38-1, ipset.start-stop keeps a backup of previously saved sets, but
392340
# doesn't touch the /etc/sysconfig/ipset.d/.saved flag. Remove the backup on
392340
# upgrade, so that we use the current version of saved sets
392340
rm -f /etc/sysconfig/ipset.save || :
392340
exit 0
392340
392340
%triggerun service -- ipset-service < 6.38-1.el7
392340
# Up to 6.29-1, ipset.start-stop uses a single data file
392340
for f in /etc/sysconfig/ipset.d/*; do
392340
    [ "${f}" = "/etc/sysconfig/ipset.d/*" ] && break
392340
    cat ${f} >> /etc/sysconfig/ipset || :
392340
done
392340
exit 0
392340
392340
%files
392340
%doc COPYING ChangeLog
392340
%doc %{_mandir}/man8/%{name}.8.gz
392340
%{_sbindir}/%{name}
392340
392340
%files libs
392340
%doc COPYING
392340
%{_libdir}/lib%{name}.so.13*
392340
%doc %{_mandir}/man3/lib%{name}.3.gz
392340
392340
%files devel
392340
%{_includedir}/lib%{name}
392340
%{_libdir}/lib%{name}.so
392340
%{_libdir}/pkgconfig/lib%{name}.pc
392340
392340
%files service
392340
%{_unitdir}/%{name}.service
392340
%dir %{_libexecdir}/%{name}
392340
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset-config
392340
%ghost %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset
392340
%attr(0755,root,root) %{_libexecdir}/%{name}/%{name}.start-stop
392340
%dir %{legacy_actions}/ipset
392340
%{legacy_actions}/ipset/save
392340
392340
392340
%changelog
392340
* Sun May 26 2019 Stefano Brivio <sbrivio@redhat.com> - 7.1-1
392340
- Rebase to 7.1 (RHBZ#1649090):
392340
  - Add compatibility support for strscpy()
392340
  - Correct the manpage about the sort option
392340
  - Add missing functions to libipset.map
392340
  - configure.ac: Fix build regression on RHEL/CentOS/SL (Serhey Popovych)
392340
  - Implement sorting for hash types in the ipset tool
392340
  - Fix to list/save into file specified by option (reported by Isaac Good)
392340
  - Introduction of new commands and protocol version 7, updated kernel include files
392340
  - Add compatibility support for async in pernet_operations
392340
  - Use more robust awk patterns to check for backward compatibility
392340
  - Prepare the ipset tool to handle multiple protocol version
392340
  - Fix warning message handlin
392340
  - Correct to test null valued entry in hash:net6,port,net6 test
392340
  - Library reworked to support embedding ipset completely
392340
  - Add compatibility to support kvcalloc()
392340
  - Validate string type attributes in attr2data() (Stefano Brivio)
392340
  - manpage: Add comment about matching on destination MAC address (Stefano Brivio)
392340
    (RHBZ#1649079)
392340
  - Add compatibility to support is_zero_ether_addr()
392340
  - Fix use-after-free in ipset_parse_name_compat() (Stefano Brivio) (RHBZ#1649085)
392340
  - Fix leak in build_argv() on line parsing error (Stefano Brivio) (RHBZ#1649085)
392340
  - Simplify return statement in ipset_mnl_query() (Stefano Brivio) (RHBZ#1649085)
392340
  - tests/check_klog.sh: Try dmesg too, don't let shell terminate script (Stefano Brivio) 
392340
- Fixes:
392340
  - Fix all shellcheck warnings in init script (RHBZ#1649085)
392340
  - Make error reporting consistent, introduce different severities (RHBZ#1683711)
392340
  - While restoring, on invalid entries, remove them and retry (RHBZ#1683713)
392340
  - Fix covscan SC2166 warning in init script (RHBZ#1649085)
392340
392340
* Tue Nov 13 2018 Stefano Brivio <sbrivio@redhat.com> - 6.38-3
392340
- Fix loading of sets with dependencies on other sets (RHBZ#1647096), and
392340
  hardcode 6.38-1.el7 for ipset-service upgrade and downgrade triggers, so that
392340
  we don't run into issues with z-stream updates
392340
392340
* Mon Oct 08 2018 Stefano Brivio <sbrivio@redhat.com> - 6.38-2
392340
- Drop ipset-devel dependency on kernel-devel (RHBZ#163175)
392340
392340
* Tue Aug 14 2018 Stefano Brivio <sbrivio@redhat.com> - 6.38-1
392340
- Update to 6.38, source from RHEL7 6.38-2 (RHBZ#1615967)
392340
392340
* Mon Feb 12 2018 Eric Garver <egarver@redhat.com> - 6.35-3
392340
- Patch for missing header file (RHBZ#1543596)
392340
392340
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.35-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
392340
392340
* Mon Jan 08 2018 Nicolas Chauvet <kwizart@gmail.com> - 6.35-1
392340
- Update to 6.35
392340
392340
* Mon Jul 31 2017 Nicolas Chauvet <kwizart@gmail.com> - 6.32-1
392340
- Update to 6.32
392340
392340
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.29-4
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
392340
392340
* Fri Apr 07 2017 Nicolas Chauvet <kwizart@gmail.com> - 6.29-3
392340
- Userspace needs kernel-headers - rhbz#1420864
392340
392340
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.29-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
392340
392340
* Mon Apr 18 2016 Thomas Woerner <twoerner@redhat.com> - 6.29-1
392340
- New upstream version 6.29 (RHBZ#1317208)
392340
  - Suppress unnecessary stderr in command loop for resize and list
392340
  - Correction in comment test
392340
  - Support chroot buildroots (reported by Jan Engelhardt)
392340
  - Fix "configure" breakage due to pkg-config related changes
392340
    (reported by Jan Engelhardt)
392340
  - Support older pkg-config packages
392340
  - Add bash completion to the install routine (Mart Frauenlob)
392340
  - Fix misleading error message with comment extension
392340
  - Test added to check 0.0.0.0/0,iface to be matched in hash:net,iface type
392340
  - Fix link with libtool >= 2.4.4 (Olivier Blin)
392340
392340
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 6.27-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
392340
392340
* Tue Nov 10 2015 Thomas Woerner <twoerner@redhat.com> - 6.27-1
392340
- New upstream version 6.27 (RHBZ#1145913)
392340
392340
* Sat Oct 10 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 6.26-1
392340
- Upstream 6.26 (RHBZ#1145913)
392340
392340
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.22-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
392340
392340
* Thu Sep 18 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.22-1
392340
- New upstream release.
392340
392340
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-4
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
392340
392340
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-3
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
392340
392340
* Tue Mar 11 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.21.1-2
392340
- Remove runtime requirement on the kernel.
392340
  https://lists.fedoraproject.org/pipermail/devel/2014-March/196565.html
392340
392340
* Tue Oct 29 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.20.1-1
392340
- New upstream release.
392340
392340
* Tue Aug 27 2013 Quentin Armitage <quentin@armitage.org.uk> 6.19-2
392340
- Add service pkg - adds save and reload functionality on shutdown/startup
392340
- Add requires dependency of ipset on matching ipset-libs
392340
392340
* Thu Aug 15 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.19-1
392340
- New upstream release.
392340
392340
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-3
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
392340
392340
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
392340
392340
* Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.16.1-1
392340
- New upstream release.
392340
- Fix a requirement.
392340
392340
* Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.14-1
392340
- New upstream release.
392340
- Fix scriptlets, ldconfig is needed for the libs subpackage, not the main one.
392340
392340
* Mon Jul 30 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.13-1
392340
- New upstream release.
392340
- Split out the library in its own subpackage.
392340
392340
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.11-2
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
392340
392340
* Mon Feb 06 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.11-1
392340
- New upstream release.
392340
- Removed our patch, it has been integrated upstream. As such, we also don't
392340
  need to re-run autoreconf any more.
392340
392340
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.9.1-3
392340
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
392340
392340
* Fri Sep 16 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-2
392340
- Some fixes based on Pierre-Yves' review feedback.
392340
392340
* Wed Sep 14 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-1
392340
- Initial packaging.