]>
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 | ||
f8cfb691 | 21 | %define rel 8 |
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 | |
1a00857d | 29 | Version: 1.31 |
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 |
1a00857d | 34 | # Source0-md5: 97ac895a67df67c28def98763023d51b |
8af0bca6 | 35 | Patch0: kernelrelease.patch |
60cfc309 JB |
36 | URL: http://xtables-addons.sourceforge.net/ |
37 | BuildRequires: autoconf >= 2.50 | |
38 | BuildRequires: automake >= 1:1.10.2 | |
3e68c602 | 39 | BuildRequires: iptables-devel >= 1.4.3 |
0330c995 | 40 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25} |
011c75bf | 41 | BuildRequires: libtool |
a88a87ac | 42 | BuildRequires: pkgconfig >= 0.9.0 |
0330c995 | 43 | BuildRequires: rpmbuild(macros) >= 1.379 |
a88a87ac TP |
44 | BuildRequires: tar >= 1.22 |
45 | BuildRequires: xz | |
3e68c602 | 46 | Requires: iptables >= 1.4.3 |
2741a7bf AM |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
bcb7e0a4 | 49 | # use macro, so adapter won't try to wrap |
028114ac | 50 | %define kpackage kernel%{_alt_kernel}-net-xtables-addons = %{version}-%{rel}@%{_kernel_ver_str} |
bcb7e0a4 | 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 | ||
028114ac | 56 | You should have %{kpackage} installed for the tools to work. |
bcb7e0a4 | 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 |
a3a7bc9c ER |
83 | # VERSION only dependency is intentional, for allowing multiple kernel pkgs and |
84 | # single userspace package installs. | |
85 | Requires: %{name} = %{version} | |
bb939eb4 ER |
86 | Suggests: xtables-geoip |
87 | Conflicts: xtables-geoip < 20090901-2 | |
64731849 TP |
88 | %{?with_dist_kernel:%requires_releq_kernel} |
89 | Requires(post,postun): /sbin/depmod | |
90 | ||
91 | %description -n kernel%{_alt_kernel}-net-xtables-addons | |
bcb7e0a4 | 92 | Kernel modules for xtables addons. |
64731849 | 93 | |
e3c9233c | 94 | %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8 |
95 | Moduły jądra dla xtables addons. | |
96 | ||
2741a7bf AM |
97 | %prep |
98 | %setup -q | |
7ad03426 | 99 | %patch0 -p1 |
2741a7bf | 100 | |
564b72e7 | 101 | %{__sed} -i -e 's#build_ipset=m#build_ipset=n#' mconfig |
102 | ||
2741a7bf | 103 | %build |
011c75bf KK |
104 | %{__libtoolize} |
105 | %{__aclocal} | |
106 | %{__autoconf} | |
60cfc309 | 107 | %{__autoheader} |
011c75bf | 108 | %{__automake} |
2741a7bf | 109 | %configure \ |
8af0bca6 | 110 | --with-kbuild=no |
7ad03426 | 111 | |
112 | %if %{with kernel} | |
8af0bca6 | 113 | srcdir=${PWD:-$(pwd)} |
8f462252 | 114 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables |
7ad03426 | 115 | %endif |
116 | ||
117 | %if %{with userspace} | |
60cfc309 JB |
118 | %{__make} \ |
119 | V=1 | |
7ad03426 | 120 | %endif |
2741a7bf AM |
121 | |
122 | %install | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
7ad03426 | 125 | %if %{with kernel} |
60cfc309 | 126 | install -d $RPM_BUILD_ROOT{/etc/modprobe.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter} |
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 .. |
fd71b2e3 | 132 | |
fd71b2e3 ER |
133 | cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf |
134 | # Set password at modprobe time. if this file is secure if properly guarded, | |
135 | # i.e only readable by root. | |
136 | #options xt_SYSRQ password=cookies | |
137 | ||
138 | # The hash algorithm can also be specified as a module option, for example, to use SHA-256 instead of the default SHA-1: | |
139 | #options xt_SYSRQ hash=sha256 | |
140 | EOF | |
60cfc309 JB |
141 | %endif |
142 | ||
143 | %if %{with userspace} | |
144 | %{__make} -C extensions install \ | |
145 | DESTDIR=$RPM_BUILD_ROOT | |
146 | ||
147 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so} | |
148 | ||
149 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 | |
150 | cp -a xtables-addons.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
151 | %endif | |
fd71b2e3 | 152 | |
2741a7bf AM |
153 | %clean |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
a88a87ac | 156 | %post -p /sbin/ldconfig |
8f462252 AM |
157 | %postun -p /sbin/ldconfig |
158 | ||
64731849 | 159 | %post -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 160 | %depmod %{_kernel_ver} |
161 | ||
64731849 | 162 | %postun -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 163 | %depmod %{_kernel_ver} |
164 | ||
64731849 | 165 | %if %{with userspace} |
2741a7bf AM |
166 | %files |
167 | %defattr(644,root,root,755) | |
8f462252 | 168 | %attr(755,root,root) %{_sbindir}/iptaccount |
60cfc309 JB |
169 | %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.* |
170 | %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0 | |
edb92c36 | 171 | %attr(755,root,root) %{_libdir}/xtables/libxt_*.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) | |
60cfc309 JB |
178 | # restricted permissions - may contain password |
179 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf | |
fcc6dd51 | 180 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz |
84556dc6 | 181 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz |
edb92c36 | 182 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz |
7ad03426 | 183 | %endif |