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