]> git.pld-linux.org Git - packages/xtables-addons.git/blame_incremental - xtables-addons.spec
- fix building with kernel 5.2
[packages/xtables-addons.git] / xtables-addons.spec
... / ...
CommitLineData
1#
2# UPDATE WARNING: xtables-addons 3.0 support only kernels 4.15+
3# xtables-addons 2.0 (XTADDONS_2 branch) support kernels 3.7 - 4.14
4#
5# Conditional build:
6%bcond_without kernel # don't build kernel modules
7%bcond_without userspace # don't build userspace tools
8%bcond_with verbose # verbose build (V=1)
9
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
19%if %{without userspace}
20# nothing to be placed to debuginfo package
21%define _enable_debug_packages 0
22%endif
23
24%define rel 2
25%define pname xtables-addons
26Summary: Additional extensions for xtables packet filtering system
27Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables
28Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
29Version: 3.3
30Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
31License: GPL v2
32Group: Networking/Admin
33Source0: http://downloads.sourceforge.net/xtables-addons/%{pname}-%{version}.tar.xz
34# Source0-md5: e99ea681b7b3866a581390e1b3ea185e
35Patch0: kernel-5.2.patch
36URL: http://xtables-addons.sourceforge.net/
37BuildRequires: autoconf >= 2.65
38BuildRequires: automake >= 1:1.11
39BuildRequires: iptables-devel >= 1.6.0
40%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:4.18.0}}
41BuildRequires: libtool
42BuildRequires: pkgconfig >= 0.9.0
43BuildRequires: rpmbuild(macros) >= 1.678
44BuildRequires: tar >= 1.22
45BuildRequires: xz
46Requires: iptables >= 1.6.0
47Obsoletes: iptables-ipp2p
48BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
49
50%define _duplicate_files_terminate_build 0
51
52%description
53xtables-addons is the proclaimed successor to patch-o-matic(-ng). It
54contains extensions that were not accepted in the main
55xtables/iptables package.
56
57For the tools to work, you should install kernel modules, which could
58be found in kernel*-net-xtables-addons.
59
60%description -l pl.UTF-8
61xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia,
62które nie zostały zaakceptowane do głównego pakietu xtables/iptables.
63
64Aby narzędzia działały należy zainstalować moduły jądra, które można
65znaleźć w pakiecie kernel*-net-xtables-addons.
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\
79%requires_releq_kernel\
80Requires(postun): %releq_kernel\
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/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()\
103srcdir=${PWD:-$(pwd)}\
104%build_kernel_modules XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables\
105for 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\
107done\
108%{nil}
109
110%{?with_kernel:%{expand:%create_kernel_packages}}
111
112%prep
113%setup -q -n %{pname}-%{version}
114%patch0 -p1
115
116%build
117%configure \
118 --without-kbuild
119
120%{?with_kernel:%{expand:%build_kernel_packages}}
121
122%if %{with userspace}
123%{__make} \
124 V=1
125%endif
126
127%install
128rm -rf $RPM_BUILD_ROOT
129
130%if %{with kernel}
131install -d $RPM_BUILD_ROOT/etc/modprobe.d
132
133cp -a installed/* $RPM_BUILD_ROOT
134
135cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf
136# Set password at modprobe time. This file is secure if properly guarded,
137# i.e only readable by root.
138#options xt_SYSRQ password=cookies
139
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:
142#options xt_SYSRQ hash=sha256
143EOF
144%endif
145
146%if %{with userspace}
147%{__make} -C extensions install \
148 DESTDIR=$RPM_BUILD_ROOT
149%{__make} install-man \
150 DESTDIR=$RPM_BUILD_ROOT
151
152%{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so}
153%endif
154
155%clean
156rm -rf $RPM_BUILD_ROOT
157
158%post -p /sbin/ldconfig
159%postun -p /sbin/ldconfig
160
161%if %{with userspace}
162%files
163%defattr(644,root,root,755)
164%doc README doc/{README.psd,changelog.txt}
165%attr(755,root,root) %{_sbindir}/iptaccount
166%attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.*
167%attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0
168%attr(755,root,root) %{_libdir}/xtables/libxt_*.so
169%{_mandir}/man8/iptaccount.8*
170%{_mandir}/man8/xtables-addons.8*
171%endif
This page took 0.049915 seconds and 4 git commands to generate.