1 |
## Build directory |
2 |
%_topdir %(echo $HOME)/rpms |
3 |
|
4 |
%_signature gpg |
5 |
%_gpg_name SME Server 7 signing key <bugteam@contribs.org> |
6 |
%_gpgbin /usr/bin/gpg |
7 |
|
8 |
%_packager SME Server, Inc. <http://smeserver.org> |
9 |
|
10 |
## Disable the -debug symbol packages |
11 |
%debug_package %{nil} |
12 |
|
13 |
# Compiler optimizations |
14 |
%_smp_mflags -j5 |
15 |
|
16 |
%distversion %(rpm -qf --qf='%{VERSION}' /etc/redhat-release) |
17 |
%dist .el%{distversion}.sme |
18 |
%smerelease() %1%{dist}%{?2:.%2} |
19 |
|
20 |
#--------------------------------------------------------------------- |
21 |
|
22 |
%evr %{?epoch:%{epoch}:}%{version}-%{release} |
23 |
|
24 |
%_kversion %(ls /usr/src/kernels/ | sed -n 's|^\\([^-]\\+-[^-]\\+\\)-.*|\\1|p' | tail -1) |
25 |
|
26 |
%kmdl_kernelsrcdir() /usr/src/kernels/%{_kversion}%{?1:-%1}-%{_target_cpu} |
27 |
%kmdl_moduledir() /lib/modules/%{_kversion}%{?1}/updates |
28 |
|
29 |
%_with_smp %(test -d %{kmdl_kernelsrcdir smp} && echo 1 || echo 0) |
30 |
%_with_hugemem %(test -d %{kmdl_kernelsrcdir hugemem} && echo 1 || echo 0) |
31 |
%_with_largesmp %(test -d %{kmdl_kernelsrcdir largesmp} && echo 1 || echo 0) |
32 |
%_with_xen0 %(test -d %{kmdl_kernelsrcdir xen0} && echo 1 || echo 0) |
33 |
%_with_xenU %(test -d %{kmdl_kernelsrcdir xenU} && echo 1 || echo 0) |
34 |
%_with_xen %(test -d %{kmdl_kernelsrcdir xen} && echo 1 || echo 0) |
35 |
%_with_kdump %(test -d %{kmdl_kernelsrcdir kdump} && echo 1 || echo 0) |
36 |
%_with_PAE %(test -d %{kmdl_kernelsrcdir PAE} && echo 1 || echo 0) |
37 |
|
38 |
%kmdl(r:) \ |
39 |
%{-r:%{expand:%%define _kmdlrelease %{-r*}}} \ |
40 |
%kmdl_kernel \ |
41 |
%kmdl_kernel smp \ |
42 |
%kmdl_kernel hugemem \ |
43 |
%kmdl_kernel largesmp \ |
44 |
%kmdl_kernel xen0 \ |
45 |
%kmdl_kernel xenU \ |
46 |
%kmdl_kernel xen \ |
47 |
%kmdl_kernel kdump \ |
48 |
%kmdl_kernel PAE |
49 |
|
50 |
%kmdl_kernel() \ |
51 |
%{?1:%{expand:%%if %%{_with_%1}}} \ |
52 |
%package kmdl-%{_kversion}%{?1} \ |
53 |
Summary: %{name} kernel%{?1:-%1} module(s) \ |
54 |
%{?_kmdlrelease:Release: %{_kmdlrelease}} \ |
55 |
Group: System Environment/Kernel \ |
56 |
BuildRequires: gcc \ |
57 |
BuildRequires: kernel%{?1:-%1}-devel = %{_kversion} \ |
58 |
Requires: /sbin/depmod \ |
59 |
Requires: /boot/vmlinuz-%{_kversion}%{?1} \ |
60 |
Requires: kernel%{?1:-%1}-%{_target_cpu} = %{_kversion} \ |
61 |
Obsoletes: kmod-%{name}%{?1:-%1} \ |
62 |
Obsoletes: kernel%{?1:-%1}-module-%{name} \ |
63 |
Provides: %{name}-kmdl-%{evr} \ |
64 |
Provides: %{name}-kmdl-%{_kversion}%{?1} = %{evr} \ |
65 |
%description kmdl-%{_kversion}%{?1} \ |
66 |
This package provides the %{name} kernel modules built for the Linux \ |
67 |
kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors. \ |
68 |
%post kmdl-%{_kversion}%{?1} \ |
69 |
depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \ |
70 |
%postun kmdl-%{_kversion}%{?1} \ |
71 |
depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \ |
72 |
%files kmdl-%{_kversion}%{?1} \ |
73 |
%defattr(-, root, root, -) \ |
74 |
%{expand:%%{kmdl_moduledir %{?1}}} \ |
75 |
%{?1:%endif} \ |
76 |
%{nil} |
77 |
|
78 |
#--------------------------------------------------------------------- |
79 |
|
80 |
%_krelver %(echo "%{_kversion}" | sed -e 's|-|_|g') |
81 |
|
82 |
%kmod_kernelsrcdir() %(echo "/usr/src/kernels/%{_kversion}-%{?1}-%{_target_cpu}" | sed -e's|--|-|') |
83 |
%kmod_moduledir() /lib/modules/%{_kversion}%{?1}/updates |
84 |
|
85 |
%kmod() \ |
86 |
%{expand:%%global _kmodname %1} \ |
87 |
%{expand:%%global _kmodversion %2} \ |
88 |
%{expand:%%global _kmodrelease %3} \ |
89 |
Name: kmod-%{_kmodname} \ |
90 |
Version: %{_kmodversion} \ |
91 |
Release: %{_kmodrelease}.%{_krelver} \ |
92 |
Packager: %{_packager} \ |
93 |
License: GPL \ |
94 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u -n)-root |
95 |
|
96 |
%kmod_kernel() \ |
97 |
%{expand:%%if %%{_with_%1}}\ |
98 |
%package %1 \ |
99 |
%{expand:%%kmod_dependencies %1} \ |
100 |
%{expand:%%kmod_desc %1} \ |
101 |
%{expand:%%kmod_scripts %1} \ |
102 |
%files %1 \ |
103 |
%defattr(-, root, root, -) \ |
104 |
%{expand:%%kmod_moduledir %1} \ |
105 |
%endif \ |
106 |
%{nil} |
107 |
|
108 |
%kmod_dependencies() \ |
109 |
Summary: %{_kmodname} kernel module(s) \ |
110 |
Group: System Environment/Kernel \ |
111 |
BuildRequires: gcc \ |
112 |
BuildRequires: %(echo "kernel-%{?1}-devel" | sed -e's|--|-|') = %{_kversion} \ |
113 |
Requires: /sbin/depmod \ |
114 |
Requires: %(echo "kernel-%{?1}-%{_target_cpu}" | sed -e's|--|-|') = %{_kversion} \ |
115 |
Provides: %{_kmodname}-kmod = %{evr} \ |
116 |
Provides: kernel-modules = %{_kversion}%{?1} \ |
117 |
Provides: %(echo "kmod-%{_kmodname}-%{?1}" | sed -e's|-$||') = %{evr} |
118 |
|
119 |
%kmod_desc() \ |
120 |
%description %{?1}\ |
121 |
This package provides the %{_kmodname} kernel modules built for the Linux \ |
122 |
kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors. |
123 |
|
124 |
%kmod_scripts() \ |
125 |
%post %{?1} \ |
126 |
depmod -aeF /boot/System.map-%{_kversion}%{?1} %{_kversion}%{?1} > /dev/null 2>&1 || : \ |
127 |
%postun %{?1} \ |
128 |
depmod -aeF /boot/System.map-%{_kversion}%{?1} %{_kversion}%{?1} > /dev/null 2>&1 || : |