14 |
%_smp_mflags -j5 |
%_smp_mflags -j5 |
15 |
|
|
16 |
%distversion %(rpm -qf --qf='%{VERSION}' /etc/redhat-release) |
%distversion %(rpm -qf --qf='%{VERSION}' /etc/redhat-release) |
17 |
%distname %(grep -i fedora /etc/redhat-release >/dev/null && echo "Fedora Core" || echo "Red Hat Linux") |
%dist .el%{distversion}.sme |
18 |
%distver el%{distversion} |
%smerelease() %1%{dist}%{?2:.%2} |
|
%disttag .%{distver}.sme |
|
|
%smerelease() %(echo "%{?1}%{?disttag}.%{?2}" | sed -e's|\\.$||') |
|
19 |
|
|
20 |
#--------------------------------------------------------------------- |
#--------------------------------------------------------------------- |
21 |
|
|
22 |
%evr %{?epoch:%{epoch}:}%{version}-%{release} |
%evr %{?epoch:%{epoch}:}%{version}-%{release} |
23 |
|
|
24 |
%_kversion %(ls /usr/src/kernels/ | sed -n 's|^\\([^-]\\+-[^-]\\+\\)-.*|\\1|p' | tail -1) |
%_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 |
|
|
36 |
|
%kmdl(r:) \ |
37 |
|
%{-r:%{expand:%%define _kmdlrelease %{-r*}}} \ |
38 |
|
%kmdl_kernel \ |
39 |
|
%kmdl_kernel smp \ |
40 |
|
%kmdl_kernel hugemem \ |
41 |
|
%kmdl_kernel largesmp \ |
42 |
|
%kmdl_kernel xen0 \ |
43 |
|
%kmdl_kernel xenU \ |
44 |
|
%kmdl_kernel xen \ |
45 |
|
%kmdl_kernel kdump \ |
46 |
|
%kmdl_kernel PAE |
47 |
|
|
48 |
|
%kmdl_kernel() \ |
49 |
|
%{?1:%{expand:%%if %%{_with_%1}}} \ |
50 |
|
%package kmdl-%{_kversion}%{?1} \ |
51 |
|
Summary: %{name} kernel%{?1:-%1} module(s) \ |
52 |
|
%{?_kmdlrelease:Release: %{_kmdlrelease}} \ |
53 |
|
Group: System Environment/Kernel \ |
54 |
|
BuildRequires: gcc \ |
55 |
|
BuildRequires: kernel%{?1:-%1}-devel = %{_kversion} \ |
56 |
|
Requires: /sbin/depmod \ |
57 |
|
Requires: /boot/vmlinuz-%{_kversion}%{?1} \ |
58 |
|
Requires: kernel%{?1:-%1}-%{_target_cpu} = %{_kversion} \ |
59 |
|
Obsoletes: kmod-%{name}%{?1:-%1} \ |
60 |
|
Obsoletes: kernel%{?1:-%1}-module-%{name} \ |
61 |
|
Provides: %{name}-kmdl-%{evr} \ |
62 |
|
Provides: %{name}-kmdl-%{_kversion}%{?1} = %{evr} \ |
63 |
|
%description kmdl-%{_kversion}%{?1} \ |
64 |
|
This package provides the %{name} kernel modules built for the Linux \ |
65 |
|
kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors. \ |
66 |
|
%post kmdl-%{_kversion}%{?1} \ |
67 |
|
depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \ |
68 |
|
%postun kmdl-%{_kversion}%{?1} \ |
69 |
|
depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \ |
70 |
|
%files kmdl-%{_kversion}%{?1} \ |
71 |
|
%defattr(-, root, root, -) \ |
72 |
|
%{expand:%%{kmdl_moduledir %{?1}}} \ |
73 |
|
%{?1:%endif} \ |
74 |
|
%{nil} |
75 |
|
|
76 |
|
#--------------------------------------------------------------------- |
77 |
|
|
78 |
%_krelver %(echo "%{_kversion}" | sed -e 's|-|_|g') |
%_krelver %(echo "%{_kversion}" | sed -e 's|-|_|g') |
79 |
|
|
80 |
%kmod_kernelsrcdir() %(echo "/usr/src/kernels/%{_kversion}-%{?1}-%{_target_cpu}" | sed -e's|--|-|') |
%kmod_kernelsrcdir() %(echo "/usr/src/kernels/%{_kversion}-%{?1}-%{_target_cpu}" | sed -e's|--|-|') |
81 |
%kmod_moduledir() /lib/modules/%{_kversion}%{?1}/updates |
%kmod_moduledir() /lib/modules/%{_kversion}%{?1}/updates |
82 |
|
|
|
%_with_smp %(test -d %{kmod_kernelsrcdir smp} && echo 1 || echo 0) |
|
|
%_with_hugemem %(test -d %{kmod_kernelsrcdir hugemem} && echo 1 || echo 0) |
|
|
|
|
83 |
%kmod() \ |
%kmod() \ |
84 |
%{expand:%%global _kmodname %1} \ |
%{expand:%%global _kmodname %1} \ |
85 |
%{expand:%%global _kmodversion %2} \ |
%{expand:%%global _kmodversion %2} \ |
91 |
License: GPL \ |
License: GPL \ |
92 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u -n)-root |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u -n)-root |
93 |
|
|
94 |
|
%kmod_kernel() \ |
95 |
|
%{expand:%%if %%{_with_%1}}\ |
96 |
|
%package %1 \ |
97 |
|
%{expand:%%kmod_dependencies %1} \ |
98 |
|
%{expand:%%kmod_desc %1} \ |
99 |
|
%{expand:%%kmod_scripts %1} \ |
100 |
|
%files %1 \ |
101 |
|
%defattr(-, root, root, -) \ |
102 |
|
%{expand:%%kmod_moduledir %1} \ |
103 |
|
%endif \ |
104 |
|
%{nil} |
105 |
|
|
106 |
%kmod_dependencies() \ |
%kmod_dependencies() \ |
107 |
Summary: %{_kmodname} kernel module(s) \ |
Summary: %{_kmodname} kernel module(s) \ |
108 |
Group: System Environment/Kernel \ |
Group: System Environment/Kernel \ |