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