iptables-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. %bcond_with systemd
  2. Summary: Packet filtering tool
  3. Summary(ja): パケットフィルタリングツール
  4. Name: iptables
  5. Version: 1.8.7
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. Group: admin-tools,network
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. Packager: daisuke
  11. # pf.os: ISC license
  12. # iptables-apply: Artistic Licence 2.0
  13. License: GPLv2 and Artistic Licence 2.0 and ISC
  14. URL: http://www.netfilter.org/
  15. Source0: http://www.netfilter.org/projects/iptables/files/%{name}-%{version}.tar.bz2
  16. Source1: iptables.init
  17. Source2: iptables-config
  18. Source3: iptables.service
  19. Source4: sysconfig_iptables
  20. Source5: sysconfig_ip6tables
  21. Patch1: 0001-ebtables-Exit-gracefully-on-invalid-table-names.patch
  22. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  23. BuildRequires: bison flex perl
  24. BuildRequires: kernel-headers >= 2.4.0
  25. BuildRequires: libmnl-devel
  26. BuildRequires: libnetfilter_conntrack-devel
  27. BuildRequires: libnfnetlink-devel
  28. BuildRequires: libnftnl-devel
  29. BuildRequires: libpcap-devel
  30. Conflicts : kernel < 2.4.20
  31. %if %{with systemd}
  32. %{?systemd_requires}
  33. %else
  34. Requires(post): chkconfig
  35. Requires(preun): chkconfig
  36. %endif
  37. %global script_path %{_libexecdir}/iptables
  38. %description
  39. The iptables utility controls the network packet filtering code in the
  40. Linux kernel. If you need to set up firewalls and/or IP masquerading,
  41. you should install this package.
  42. %description -l ja
  43. iptables は Linux kernel のネットワークパケットフィルタを制御するための
  44. ユーティリティです。これを用いることで、ファイアウオールや IP マスカレー
  45. ディング, NAT などを設定することができます。
  46. %package devel
  47. Summary: Libraries, includes, etc. to develop iptables
  48. Summary(ja): iptables 開発用ライブラリ、ヘッダファイル
  49. Group: programming
  50. Requires: iptables = %{version}-%{release}
  51. %description devel
  52. Libraries, include files, etc you can use to develop iptables.
  53. %description devel -l ja
  54. iptables を用いた開発に使用するライブラリやヘッダファイルです。
  55. %package ipv6
  56. Summary: IPv6 Packet filtering tool
  57. Summary(ja): IPv6 用パケットフィルタリングツール
  58. Group: admin-tools,network
  59. Requires: %{name} = %{version}-%{release}
  60. Requires(post): chkconfig
  61. Requires(preun): chkconfig
  62. %description ipv6
  63. The iptables package contains IPv6 (the next version of the IP
  64. protocol) support for iptables. Iptables controls the Linux kernel
  65. network packet filtering code, allowing you to set up firewalls and IP
  66. masquerading.
  67. %description ipv6 -l ja
  68. iptables-ipv6 は iptables で IPv6 をサポートするためのパッケージです。
  69. これを用いることで、IPv6 環境におけるファイアウオールや IP マスカレー
  70. ディング, NAT などを設定することができます。
  71. %debug_package
  72. %prep
  73. %autosetup -p1
  74. %build
  75. ./autogen.sh
  76. CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
  77. %configure \
  78. --enable-devel \
  79. --enable-bpf-compiler \
  80. --enable-libipq \
  81. --bindir=/bin \
  82. --sbindir=/sbin \
  83. --libexecdir=/%{_lib} \
  84. --with-xtlibdir=/%{_lib}/xtables \
  85. --with-kernel=/usr \
  86. --with-kbuild=/usr \
  87. --with-ksource=/usr
  88. # do not use rpath
  89. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  90. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  91. rm -f include/linux/types.h
  92. %make_build
  93. %install
  94. rm -rf %{buildroot}
  95. make install DESTDIR=%{buildroot}
  96. # remove la file(s)
  97. rm -f %{buildroot}/%{_libdir}/*.la
  98. # install ip*tables.h header files
  99. install -m 644 include/ip*tables.h %{buildroot}%{_includedir}/
  100. # install ipulog header file
  101. install -d -m 755 %{buildroot}%{_includedir}/libipulog/
  102. install -m 644 include/libipulog/*.h %{buildroot}%{_includedir}/libipulog/
  103. install -d -m 755 %{buildroot}/etc/sysconfig
  104. install -c -m 755 %{SOURCE2} %{buildroot}/etc/sysconfig/iptables-config
  105. sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE2} > ip6tables-config
  106. install -c -m 755 ip6tables-config %{buildroot}/etc/sysconfig/ip6tables-config
  107. %if %{with systemd}
  108. # install systemd service files
  109. install -d -m 755 %{buildroot}/%{_unitdir}
  110. install -c -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}
  111. sed -e 's;iptables;ip6tables;g' -e 's;IPv4;IPv6;g' -e 's;/usr/libexec/ip6tables;/usr/libexec/iptables;g' < %{SOURCE3} > ip6tables.service
  112. install -c -m 644 ip6tables.service %{buildroot}/%{_unitdir}
  113. # install init scripts and configuration files
  114. install -d -m 755 %{buildroot}%{script_path}
  115. install -c -m 755 %{SOURCE1} %{buildroot}%{script_path}/iptables.init
  116. sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE1} > ip6tables.init
  117. install -c -m 755 ip6tables.init %{buildroot}%{script_path}/ip6tables.init
  118. install -c -m 600 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/iptables
  119. install -c -m 600 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/ip6tables
  120. %else
  121. # install init scripts and configuration files
  122. install -d -m 755 %{buildroot}/etc/rc.d/init.d
  123. install -c -m 755 %{SOURCE1} %{buildroot}/etc/rc.d/init.d/iptables
  124. sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE1} > ip6tables.init
  125. install -c -m 755 ip6tables.init %{buildroot}/etc/rc.d/init.d/ip6tables
  126. %endif
  127. %clean
  128. rm -rf %{buildroot}
  129. %post
  130. %if %{with systemd}
  131. %systemd_post iptables.service
  132. %else
  133. /sbin/chkconfig --add iptables
  134. %endif
  135. %preun
  136. %if %{with systemd}
  137. %systemd_preun iptables.service
  138. %else
  139. if [ "$1" = 0 ]; then
  140. /sbin/chkconfig --del iptables
  141. fi
  142. %endif
  143. %if %{with systemd}
  144. %postun
  145. %systemd_postun iptables.service
  146. %endif
  147. %post ipv6
  148. %if %{with systemd}
  149. %systemd_post ip6tables.service
  150. %else
  151. /sbin/chkconfig --add ip6tables
  152. %endif
  153. %preun ipv6
  154. %if %{with systemd}
  155. %systemd_preun ip6tables.service
  156. %else
  157. if [ "$1" = 0 ]; then
  158. /sbin/chkconfig --del ip6tables
  159. fi
  160. %endif
  161. %if %{with systemd}
  162. %postun ipv6
  163. %systemd_postun ip6tables.service
  164. %endif
  165. %files
  166. %defattr(-,root,root)
  167. %license COPYING
  168. %doc INSTALL INCOMPATIBILITIES
  169. %if %{with systemd}
  170. %{_unitdir}/iptables.service
  171. %dir %{script_path}
  172. %{script_path}/iptables.init
  173. %config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables
  174. %else
  175. %attr(0755,root,root) /etc/rc.d/init.d/iptables
  176. %endif
  177. %config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables-config
  178. %config(noreplace) %attr(0600,root,root) /etc/ethertypes
  179. /sbin/arptables*
  180. /sbin/ebtables*
  181. /sbin/iptables*
  182. /sbin/nfbpf_compile
  183. /sbin/nfnl_osf
  184. /sbin/xtables-*
  185. %{_mandir}/man1/*
  186. %{_mandir}/man8/*
  187. %exclude %{_mandir}/man8/ip6tables*
  188. %dir /%{_lib}/xtables
  189. /%{_lib}/xtables/libarpt*
  190. /%{_lib}/xtables/libebt*
  191. /%{_lib}/xtables/libipt*
  192. /%{_lib}/xtables/libxt*
  193. %{_libdir}/libip*tc.so.*
  194. %{_libdir}/libxtables.so.*
  195. %{_libdir}/libipq.so.*
  196. %{_datadir}/xtables/pf.os
  197. %files ipv6
  198. %defattr(-,root,root)
  199. %if %{with systemd}
  200. %{_unitdir}/ip6tables.service
  201. %dir %{script_path}
  202. %{script_path}/ip6tables.init
  203. %config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables
  204. %else
  205. %attr(0755,root,root) /etc/rc.d/init.d/ip6tables
  206. %endif
  207. %config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables-config
  208. /sbin/ip6tables*
  209. /bin/iptables-xml
  210. %{_mandir}/man8/ip6tables*
  211. /%{_lib}/xtables/libip6t*
  212. %files devel
  213. %defattr(-,root,root)
  214. %{_includedir}/*.h
  215. %dir %{_includedir}/libiptc
  216. %{_includedir}/libiptc/*.h
  217. %dir %{_includedir}/libipulog
  218. %{_includedir}/libipulog/*.h
  219. %{_mandir}/man3/*
  220. %{_libdir}/libipq.so
  221. %{_libdir}/libip*tc.so
  222. %{_libdir}/libxtables.so
  223. %{_libdir}/pkgconfig/libiptc.pc
  224. %{_libdir}/pkgconfig/libip4tc.pc
  225. %{_libdir}/pkgconfig/libip6tc.pc
  226. %{_libdir}/pkgconfig/libipq.pc
  227. %{_libdir}/pkgconfig/xtables.pc
  228. %changelog
  229. * Fri Mar 12 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.8.7-1
  230. - new upstream release.
  231. - updated ip{,6}tables.service.
  232. - imported Patch1 from rawhide.
  233. * Sun Apr 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.8.4-2
  234. - added --wait option to ip{,6}tables.init.
  235. * Sun Apr 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.8.4-1
  236. - new upstream release.
  237. - added systemd stuff (disabled as default).
  238. * Mon Sep 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.8.3-1
  239. - new upstream release.
  240. * Sat Feb 24 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.6.2-1
  241. - new upstream release.
  242. * Tue Dec 10 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.21
  243. - new upstream release.
  244. * Fri Oct 19 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.16.3
  245. - new upstream release 1.4.16.2
  246. - update source1 url
  247. * Thu Oct 18 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.16.2
  248. - new upstream release 1.4.16.2
  249. - fix ipv6 subpackage ja discription
  250. - drop old patch
  251. - add with-xtlibdir in configure section
  252. * Fri Apr 22 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.10-1
  253. - update to 1.4.10
  254. * Thu Mar 04 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.7-1
  255. - new upstream release
  256. * Wed Aug 12 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.4-2
  257. - don't fail initscript if config file is not found.
  258. * Wed Jun 17 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.4-1
  259. - new upstream release
  260. * Mon Apr 13 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.3.2-1
  261. - new upstream release
  262. * Mon Apr 13 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.3.1-1
  263. - new upstream release
  264. - libiptc is now shared
  265. - drop patch1
  266. - update patch2
  267. - fix typo in spec file
  268. * Fri Apr 03 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.2-2
  269. - rebuild to add sign..
  270. * Wed Apr 01 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.2-1
  271. - new upstream release
  272. - spec in utf-8
  273. * Sat Jul 28 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.3.6-0vl2
  274. - changed devel package Group to Development/Libraries
  275. * Sat Nov 04 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.6-0vl1
  276. - new upstream release
  277. - remove libiptc.a from %%files
  278. - libiptc is not a public interface
  279. * Wed Sep 06 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.5-0vl4
  280. - updates Summaries and Descriptions (<BTS:0101>)
  281. * Sun Aug 13 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.5-0vl3
  282. - updates Summaries (<BTS:0101>)
  283. * Thu Jul 06 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.3.5-0vl2
  284. - add Patch10 (to include libipt_recent.so)
  285. * Tue Jun 13 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.5-0vl1
  286. - new upstream release
  287. * Tue Jun 22 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.11-0vl1
  288. - new upstream release
  289. * Thu Jun 17 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.10-0vl1
  290. - new upstream release
  291. * Fri Nov 21 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.9-0vl1
  292. - new upstream release
  293. * Thu Jul 24 2003 Takeru INOUE <takeru.inoue@gamma.ocn.ne.jp> 1.2.7a-0vl3
  294. - add ipv6 version
  295. * Sun Mar 23 2003 Takeru INOUE <takeru.inoue@gamma.ocn.ne.jp> 1.2.7a-0vl2
  296. - rebuild development version
  297. * Sun Sep 29 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.7a-0vl1
  298. - new upstream release 1.2.7a
  299. * Mon Mar 25 2002 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 1.2.6-0vl0
  300. - updated to 1.2.6
  301. * Thu Mar 07 2002 Toru Sagami <sagami@vinelinux.org> 1.2.5-0vl1
  302. - kernel24 -> kernel for Requires
  303. * Sat Mar 02 2002 Toru Sagami <sagami@vinelinux.org> 1.2.5-0vl0
  304. - updated to 1.2.5 and merged with RHL's spec
  305. - compatibilities: %%{_sbindir} -> /sbin, %%{_libdir} -> /lib
  306. * Mon Nov 19 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.2-2vl1
  307. - build for Vine Linux based on conectiva iptables package.
  308. * Sun Jun 17 2001 Harald Welte <laforge@conectiva.com>
  309. + iptables-1.2.2-2cl
  310. - fixes iptables-save / -restore problems (Closes: #3673)
  311. - fixes REJECT save problem
  312. - fixes ipv6 compile problem
  313. - moved binaries to sbindir instead of bindir
  314. * Wed May 30 2001 Harald Welte <laforge@conectiva.com>
  315. + iptables-1.2.2-1cl
  316. - updated to 1.2.2 (Closes: #3376)
  317. * Wed May 30 2001 Wanderlei Antonio Cavassin <cavassin@conectiva.com>
  318. + iptables-1.2.1a-2cl
  319. - recompiled for kernel-2.4.4-2cl (Closes: #3354)
  320. - spec file changes provided by Vagner Farias <vfarias@conectiva.com>
  321. * Fri Apr 20 2001 Harald Welte <laforge@conectiva.com>
  322. + iptables-1.2.1a-1cl
  323. - updated to version 1.2.1a because of various bugfixes
  324. * Fri Mar 16 2001 Harald Welte <laforge@conectiva.com>
  325. + iptables-1.2.1-1cl
  326. - updated to version 1.2.1
  327. * Wed Jan 10 2001 Andreas Hasenack <andreas@conectiva.com>
  328. - updated to version 1.2
  329. - added requirement for kernel >= 2.4.0
  330. * Thu Dec 14 2000 Andreas Hasenack <andreas@conectiva.com>
  331. - first package for Conectiva Linux