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