]>
Commit | Line | Data |
---|---|---|
8bb72a08 | 1 | # TODO |
0330c995 | 2 | # - descriptions |
9afca0fd ER |
3 | # - subpackage for geoip due extra deps? (it goes silly as then need THREE |
4 | # packages installed for functionality (userspace,kernel,data packages...) | |
8bb72a08 | 5 | # |
2741a7bf AM |
6 | # Conditional build: |
7 | %bcond_without dist_kernel # without distribution kernel | |
64731849 TP |
8 | %bcond_without kernel # don't build kernel modules |
9 | %bcond_without userspace # # don't build userspace tools | |
10 | %bcond_with verbose # verbose build (V=1) | |
11 | ||
12 | %if %{without kernel} | |
13 | %undefine with_dist_kernel | |
14 | %endif | |
15 | %if "%{_alt_kernel}" != "%{nil}" | |
16 | %undefine with_userspace | |
17 | %endif | |
18 | %if %{without userspace} | |
19 | # nothing to be placed to debuginfo package | |
20 | %define _enable_debug_packages 0 | |
21 | %endif | |
22 | ||
8f462252 | 23 | %define rel 1 |
2741a7bf AM |
24 | Summary: Extensible packet filtering system && extensible NAT system |
25 | Summary(pl.UTF-8): System filtrowania pakietów oraz system translacji adresów (NAT) | |
26 | Summary(pt_BR.UTF-8): Ferramenta para controlar a filtragem de pacotes no kernel-2.6.x | |
27 | Summary(ru.UTF-8): Утилиты для управления пакетными фильтрами ядра Linux | |
28 | Summary(uk.UTF-8): Утиліти для керування пакетними фільтрами ядра Linux | |
29 | Summary(zh_CN.UTF-8): Linux内核包过滤管理工具 | |
30 | Name: xtables-addons | |
8f462252 | 31 | Version: 1.27 |
64731849 | 32 | Release: %{rel} |
2741a7bf | 33 | License: GPL |
64731849 | 34 | Group: Networking/Admin |
8f462252 AM |
35 | Source0: http://downloads.sourceforge.net/xtables-addons/%{name}-%{version}.tar.xz |
36 | # Source0-md5: f4f65ce5361d7f8c0908ca3db37fa8ee | |
564b72e7 | 37 | URL: http://xtables-addons.sourceforge.net/ |
8af0bca6 | 38 | Patch0: kernelrelease.patch |
011c75bf KK |
39 | BuildRequires: autoconf |
40 | BuildRequires: automake | |
3e68c602 | 41 | BuildRequires: iptables-devel >= 1.4.3 |
0330c995 | 42 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25} |
011c75bf | 43 | BuildRequires: libtool |
62f40bbf | 44 | BuildRequires: pkgconfig |
0330c995 | 45 | BuildRequires: rpmbuild(macros) >= 1.379 |
3e68c602 | 46 | Requires: iptables >= 1.4.3 |
2741a7bf AM |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
bcb7e0a4 ER |
49 | # use macro, so adapter won't try to wrap |
50 | %define kpackage kernel%{_alt_kernel}-net-xtables-addons = %{rel}@%{_kernel_ver_str} | |
51 | ||
2741a7bf AM |
52 | %description |
53 | An extensible NAT system, and an extensible packet filtering system. | |
54 | Replacement of ipchains in 2.6 and higher kernels. | |
55 | ||
bcb7e0a4 ER |
56 | You need %{kpackage} installed for the tools to work. |
57 | ||
2741a7bf AM |
58 | %description -l pl.UTF-8 |
59 | Wydajny system translacji adresów (NAT) oraz system filtrowania | |
60 | pakietów. Zamiennik ipchains w jądrach 2.6 i nowszych. | |
61 | ||
62 | %description -l pt_BR.UTF-8 | |
63 | Esta é a ferramenta que controla o código de filtragem de pacotes do | |
64 | kernel 2.6, obsoletando ipchains. Com esta ferramenta você pode | |
65 | configurar filtros de pacotes, NAT, mascaramento (masquerading), | |
66 | regras dinâmicas (stateful inspection), etc. | |
67 | ||
68 | %description -l ru.UTF-8 | |
69 | xtables-addons управляют кодом фильтрации сетевых пакетов в ядре | |
70 | Linux. Они позволяют вам устанавливать межсетевые экраны (firewalls) и | |
71 | IP маскарадинг, и т.п. | |
72 | ||
73 | %description -l uk.UTF-8 | |
74 | xtables-addons управляють кодом фільтрації пакетів мережі в ядрі | |
75 | Linux. Вони дозволяють вам встановлювати міжмережеві екрани | |
76 | (firewalls) та IP маскарадинг, тощо. | |
77 | ||
64731849 | 78 | %package -n kernel%{_alt_kernel}-net-xtables-addons |
bcb7e0a4 | 79 | Summary: Kernel modules for xtables addons |
e3c9233c | 80 | Summary(pl.UTF-8): Moudły jądra dla xtables addons |
bcb7e0a4 | 81 | Release: %{rel}@%{_kernel_ver_str} |
64731849 | 82 | Group: Base/Kernel |
8af0bca6 | 83 | Conflicts: xtables-geoip < 20090901-2 |
a3a7bc9c ER |
84 | # VERSION only dependency is intentional, for allowing multiple kernel pkgs and |
85 | # single userspace package installs. | |
86 | Requires: %{name} = %{version} | |
64731849 TP |
87 | %{?with_dist_kernel:%requires_releq_kernel} |
88 | Requires(post,postun): /sbin/depmod | |
89 | ||
90 | %description -n kernel%{_alt_kernel}-net-xtables-addons | |
bcb7e0a4 | 91 | Kernel modules for xtables addons. |
64731849 | 92 | |
e3c9233c | 93 | %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8 |
94 | Moduły jądra dla xtables addons. | |
95 | ||
2741a7bf AM |
96 | %prep |
97 | %setup -q | |
7ad03426 | 98 | %patch0 -p1 |
2741a7bf | 99 | |
564b72e7 | 100 | %{__sed} -i -e 's#build_ipset=m#build_ipset=n#' mconfig |
101 | ||
2741a7bf | 102 | %build |
011c75bf KK |
103 | %{__libtoolize} |
104 | %{__aclocal} | |
105 | %{__autoconf} | |
106 | %{__automake} | |
2741a7bf | 107 | %configure \ |
8af0bca6 | 108 | --with-kbuild=no |
7ad03426 | 109 | |
110 | %if %{with kernel} | |
8af0bca6 | 111 | srcdir=${PWD:-$(pwd)} |
8f462252 | 112 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables |
7ad03426 | 113 | %endif |
114 | ||
115 | %if %{with userspace} | |
8af0bca6 | 116 | %{__make} |
7ad03426 | 117 | %endif |
2741a7bf AM |
118 | |
119 | %install | |
120 | rm -rf $RPM_BUILD_ROOT | |
f0af06f8 | 121 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter,%{_mandir}/man8} |
2741a7bf | 122 | |
7ad03426 | 123 | %if %{with kernel} |
84556dc6 PS |
124 | cd extensions |
125 | %install_kernel_modules -m compat_xtables -d kernel/net/netfilter | |
bcb7e0a4 | 126 | install -p xt_*ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter |
84556dc6 | 127 | cd .. |
7ad03426 | 128 | %endif |
84556dc6 | 129 | |
7ad03426 | 130 | %if %{with userspace} |
84556dc6 PS |
131 | %{__make} -C extensions install \ |
132 | DESTDIR=$RPM_BUILD_ROOT | |
84556dc6 | 133 | |
8af0bca6 ER |
134 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 |
135 | cp -a xtables-addons.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
7ad03426 | 136 | %endif |
2741a7bf AM |
137 | |
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
8f462252 AM |
141 | %post -p /sbin/ldconfig |
142 | %postun -p /sbin/ldconfig | |
143 | ||
64731849 | 144 | %post -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 145 | %depmod %{_kernel_ver} |
146 | ||
64731849 | 147 | %postun -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 148 | %depmod %{_kernel_ver} |
149 | ||
64731849 | 150 | %if %{with userspace} |
2741a7bf AM |
151 | %files |
152 | %defattr(644,root,root,755) | |
8f462252 | 153 | %attr(755,root,root) %{_sbindir}/iptaccount |
edb92c36 | 154 | %attr(755,root,root) %{_libdir}/xtables/libxt_*.so |
8f462252 | 155 | %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.* |
8af0bca6 | 156 | %{_mandir}/man8/xtables-addons.8* |
7ad03426 | 157 | %endif |
64731849 | 158 | |
7ad03426 | 159 | %if %{with kernel} |
64731849 TP |
160 | %files -n kernel%{_alt_kernel}-net-xtables-addons |
161 | %defattr(644,root,root,755) | |
84556dc6 | 162 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz |
edb92c36 | 163 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz |
7ad03426 | 164 | %endif |