iptables-vl.spec 12 KB

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