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