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 akmod |
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 04 |
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 |
export XA_ABSTOPSRCDIR=${PWD}/_kmod_build_${kernel_version%%___*} |
76 |
make %{?_smp_mflags} V=1 -C "${kernel_version##*___}" M=${PWD}/_kmod_build_${kernel_version%%___*}/extensions modules |
77 |
done |
78 |
|
79 |
%install |
80 |
%{__rm} -rf %{buildroot} |
81 |
|
82 |
for kernel_version in %{?kernel_versions} ; do |
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 _emodinst_ INSTALL_MOD_PATH=%{buildroot}%{_prefix} ext-mod-dir=%{kmodinstdir_postfix} |
85 |
# 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... |
86 |
#mv %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/../lib |
87 |
cp -R %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/../lib |
88 |
done |
89 |
%{?akmod_install} |
90 |
|
91 |
%clean |
92 |
%{__rm} -rf %{buildroot} |
93 |
|
94 |
%pre |
95 |
|
96 |
%post -n %{name} |
97 |
/sbin/weak-modules --add-kernel |
98 |
|
99 |
%preun |
100 |
|
101 |
%postun -n %{name} |
102 |
/sbin/weak-modules --add-kernel |
103 |
|
104 |
%files |
105 |
%defattr(-, root, root, 0755) |
106 |
#/lib/modules/* |
107 |
|