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