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