xtables-addons-vl.spec 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. Name: xtables-addons
  2. Summary: Extensions targets and matches for iptables
  3. Version: 2.9
  4. Release: 1%{?dist}
  5. # The entire source code is GPLv2 except ACCOUNT/libxt_ACCOUNT_cl.* which is LGPLv2
  6. License: GPLv2 and LGPLv2
  7. Group: System Environment/Base
  8. URL: http://xtables-addons.sourceforge.net
  9. Source0: http://dl.sourceforge.net/xtables-addons/Xtables-addons/%{version}/xtables-addons-%{version}.tar.xz
  10. Source1: ipset.init
  11. Source2: ipset-config
  12. BuildRequires: iptables-devel >= 1.4.5
  13. BuildRequires: autoconf automake libtool
  14. Provides: %{name}-kmod-common = %{version}
  15. Requires(post): chkconfig
  16. Requires(preun): chkconfig
  17. # This is for /sbin/service
  18. Requires(preun): initscripts
  19. Requires(postun): initscripts
  20. Requires: ipset >= 6.11
  21. Obsoletes: %{name}-devel < 1.27-1
  22. %description
  23. Xtables-addons provides extra modules for iptables not present in the kernel,
  24. and is the successor of patch-o-matic. Extensions includes new targets like
  25. TEE, TARPIT, CHAOS, or modules like geoip, ipset, and account.
  26. This package provides the userspace libraries for iptables to use extensions
  27. in the %{name}-kmod package. You must also install the
  28. %{name}-kmod package.
  29. %package -n dkms-%{name}
  30. Summary: dkms package for xtables-addons
  31. Group: System Environment/Kernel
  32. Requires: dkms
  33. Requires: kernel-devel >= 3.7
  34. Requires(post): dkms
  35. Requires(preun):dkms
  36. %description -n dkms-%{name}
  37. This contains the dkms package building the xtables-addons kernel modules.
  38. %prep
  39. %setup -q -n %{name}-%{version}
  40. ./autogen.sh
  41. if [ ! -e /%{_lib}/xtables/libxt_CHECKSUM.so ]; then
  42. sed -i 's/build_CHECKSUM=/build_CHECKSUM=m/' mconfig
  43. fi
  44. if [ ! -e /%{_lib}/xtables/libxt_TEE.so ]; then
  45. sed -i 's/build_TEE=/build_TEE=m/' mconfig
  46. fi
  47. sed -i 's/build_ipset6=/build_ipset6=m/' mconfig
  48. %build
  49. %configure --without-kbuild
  50. make V=1 %{?_smp_mflags}
  51. %install
  52. make DESTDIR=%{buildroot} install
  53. # We add xt_geoip database scripts manually
  54. rm -rf %{buildroot}%{_libexecdir}
  55. rm -f geoip/{Makefile*,.gitignore}
  56. chmod 0644 geoip/*
  57. # There is no -devel package. So no need for these files
  58. rm -f %{buildroot}%{_libdir}/*.{la,so}
  59. # install init scripts and configuration files
  60. install -D -pm 0755 %{SOURCE1} %{buildroot}%{_initddir}/ipset
  61. install -D -pm 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/ipset-config
  62. # prepare the dkms sources
  63. mkdir -p %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ACCOUNT %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/pknock
  64. cp extensions/Kbuild extensions/Mbuild mconfig extensions/Makefile* extensions/mac.c extensions/xt_* extensions/compat_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}
  65. cp extensions/ACCOUNT/Kbuild extensions/ACCOUNT/Mbuild extensions/ACCOUNT/Makefile* extensions/ACCOUNT/xt_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ACCOUNT
  66. cp extensions/pknock/Kbuild extensions/pknock/Mbuild extensions/pknock/Makefile* extensions/pknock/xt_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/pknock
  67. # mconfig is not in parent dir anymore
  68. sed -i 's/${XA_ABSTOPSRCDIR}/${M}/' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Kbuild
  69. # remove ipset-6 references to silence make clean errors
  70. sed -i '/ipset-6/ d' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Kbuild
  71. sed -i '/ipset-6/ d' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Mbuild
  72. cat > %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf << EOF
  73. PACKAGE_NAME="%{name}"
  74. PACKAGE_VERSION="%{version}-%{release}"
  75. AUTOINSTALL="yes"
  76. MAKE[0]="make -C \${kernel_source_dir} M=\\\$(pwd)"
  77. CLEAN="make -C \${kernel_source_dir} M=\\\$(pwd) clean"
  78. BUILT_MODULE_LOCATION[0]="ACCOUNT"
  79. DEST_MODULE_LOCATION[0]="/kernel/extra"
  80. BUILT_MODULE_NAME[0]="xt_ACCOUNT"
  81. BUILT_MODULE_LOCATION[1]="pknock"
  82. DEST_MODULE_LOCATION[1]="/kernel/extra"
  83. BUILT_MODULE_NAME[1]="xt_pknock"
  84. EOF
  85. i=2
  86. for mod in compat_xtables xt_CHAOS \
  87. xt_condition xt_DELUDE xt_DHCPMAC xt_DNETMAP xt_fuzzy xt_geoip xt_iface \
  88. xt_IPMARK xt_ipp2p xt_ipv4options xt_length2 xt_LOGMARK xt_lscan xt_psd \
  89. xt_quota2 xt_SYSRQ xt_TARPIT; do
  90. echo -e "DEST_MODULE_LOCATION[$i]=\"/kernel/extra\"\nBUILT_MODULE_NAME[$i]=\"$mod\"" >> %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf
  91. (( i = $i + 1 ))
  92. done
  93. install -m755 geoip/xt_geoip_dl %{buildroot}%{_sbindir}/
  94. install -m755 geoip/xt_geoip_build %{buildroot}%{_sbindir}/
  95. %post
  96. /sbin/ldconfig
  97. /sbin/chkconfig --add ipset
  98. %preun
  99. if [ $1 = 0 ] ; then
  100. /sbin/service ipset stop >/dev/null 2>&1
  101. /sbin/chkconfig --del ipset
  102. fi
  103. %postun
  104. /sbin/ldconfig
  105. if [ "$1" -ge "1" ] ; then
  106. /sbin/service ipset condrestart >/dev/null 2>&1 || :
  107. fi
  108. %post -n dkms-%{name}
  109. set -x
  110. /usr/sbin/dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  111. /usr/sbin/dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  112. /usr/sbin/dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force
  113. true
  114. %preun -n dkms-%{name}
  115. set -x
  116. /usr/sbin/dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all
  117. true
  118. %clean
  119. rm -rf %{buildroot}
  120. %files
  121. %defattr(-,root,root,-)
  122. %doc LICENSE README doc/* geoip
  123. %attr(0755,root,root) %{_initddir}/*
  124. %config(noreplace) %{_sysconfdir}/sysconfig/*
  125. /%{_lib}/xtables/*.so
  126. %{_libdir}/*.so.*
  127. %{_sbindir}/*
  128. %{_mandir}/man?/*
  129. %files -n dkms-%{name}
  130. %{_usr}/src/%{name}-%{version}-%{release}
  131. %changelog
  132. * Sat Oct 31 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.9-1
  133. - new upstream release.
  134. * Tue Jul 7 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1
  135. - new upstream release.
  136. * Sat Nov 1 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
  137. - built for Vine Linux.
  138. - new upstream release.
  139. * Sat Apr 26 2014 Nicolas Chauvet <kwizart@gmail.com> - 2.5-1
  140. - Update to 2.5
  141. * Sun Jan 12 2014 Nicolas Chauvet <kwizart@gmail.com> - 2.4-1
  142. - Update to 2.4
  143. * Tue Jun 18 2013 Nicolas Chauvet <kwizart@gmail.com> - 2.3-1
  144. - Update to 2.3
  145. * Thu Apr 18 2013 Nicolas Chauvet <kwizart@gmail.com> - 2.2-1
  146. - Update to 2.2
  147. * Mon Jan 14 2013 Nicolas Chauvet <kwizart@gmail.com> - 2.1-1
  148. - Update to 2.1
  149. * Thu Oct 18 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.47.1-1
  150. - Update to 1.47.1
  151. * Wed Oct 03 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.46-1
  152. - Update to 1.46
  153. * Tue Jul 31 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.45-1
  154. - Update to 1.45
  155. * Thu Jun 14 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.42-3
  156. - Fix ipset path in F-16 and later
  157. * Tue Jun 05 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.42-2
  158. - Fix for UsrMove - rfbz#2360
  159. - Fix Conflict with ipset - rfbz#2201
  160. - Add Requires ipset >= 6.11 - rfbz#2226
  161. * Thu Apr 12 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.42-1
  162. - Update to 1.42
  163. * Tue Jan 24 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.41-1
  164. - Update to 1.41
  165. * Thu Nov 17 2011 Nicolas Chauvet <kwizart@gmail.com> - 1.39-1
  166. - Update to 1.39
  167. * Wed Oct 27 2010 Chen Lei <supercyper@163.com> - 1.30-1
  168. - update to 1.30
  169. * Sun Jul 25 2010 Chen Lei <supercyper@163.com> - 1.28-1
  170. - update to 1.28
  171. * Mon Jun 28 2010 Chen Lei <supercyper@163.com> - 1.27-2
  172. - rebuild for kernel 2.6.35
  173. * Mon May 31 2010 Chen Lei <supercyper@163.com> - 1.27-1
  174. - update to 1.27
  175. * Sun May 02 2010 Chen Lei <supercyper@163.com> - 1.26-1
  176. - update to 1.26
  177. * Mon Apr 26 2010 Chen Lei <supercyper@163.com> - 1.25-1
  178. - update to 1.25
  179. * Sun Apr 25 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 1.24-2
  180. - rebuilt
  181. * Thu Mar 18 2010 Chen Lei <supercyper@163.com> - 1.24-1
  182. - initial rpm build