]>
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 | |
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 | ||
8af06114 | 21 | %define rel 2 |
e0de918a | 22 | %define pname xtables-addons |
fff03056 JB |
23 | Summary: Additional extensions for xtables packet filtering system |
24 | Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables | |
e0de918a | 25 | Name: %{pname}%{_alt_kernel} |
1931c513 | 26 | Version: 2.3 |
64731849 | 27 | Release: %{rel} |
fff03056 | 28 | License: GPL v2 |
64731849 | 29 | Group: Networking/Admin |
e0de918a | 30 | Source0: http://downloads.sourceforge.net/xtables-addons/%{pname}-%{version}.tar.xz |
1931c513 | 31 | # Source0-md5: 7d942729c365a549513511061f74c3e3 |
60cfc309 | 32 | URL: http://xtables-addons.sourceforge.net/ |
bec39f55 | 33 | BuildRequires: autoconf >= 2.65 |
13dd3c36 | 34 | BuildRequires: automake >= 1:1.11 |
84da2698 | 35 | BuildRequires: iptables-devel >= 1.4.5 |
6ebf856d | 36 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:3.7} |
011c75bf | 37 | BuildRequires: libtool |
a88a87ac | 38 | BuildRequires: pkgconfig >= 0.9.0 |
0330c995 | 39 | BuildRequires: rpmbuild(macros) >= 1.379 |
a88a87ac TP |
40 | BuildRequires: tar >= 1.22 |
41 | BuildRequires: xz | |
84da2698 | 42 | Requires: iptables >= 1.4.5 |
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} |
2741a7bf AM |
85 | |
86 | %build | |
011c75bf KK |
87 | %{__libtoolize} |
88 | %{__aclocal} | |
89 | %{__autoconf} | |
60cfc309 | 90 | %{__autoheader} |
011c75bf | 91 | %{__automake} |
2741a7bf | 92 | %configure \ |
83cb19e1 | 93 | --without-kbuild |
7ad03426 | 94 | |
95 | %if %{with kernel} | |
8af0bca6 | 96 | srcdir=${PWD:-$(pwd)} |
8f462252 | 97 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables |
7ad03426 | 98 | %endif |
99 | ||
100 | %if %{with userspace} | |
60cfc309 JB |
101 | %{__make} \ |
102 | V=1 | |
7ad03426 | 103 | %endif |
2741a7bf AM |
104 | |
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
7ad03426 | 108 | %if %{with kernel} |
329d0a27 JR |
109 | %install_kernel_modules -m extensions/iptable_rawpost -d kernel/net/ipv4/netfilter |
110 | for drv in extensions/compat_xtables.ko extensions/{ACCOUNT/,pknock/,}xt_*.ko ; do | |
111 | %install_kernel_modules -m ${drv%.ko} -d kernel/net/netfilter | |
112 | done | |
fd71b2e3 | 113 | |
329d0a27 | 114 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
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 | ||
329d0a27 JR |
120 | # The hash algorithm can also be specified as a module option, for example, |
121 | # to use SHA-256 instead of the default SHA-1: | |
fd71b2e3 ER |
122 | #options xt_SYSRQ hash=sha256 |
123 | EOF | |
60cfc309 JB |
124 | %endif |
125 | ||
126 | %if %{with userspace} | |
127 | %{__make} -C extensions install \ | |
128 | DESTDIR=$RPM_BUILD_ROOT | |
16932b07 JB |
129 | %{__make} install-man \ |
130 | DESTDIR=$RPM_BUILD_ROOT | |
60cfc309 JB |
131 | |
132 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so} | |
60cfc309 | 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 |
32aaedb1 | 155 | %{_mandir}/man8/iptaccount.8* |
8af0bca6 | 156 | %{_mandir}/man8/xtables-addons.8* |
7ad03426 | 157 | %endif |
64731849 | 158 | |
7ad03426 | 159 | %if %{with kernel} |
64731849 TP |
160 | %files -n kernel%{_alt_kernel}-net-xtables-addons |
161 | %defattr(644,root,root,755) | |
60cfc309 JB |
162 | # restricted permissions - may contain password |
163 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf | |
fcc6dd51 | 164 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz |
84556dc6 | 165 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz |
edb92c36 | 166 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz |
7ad03426 | 167 | %endif |