]>
Commit | Line | Data |
---|---|---|
8bb72a08 | 1 | # |
2741a7bf AM |
2 | # Conditional build: |
3 | %bcond_without dist_kernel # without distribution kernel | |
64731849 TP |
4 | %bcond_without kernel # don't build kernel modules |
5 | %bcond_without userspace # # don't build userspace tools | |
64731849 TP |
6 | |
7 | %if %{without kernel} | |
8 | %undefine with_dist_kernel | |
9 | %endif | |
10 | %if "%{_alt_kernel}" != "%{nil}" | |
11 | %undefine with_userspace | |
12 | %endif | |
13 | %if %{without userspace} | |
14 | # nothing to be placed to debuginfo package | |
15 | %define _enable_debug_packages 0 | |
16 | %endif | |
17 | ||
22d06cd1 | 18 | %define rel 4 |
fff03056 JB |
19 | Summary: Additional extensions for xtables packet filtering system |
20 | Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables | |
2741a7bf | 21 | Name: xtables-addons |
7a84f6be | 22 | Version: 1.33 |
64731849 | 23 | Release: %{rel} |
fff03056 | 24 | License: GPL v2 |
64731849 | 25 | Group: Networking/Admin |
8f462252 | 26 | Source0: http://downloads.sourceforge.net/xtables-addons/%{name}-%{version}.tar.xz |
7a84f6be | 27 | # Source0-md5: db80618d505bf7a5b9d576d83e3f0f80 |
8af0bca6 | 28 | Patch0: kernelrelease.patch |
60cfc309 JB |
29 | URL: http://xtables-addons.sourceforge.net/ |
30 | BuildRequires: autoconf >= 2.50 | |
31 | BuildRequires: automake >= 1:1.10.2 | |
3e68c602 | 32 | BuildRequires: iptables-devel >= 1.4.3 |
0330c995 | 33 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25} |
011c75bf | 34 | BuildRequires: libtool |
a88a87ac | 35 | BuildRequires: pkgconfig >= 0.9.0 |
0330c995 | 36 | BuildRequires: rpmbuild(macros) >= 1.379 |
a88a87ac TP |
37 | BuildRequires: tar >= 1.22 |
38 | BuildRequires: xz | |
3e68c602 | 39 | Requires: iptables >= 1.4.3 |
2741a7bf AM |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
bcb7e0a4 | 42 | # use macro, so adapter won't try to wrap |
028114ac | 43 | %define kpackage kernel%{_alt_kernel}-net-xtables-addons = %{version}-%{rel}@%{_kernel_ver_str} |
bcb7e0a4 | 44 | |
2741a7bf | 45 | %description |
fff03056 JB |
46 | xtables-addons is the proclaimed successor to patch-o-matic(-ng). It |
47 | contains extensions that were not accepted in the main | |
48 | xtables/iptables package. | |
2741a7bf | 49 | |
fff03056 JB |
50 | For the tools to work, you should install kernel modules, which could |
51 | be found in %{kpackage}. | |
bcb7e0a4 | 52 | |
2741a7bf | 53 | %description -l pl.UTF-8 |
fff03056 JB |
54 | xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia, |
55 | które nie zostały zaakceptowane do głównego pakietu xtables/iptables. | |
2741a7bf | 56 | |
fff03056 JB |
57 | Aby narzędzia działały należy zainstalować moduły jądra, które można |
58 | znaleźć w pakiecie %{kpackage}. | |
2741a7bf | 59 | |
64731849 | 60 | %package -n kernel%{_alt_kernel}-net-xtables-addons |
bcb7e0a4 | 61 | Summary: Kernel modules for xtables addons |
fff03056 | 62 | Summary(pl.UTF-8): Moudły jądra dla rozszerzeń z pakietu xtables-addons |
bcb7e0a4 | 63 | Release: %{rel}@%{_kernel_ver_str} |
64731849 | 64 | Group: Base/Kernel |
a3a7bc9c ER |
65 | # VERSION only dependency is intentional, for allowing multiple kernel pkgs and |
66 | # single userspace package installs. | |
67 | Requires: %{name} = %{version} | |
bb939eb4 ER |
68 | Suggests: xtables-geoip |
69 | Conflicts: xtables-geoip < 20090901-2 | |
64731849 TP |
70 | %{?with_dist_kernel:%requires_releq_kernel} |
71 | Requires(post,postun): /sbin/depmod | |
72 | ||
73 | %description -n kernel%{_alt_kernel}-net-xtables-addons | |
bcb7e0a4 | 74 | Kernel modules for xtables addons. |
64731849 | 75 | |
e3c9233c | 76 | %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8 |
fff03056 | 77 | Moduły jądra dla rozszerzeń z pakietu xtables-addons. |
e3c9233c | 78 | |
2741a7bf AM |
79 | %prep |
80 | %setup -q | |
7ad03426 | 81 | %patch0 -p1 |
2741a7bf | 82 | |
83cb19e1 | 83 | %{__sed} -i -e 's#build_ipset4=m#build_ipset4=#' mconfig |
564b72e7 | 84 | |
2741a7bf | 85 | %build |
011c75bf KK |
86 | %{__libtoolize} |
87 | %{__aclocal} | |
88 | %{__autoconf} | |
60cfc309 | 89 | %{__autoheader} |
011c75bf | 90 | %{__automake} |
2741a7bf | 91 | %configure \ |
83cb19e1 | 92 | --without-kbuild |
7ad03426 | 93 | |
94 | %if %{with kernel} | |
8af0bca6 | 95 | srcdir=${PWD:-$(pwd)} |
8f462252 | 96 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables |
7ad03426 | 97 | %endif |
98 | ||
99 | %if %{with userspace} | |
60cfc309 JB |
100 | %{__make} \ |
101 | V=1 | |
7ad03426 | 102 | %endif |
2741a7bf AM |
103 | |
104 | %install | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
7ad03426 | 107 | %if %{with kernel} |
60cfc309 | 108 | install -d $RPM_BUILD_ROOT{/etc/modprobe.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter} |
84556dc6 | 109 | cd extensions |
fcc6dd51 | 110 | install iptable_rawpost.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter |
84556dc6 | 111 | %install_kernel_modules -m compat_xtables -d kernel/net/netfilter |
fcc6dd51 | 112 | install -p {ACCOUNT/,pknock/,}xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter |
84556dc6 | 113 | cd .. |
fd71b2e3 | 114 | |
fd71b2e3 | 115 | cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf |
fff03056 | 116 | # Set password at modprobe time. This file is secure if properly guarded, |
fd71b2e3 ER |
117 | # i.e only readable by root. |
118 | #options xt_SYSRQ password=cookies | |
119 | ||
120 | # The hash algorithm can also be specified as a module option, for example, to use SHA-256 instead of the default SHA-1: | |
121 | #options xt_SYSRQ hash=sha256 | |
122 | EOF | |
60cfc309 JB |
123 | %endif |
124 | ||
125 | %if %{with userspace} | |
126 | %{__make} -C extensions install \ | |
127 | DESTDIR=$RPM_BUILD_ROOT | |
128 | ||
129 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so} | |
130 | ||
131 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 | |
132 | cp -a xtables-addons.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
133 | %endif | |
fd71b2e3 | 134 | |
2741a7bf AM |
135 | %clean |
136 | rm -rf $RPM_BUILD_ROOT | |
137 | ||
a88a87ac | 138 | %post -p /sbin/ldconfig |
8f462252 AM |
139 | %postun -p /sbin/ldconfig |
140 | ||
64731849 | 141 | %post -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 142 | %depmod %{_kernel_ver} |
143 | ||
64731849 | 144 | %postun -n kernel%{_alt_kernel}-net-xtables-addons |
0330c995 | 145 | %depmod %{_kernel_ver} |
146 | ||
64731849 | 147 | %if %{with userspace} |
2741a7bf AM |
148 | %files |
149 | %defattr(644,root,root,755) | |
83cb19e1 | 150 | %doc README doc/{README.psd,changelog.txt} |
8f462252 | 151 | %attr(755,root,root) %{_sbindir}/iptaccount |
60cfc309 JB |
152 | %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.* |
153 | %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0 | |
edb92c36 | 154 | %attr(755,root,root) %{_libdir}/xtables/libxt_*.so |
8af0bca6 | 155 | %{_mandir}/man8/xtables-addons.8* |
7ad03426 | 156 | %endif |
64731849 | 157 | |
7ad03426 | 158 | %if %{with kernel} |
64731849 TP |
159 | %files -n kernel%{_alt_kernel}-net-xtables-addons |
160 | %defattr(644,root,root,755) | |
60cfc309 JB |
161 | # restricted permissions - may contain password |
162 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf | |
fcc6dd51 | 163 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz |
84556dc6 | 164 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz |
edb92c36 | 165 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz |
7ad03426 | 166 | %endif |