ipset-vl.spec 7.5 KB

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