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