1 |
# buildforkernels macro hint: when you build a new version or a new release |
2 |
# that contains bugfixes or other improvements then you must disable the |
3 |
# "buildforkernels newest" macro for just that build; immediately after |
4 |
# queuing that build enable the macro again for subsequent builds; that way |
5 |
# a new akmod package will only get build when a new one is actually needed |
6 |
|
7 |
%global buildforkernels current |
8 |
|
9 |
#FIXME xtables-kmod doesn't use the appropriate cflags |
10 |
%global debug_package %{nil} |
11 |
|
12 |
%define name xtables-addons-kmod |
13 |
%define name_src xtables-addons |
14 |
%define version 2.14 |
15 |
%define release 02 |
16 |
Summary: %{name} is a set of additional extensions for the Xtables packet filter (modules kmod ONLY). |
17 |
Name: %{name} |
18 |
Version: %{version} |
19 |
Release: %{release}%{?dist} |
20 |
Distribution: SME Server |
21 |
License: GNU GPL version 2 |
22 |
Group: SME Server/addon |
23 |
Source: %{name_src}-%{version}.tar.xz |
24 |
URL: http://xtables-addons.sourceforge.net |
25 |
Patch0: %{name_src}-2.14-init.patch |
26 |
Packager: Michel Begue <mab974@gmail.com> |
27 |
|
28 |
Requires: smeserver-release >= 10.0 |
29 |
Requires: xtables-addons >= 2.14 |
30 |
BuildRequires: e-smith-devtools |
31 |
BuildRequires: iptables-devel |
32 |
BuildRequires: %{_bindir}/kmodtool |
33 |
ExclusiveArch: x86_64 |
34 |
Requires(post): /sbin/weak-modules |
35 |
Requires(postun): /sbin/weak-modules |
36 |
|
37 |
%{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } |
38 |
|
39 |
# kmodtool does its magic here |
40 |
%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } |
41 |
|
42 |
%description |
43 |
%{name} is a set of additional extensions for the Xtables packet filter that is present in the Linux kernel (modules kmod ONLY). |
44 |
It is just a "kernel update" release. |
45 |
|
46 |
%changelog |
47 |
* Tue Jul 21 2020 Michel Begue <mab974@gmail.com> 2.14-02.sme |
48 |
- change in install workaround. copy /usr/lib to /lib |
49 |
|
50 |
* Wed Apr 15 2020 Michel Begue <mab974@gmail.com> 2.14-01.sme |
51 |
- initial release 2.14 for sme10 |
52 |
- changes for using GeoIP2 databases (download and build (-g2) + fetch) |
53 |
- dependency : perl-IO-Socket-INET6 (bug sa-update) |
54 |
- set XT_GEOIP_MAX from 15 to 50 |
55 |
- comment out "print STDERR" counters in xt_geoip-build |
56 |
- add license_key in download script of bases |
57 |
- comment out build_TARPIT (Centos 7 compatibility pbm) |
58 |
|
59 |
%prep |
60 |
# error out if there was something wrong with kmodtool |
61 |
%{?kmodtool_check} |
62 |
|
63 |
# print kmodtool output for debugging purposes: |
64 |
kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null |
65 |
|
66 |
%setup -q -c -T -a 0 |
67 |
%patch0 |
68 |
|
69 |
for kernel_version in %{?kernel_versions} ; do |
70 |
cp -a xtables-addons-%{version} _kmod_build_${kernel_version%%___*} |
71 |
done |
72 |
|
73 |
%build |
74 |
for kernel_version in %{?kernel_versions} ; do |
75 |
if ! grep -q 'XT_TARGET_TEE=m' %{_usrsrc}/kernels/${kernel_version%%___*}/.config; then |
76 |
echo ' >>>>> sed TEE' |
77 |
sed -i 's/build_TEE=/build_TEE=m/' _kmod_build_${kernel_version%%___*}/mconfig |
78 |
fi |
79 |
if ! grep -q 'XT_TARGET_CHECKSUM=m' %{_usrsrc}/kernels/${kernel_version%%___*}/.config; then |
80 |
echo ' >>>>> sed CHECKSUM' |
81 |
sed -i 's/build_CHECKSUM=/build_CHECKSUM=m/' _kmod_build_${kernel_version%%___*}/mconfig |
82 |
fi |
83 |
export XA_ABSTOPSRCDIR=${PWD}/_kmod_build_${kernel_version%%___*} |
84 |
make %{?_smp_mflags} V=1 -C "${kernel_version##*___}" M=${PWD}/_kmod_build_${kernel_version%%___*}/extensions modules |
85 |
done |
86 |
|
87 |
%install |
88 |
%{__rm} -rf %{buildroot} |
89 |
|
90 |
for kernel_version in %{?kernel_versions} ; do |
91 |
export XA_ABSTOPSRCDIR=${PWD}/_kmod_build_${kernel_version%%___*} |
92 |
make %{?_smp_mflags} V=1 -C "${kernel_version##*___}" M=${PWD}/_kmod_build_${kernel_version%%___*}/extensions _emodinst_ INSTALL_MOD_PATH=%{buildroot}%{_prefix} ext-mod-dir=%{kmodinstdir_postfix} |
93 |
# workaround to avoid error at file stage, it seems that we are installing it in /usr/lib and files script is waiting it in /lib... |
94 |
#mv %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/../lib |
95 |
cp -R %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/../lib |
96 |
done |
97 |
%{?akmod_install} |
98 |
|
99 |
%clean |
100 |
%{__rm} -rf %{buildroot} |
101 |
|
102 |
%pre |
103 |
|
104 |
%post -n %{name} |
105 |
/sbin/weak-modules --add-kernel |
106 |
|
107 |
%preun |
108 |
|
109 |
%postun -n %{name} |
110 |
/sbin/weak-modules --add-kernel |
111 |
|
112 |
%files |
113 |
%defattr(-, root, root, 0755) |
114 |
/lib/modules/* |
115 |
|