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