]> git.pld-linux.org Git - packages/xtables-addons.git/blame_incremental - xtables-addons.spec
Release 3 (by relup.sh)
[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 3
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.16
30Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
31License: GPL v2
32Group: Networking/Admin
33Source0: https://inai.de/files/xtables-addons/%{pname}-%{version}.tar.xz
34# Source0-md5: 35cf79f1c55ba054fd8cb10d82bf73a3
35URL: http://xtables-addons.sourceforge.net/
36BuildRequires: autoconf >= 2.65
37BuildRequires: automake >= 1:1.11
38BuildRequires: iptables-devel >= 1.6.0
39%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:4.18.0}}
40BuildRequires: libtool
41BuildRequires: pkgconfig >= 1:0.9.0
42BuildRequires: rpmbuild(macros) >= 1.746
43BuildRequires: tar >= 1.22
44BuildRequires: xz
45Requires: iptables >= 1.6.0
46Obsoletes: iptables-ipp2p
47BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
48
49%define _duplicate_files_terminate_build 0
50
51%description
52xtables-addons is the proclaimed successor to patch-o-matic(-ng). It
53contains extensions that were not accepted in the main
54xtables/iptables package.
55
56For the tools to work, you should install kernel modules, which could
57be found in kernel*-net-xtables-addons.
58
59%description -l pl.UTF-8
60xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia,
61które nie zostały zaakceptowane do głównego pakietu xtables/iptables.
62
63Aby narzędzia działały należy zainstalować moduły jądra, które można
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\
78%requires_releq_kernel\
79Requires(postun): %releq_kernel\
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\
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\
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
109%{?with_kernel:%{expand:%create_kernel_packages}}
110
111%prep
112%setup -q -n %{pname}-%{version}
113
114%build
115%configure \
116 --without-kbuild
117
118%{?with_kernel:%{expand:%build_kernel_packages}}
119
120%if %{with userspace}
121%{__make} \
122 V=1
123%endif
124
125%install
126rm -rf $RPM_BUILD_ROOT
127
128%if %{with kernel}
129install -d $RPM_BUILD_ROOT/etc/modprobe.d
130
131cp -a installed/* $RPM_BUILD_ROOT
132
133cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf
134# Set password at modprobe time. This file is secure if properly guarded,
135# i.e only readable by root.
136#options xt_SYSRQ password=cookies
137
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:
140#options xt_SYSRQ hash=sha256
141EOF
142%endif
143
144%if %{with userspace}
145%{__make} -C extensions install \
146 DESTDIR=$RPM_BUILD_ROOT
147%{__make} install-man \
148 DESTDIR=$RPM_BUILD_ROOT
149
150%{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so}
151%endif
152
153%clean
154rm -rf $RPM_BUILD_ROOT
155
156%post -p /sbin/ldconfig
157%postun -p /sbin/ldconfig
158
159%if %{with userspace}
160%files
161%defattr(644,root,root,755)
162%doc README doc/{README.psd,changelog.txt}
163%attr(755,root,root) %{_sbindir}/iptaccount
164%attr(755,root,root) %{_sbindir}/pknlusr
165%attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.*
166%attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0
167%attr(755,root,root) %{_libdir}/xtables/libxt_*.so
168%{_mandir}/man8/iptaccount.8*
169%{_mandir}/man8/xtables-addons.8*
170%{_mandir}/man8/pknlusr.8*
171%endif
This page took 0.025283 seconds and 4 git commands to generate.