- rebuild for kernel-3.9.11-1
[packages/xtables-addons.git] / xtables-addons.spec
CommitLineData
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
8540e92b 21%define rel 8
e0de918a 22%define pname xtables-addons
fff03056
JB
23Summary: Additional extensions for xtables packet filtering system
24Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables
e0de918a 25Name: %{pname}%{_alt_kernel}
93b4e0d1 26Version: 2.2
64731849 27Release: %{rel}
fff03056 28License: GPL v2
64731849 29Group: Networking/Admin
e0de918a 30Source0: http://downloads.sourceforge.net/xtables-addons/%{pname}-%{version}.tar.xz
93b4e0d1 31# Source0-md5: bc60abaa3cacc907f646ec6f873054f5
60cfc309 32URL: http://xtables-addons.sourceforge.net/
bec39f55 33BuildRequires: autoconf >= 2.65
13dd3c36 34BuildRequires: automake >= 1:1.11
84da2698 35BuildRequires: iptables-devel >= 1.4.5
6ebf856d 36%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:3.7}
011c75bf 37BuildRequires: libtool
a88a87ac 38BuildRequires: pkgconfig >= 0.9.0
0330c995 39BuildRequires: rpmbuild(macros) >= 1.379
a88a87ac
TP
40BuildRequires: tar >= 1.22
41BuildRequires: xz
84da2698 42Requires: iptables >= 1.4.5
3a1015f9 43Obsoletes: iptables-ipp2p
e0de918a 44BuildRoot: %{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
50xtables-addons is the proclaimed successor to patch-o-matic(-ng). It
51contains extensions that were not accepted in the main
52xtables/iptables package.
2741a7bf 53
fff03056
JB
54For the tools to work, you should install kernel modules, which could
55be found in %{kpackage}.
bcb7e0a4 56
2741a7bf 57%description -l pl.UTF-8
fff03056
JB
58xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia,
59które nie zostały zaakceptowane do głównego pakietu xtables/iptables.
2741a7bf 60
fff03056
JB
61Aby narzędzia działały należy zainstalować moduły jądra, które można
62znaleźć w pakiecie %{kpackage}.
2741a7bf 63
64731849 64%package -n kernel%{_alt_kernel}-net-xtables-addons
bcb7e0a4 65Summary: Kernel modules for xtables addons
fff03056 66Summary(pl.UTF-8): Moudły jądra dla rozszerzeń z pakietu xtables-addons
bcb7e0a4 67Release: %{rel}@%{_kernel_ver_str}
64731849 68Group: Base/Kernel
a3a7bc9c
ER
69# VERSION only dependency is intentional, for allowing multiple kernel pkgs and
70# single userspace package installs.
e0de918a 71Requires: %{pname} = %{version}
bb939eb4
ER
72Suggests: xtables-geoip
73Conflicts: xtables-geoip < 20090901-2
64731849
TP
74%{?with_dist_kernel:%requires_releq_kernel}
75Requires(post,postun): /sbin/depmod
76
77%description -n kernel%{_alt_kernel}-net-xtables-addons
bcb7e0a4 78Kernel modules for xtables addons.
64731849 79
e3c9233c 80%description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8
fff03056 81Moduł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 96srcdir=${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
106rm -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
110for drv in extensions/compat_xtables.ko extensions/{ACCOUNT/,pknock/,}xt_*.ko ; do
111%install_kernel_modules -m ${drv%.ko} -d kernel/net/netfilter
112done
fd71b2e3 113
329d0a27 114install -d $RPM_BUILD_ROOT/etc/modprobe.d
fd71b2e3 115cat <<'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
123EOF
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
136rm -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
This page took 0.147232 seconds and 4 git commands to generate.