ipset-vl.spec 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. %bcond_with systemd
  2. Name: ipset
  3. Summary: Manage Linux IP sets
  4. Version: 7.22
  5. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  6. Group: system
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. License: GPLv2
  10. URL: https://ipset.netfilter.org/
  11. Source0: https://ipset.netfilter.org/%{name}-%{version}.tar.bz2
  12. Source1: %{name}.service
  13. Source2: %{name}.start-stop
  14. Source3: %{name}-config
  15. Source100: %{name}.init
  16. Patch001: 0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch
  17. Patch002: 0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch
  18. Patch003: 0003-lib-ipset-Avoid-argv-array-overstepping.patch
  19. Patch004: 0004-tests-Reduce-testsuite-run-time.patch
  20. BuildRequires: libmnl-devel
  21. # An explicit requirement is needed here, to avoid cases where a user would
  22. # explicitly update only one of the two (e.g 'yum update ipset')
  23. Requires: %{name}-libs%{?_isa} = %{version}-%{release}
  24. %if %{with systemd}
  25. %{?systemd_requires}
  26. %else
  27. Requires(post): chkconfig
  28. Requires(preun): chkconfig /sbin/service
  29. %endif
  30. %description
  31. IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which can be
  32. administered by the ipset utility. Depending on the type, currently an IP set
  33. may store IP addresses, (TCP/UDP) port numbers or IP addresses with MAC
  34. addresses in a way, which ensures lightning speed when matching an entry
  35. against a set.
  36. If you want to:
  37. - store multiple IP addresses or port numbers and match against the collection
  38. by iptables at one swoop;
  39. - dynamically update iptables rules against IP addresses or ports without
  40. performance penalty;
  41. - express complex IP address and ports based rulesets with one single iptables
  42. rule and benefit from the speed of IP sets
  43. then ipset may be the proper tool for you.
  44. %package libs
  45. Summary: Shared library providing the IP sets functionality
  46. Group: system
  47. %description libs
  48. This package contains the libraries which provide the IP sets funcionality.
  49. %package devel
  50. Summary: Development files for %{name}
  51. Group: programming
  52. Requires: %{name}-libs%{?_isa} == %{version}-%{release}
  53. Requires: kernel-devel
  54. %description devel
  55. This package contains the files required to develop software using the %{name}
  56. libraries.
  57. %if %{with systemd}
  58. %package service
  59. Summary: %{name} service for %{name}s
  60. Requires: %{name} = %{version}-%{release}
  61. BuildRequires: systemd
  62. #Requires: iptables-services
  63. Requires(post): systemd
  64. Requires(preun): systemd
  65. Requires(postun): systemd
  66. BuildArch: noarch
  67. %description service
  68. This package provides the service %{name} that is split
  69. out of the base package since it is not active by default.
  70. %endif
  71. %debug_package
  72. %prep
  73. %autosetup -p1
  74. %build
  75. %configure --enable-static=no --with-kmod=no
  76. # Just to make absolutely sure we are not building the bundled kernel module
  77. # I have to do it after the configure run unfortunately
  78. rm -fr kernel
  79. # Prevent libtool from defining rpath
  80. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  81. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  82. make %{?_smp_mflags}
  83. %install
  84. make install DESTDIR=%{buildroot}
  85. find %{buildroot} -name '*.la' -exec rm -f '{}' \;
  86. %if %{with systemd}
  87. # install systemd unit file
  88. install -d -m 755 %{buildroot}/%{_unitdir}
  89. install -c -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}
  90. # install supporting script
  91. install -d -m 755 %{buildroot}%{_libexecdir}/%{name}
  92. install -c -m 755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{name}
  93. %else
  94. mkdir -p %{buildroot}%{_initdir}
  95. install -m755 %{SOURCE100} %{buildroot}%{_initdir}/%{name}
  96. %endif
  97. # Create directory for configuration
  98. mkdir -p %{buildroot}%{_sysconfdir}/%{name}
  99. %if !%{with systemd}
  100. %post
  101. /sbin/chkconfig --add ipset
  102. %endif
  103. %preun
  104. %if !%{with systemd}
  105. if [ "$1" = 0 ]; then
  106. /sbin/chkconfig --del ipset
  107. fi
  108. %endif
  109. if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
  110. rmmod xt_set 2>/dev/null
  111. [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
  112. fi
  113. %if %{with systemd}
  114. %post service
  115. %systemd_post %{name}.service
  116. %preun service
  117. if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then
  118. rmmod xt_set 2>/dev/null
  119. [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && exit 1
  120. fi
  121. %systemd_preun %{name}.service
  122. %postun service
  123. %systemd_postun_with_restart %{name}.service
  124. %endif
  125. %files
  126. %license COPYING
  127. %doc ChangeLog
  128. %{_mandir}/man8/%{name}*.8.*
  129. %{_sbindir}/%{name}
  130. %{_sbindir}/%{name}-translate
  131. %if !%{with systemd}
  132. %{_initdir}/%{name}
  133. %dir %{_sysconfdir}/%{name}
  134. %endif
  135. %files libs
  136. %license COPYING
  137. %{_libdir}/lib%{name}.so.*
  138. %files devel
  139. %{_includedir}/lib%{name}
  140. %{_libdir}/lib%{name}.so
  141. %{_libdir}/pkgconfig/lib%{name}.pc
  142. %{_mandir}/man3/libipset.3.*
  143. %if %{with systemd}
  144. %files service
  145. %{_unitdir}/%{name}.service
  146. %dir %{_libexecdir}/%{name}
  147. %attr(0755,root,root) %{_libexecdir}/%{name}/%{name}.start-stop
  148. %dir %{_sysconfdir}/%{name}
  149. %endif
  150. %changelog
  151. * Wed Aug 14 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.22-1
  152. - new upstream release.
  153. * Sat Apr 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.6-1
  154. - new upstream release.
  155. * Mon May 8 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.32-1
  156. - new upstream release.
  157. * Sat Nov 1 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.23-1
  158. - built for Vine Linux.
  159. - new upstream release.
  160. * Thu Sep 18 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.22-1
  161. - New upstream release.
  162. * Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-4
  163. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
  164. * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.21.1-3
  165. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
  166. * Tue Mar 11 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 6.21.1-2
  167. - Remove runtime requirement on the kernel.
  168. https://lists.fedoraproject.org/pipermail/devel/2014-March/196565.html
  169. * Tue Oct 29 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.20.1-1
  170. - New upstream release.
  171. * Tue Aug 27 2013 Quentin Armitage <quentin@armitage.org.uk> 6.19-2
  172. - Add service pkg - adds save and reload functionality on shutdown/startup
  173. - Add requires dependency of ipset on matching ipset-libs
  174. * Thu Aug 15 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 6.19-1
  175. - New upstream release.
  176. * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-3
  177. - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
  178. * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.16.1-2
  179. - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
  180. * Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.16.1-1
  181. - New upstream release.
  182. - Fix a requirement.
  183. * Wed Sep 26 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.14-1
  184. - New upstream release.
  185. - Fix scriptlets, ldconfig is needed for the libs subpackage, not the main one.
  186. * Mon Jul 30 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.13-1
  187. - New upstream release.
  188. - Split out the library in its own subpackage.
  189. * Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.11-2
  190. - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
  191. * Mon Feb 06 2012 Mathieu Bridon <bochecha@fedoraproject.org> - 6.11-1
  192. - New upstream release.
  193. - Removed our patch, it has been integrated upstream. As such, we also don't
  194. need to re-run autoreconf any more.
  195. * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.9.1-3
  196. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  197. * Fri Sep 16 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-2
  198. - Some fixes based on Pierre-Yves' review feedback.
  199. * Wed Sep 14 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 6.9.1-1
  200. - Initial packaging.