xtables-addons-vl.spec 7.2 KB

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