1 |
%global __requires_exclude /bin/awk |
2 |
|
3 |
Summary: Dynamic Kernel Module Support Framework |
4 |
Name: dkms |
5 |
Version: 2.0.19 |
6 |
URL: https://linux.dell.com/dkms |
7 |
Release: %mkrel 46 |
8 |
License: GPL |
9 |
Group: System/Base |
10 |
BuildArch: noarch |
11 |
Requires: kernel-devel |
12 |
Recommends: kernel-devel-latest |
13 |
Requires: %{name}-minimal = %{version}-%{release} |
14 |
Requires(pre): rpm-helper |
15 |
Requires(post): rpm-helper >= %{rpmhelper_required_version} |
16 |
Requires(preun): rpm-helper >= %{rpmhelper_required_version} |
17 |
Requires: patch |
18 |
Source: https://linux.dell.com/dkms/%{name}-%{version}.tar.gz |
19 |
Source1: template-dkms-mkrpm.spec.temp |
20 |
Source2: dkms.depmod.conf |
21 |
Source3: autoload.awk |
22 |
Patch1: dkms-2.0.19-norpm.patch |
23 |
Patch2: dkms-2.0.19-mgaify.patch |
24 |
Patch3: dkms-fix-kernel-make-prepare.patch |
25 |
Patch4: dkms-2.0.17.6-compressed-module.patch |
26 |
Patch5: dkms-2.0.19-weak_module_name.patch |
27 |
Patch7: dkms-2.0.19-procconfig.patch |
28 |
Patch8: dkms-2.0.19-mdkrpm-split-ver-rel.patch |
29 |
Patch9: dkms-2.0.19-bash-completion-update.patch |
30 |
Patch10: dkms-2.0.19-binary_only.patch |
31 |
Patch11: dkms-2.0.17.5-min-max-kernel.patch |
32 |
Patch12: dkms-2.0.17.6-test-dkms.conf-existence.patch |
33 |
Patch13: dkms-2.0.17.6-status_default.patch |
34 |
Patch14: dkms-2.0.17.6-stdout.patch |
35 |
Patch15: dkms-2.0.19-no_custom_rpm_provides.patch |
36 |
Patch16: dkms-2.0.19-binary.patch |
37 |
Patch17: dkms-2.0.19-autoalias.patch |
38 |
Patch18: dkms-2.0.19-mkrpm_status.patch |
39 |
Patch19: dkms-2.0.19-skip-unused-check.patch |
40 |
Patch20: dkms-2.0.19-uninstall-speedup.patch |
41 |
Patch21: dkms-2.0.19-init-mdv-interactive.patch |
42 |
Patch22: dkms-symvers.patch |
43 |
Patch23: dkms-2.0.19-autoload_instead_of_udevadm.patch |
44 |
Patch24: dkms-2.0.19-suggest-devel-not-source.patch |
45 |
Patch25: dkms-2.0.19-xz-support.patch |
46 |
# (doktor5000) remove explicit usage of " > /dev/stdout" as standard output |
47 |
# this breaks systemd logging and is unnecessary for standard output |
48 |
Patch26: dkms-2.0.19-mga-remove_dev_stdout_output_loc.patch |
49 |
Patch27: dkms-2.0.19-parallel-build.patch |
50 |
Patch28: dkms-no-autoload-during-install.patch |
51 |
Patch29: dkms-display-bootsplash-message.patch |
52 |
Patch30: dkms-2.0.19-fix-module-checksum-checking.patch |
53 |
Patch31: dkms-2.0.19-fix-modules-suffix.patch |
54 |
Patch32: dkms-2.0.19-mga-egrep-to-grep-E-v3.patch |
55 |
|
56 |
%define _dkmsdir %{_localstatedir}/lib/%{name} |
57 |
%define _dkmsbinarydir %{_localstatedir}/lib/%{name}-binary |
58 |
|
59 |
%description |
60 |
This package contains the framework for the Dynamic |
61 |
Kernel Module Support (DKMS) method for installing |
62 |
module RPMS as originally developed by the Dell |
63 |
Computer Corporation. |
64 |
|
65 |
This package is intended for building binary kernel |
66 |
modules with dkms source packages installed |
67 |
|
68 |
%package minimal |
69 |
Summary: Dynamic Kernel Module Support Framework - minimal package |
70 |
License: GPL |
71 |
Group: System/Base |
72 |
Requires: lsb-release |
73 |
Requires(preun): rpm-helper |
74 |
Requires(post): rpm-helper |
75 |
|
76 |
%description minimal |
77 |
This package contains the framework for the Dynamic |
78 |
Kernel Module Support (DKMS) method for installing |
79 |
module RPMS as originally developed by the Dell |
80 |
Computer Corporation. |
81 |
|
82 |
This package is intended for installing binary module RPMS |
83 |
as created by dkms. |
84 |
|
85 |
%prep |
86 |
%setup -q |
87 |
%patch -P 1 -p1 -b .norpm |
88 |
%patch -P 2 -p1 -b .mdkize |
89 |
%patch -P 3 -p1 -b .fix-kernel-make-prepare |
90 |
%patch -P 4 -p1 -b .compressed-module |
91 |
%patch -P 5 -p1 -b .weak_module_name |
92 |
%patch -P 7 -p1 -b .procconfig |
93 |
%patch -P 8 -p1 -b .mdkrpm-split-ver-rel |
94 |
%patch -P 9 -p1 -b .bash-completion-update |
95 |
%patch -P 10 -p1 -b .binary_only |
96 |
%patch -P 11 -p1 -b .min-max-kernel |
97 |
%patch -P 12 -p1 -b .test-dkmsconf |
98 |
%patch -P 13 -p1 -b .status_default |
99 |
%patch -P 14 -p1 -b .stdout |
100 |
%patch -P 15 -p1 -b .no_custom_rpm_provides |
101 |
%patch -P 16 -p1 -b .binary |
102 |
%patch -P 17 -p0 -b .autoalias |
103 |
%patch -P 18 -p1 -b .mkrpm |
104 |
%patch -P 19 -p1 -b .versionsanity |
105 |
%patch -P 20 -p1 -b .uninst-speedup |
106 |
%patch -P 21 -p1 -b .mdv-interactive |
107 |
%patch -P 22 -p1 -b .symvers |
108 |
%patch -P 23 -p1 -b .autoload_instead_of_udevadm |
109 |
%patch -P 24 -p1 -b .suggest-devel |
110 |
%patch -P 25 -p1 -b .xz-support |
111 |
%patch -P 26 -p1 -b .dev_stdout_output_loc |
112 |
%patch -P 27 -p1 -b .parallel-build |
113 |
%patch -P 28 -p1 -b .no-autoload-during-install |
114 |
%patch -P 29 -p1 -b .display-bootsplash-message |
115 |
%patch -P 30 -p1 -b .fix-module-checksum-checking |
116 |
%patch -P 31 -p1 -b .fix-module-suffix |
117 |
%patch -P 32 -p1 -b .egrep-to-grep-E |
118 |
|
119 |
sed -i -e 's,/var/%{name},%{_dkmsdir},g;s,init.d/dkms_autoinstaller,init.d/%{name},g' \ |
120 |
dkms_autoinstaller \ |
121 |
dkms_framework.conf \ |
122 |
kernel_*.d_dkms \ |
123 |
%{name}.8 \ |
124 |
dkms |
125 |
|
126 |
%install |
127 |
mkdir -p %{buildroot}%{_mandir}/man8 |
128 |
%make_install INITD=%{buildroot}%{_initrddir} |
129 |
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/template-dkms-mkrpm.spec |
130 |
install -m 755 dkms_mkkerneldoth %{buildroot}/%{_sbindir}/dkms_mkkerneldoth |
131 |
install -m 755 %{SOURCE3} %{buildroot}/%{_sbindir}/dkms_autoload |
132 |
mv %{buildroot}%{_initrddir}/dkms_autoinstaller %{buildroot}%{_sbindir} |
133 |
mkdir -p %{buildroot}%{_dkmsbinarydir} |
134 |
mkdir -p %{buildroot}%{_sysconfdir}/depmod.d |
135 |
install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/depmod.d/%{name}.conf |
136 |
|
137 |
|
138 |
# (doktor5000) systemd service file to run dkms_autoinstaller on every boot |
139 |
# necessary to rebuild dkms modules for kernels booting the first time |
140 |
mkdir -p %{buildroot}%{_unitdir} |
141 |
cat << 'EOF' > %{buildroot}%{_unitdir}/%{name}-autorebuild.service |
142 |
[Unit] |
143 |
Description=run dkms_autoinstaller on every boot to rebuild dkms modules for newly booted kernels |
144 |
DefaultDependencies=no |
145 |
Conflicts=shutdown.target |
146 |
Before=basic.target shutdown.target |
147 |
After=local-fs.target |
148 |
|
149 |
[Service] |
150 |
ExecStart=%{_sbindir}/dkms-autorebuild.sh |
151 |
Type=oneshot |
152 |
RemainAfterExit=yes |
153 |
|
154 |
[Install] |
155 |
Alias=dkms_autoinstaller.service |
156 |
WantedBy=basic.target |
157 |
|
158 |
EOF |
159 |
|
160 |
|
161 |
# (doktor5000) split out from /etc/init.d/mandrake_everytime / mandriva-everytime.service |
162 |
# triggered by above systemd service on every boot (mga# |
163 |
cat << 'EOF' > %{buildroot}%{_sbindir}/%{name}-autorebuild.sh |
164 |
#!/bin/sh |
165 |
|
166 |
# start dkms module build for newly booted kernels via %{name}-autorebuild.service |
167 |
# rebuild can be disabled by setting DKMS_ONBOOT=no in /etc/sysconfig/system |
168 |
|
169 |
[ -r /etc/sysconfig/system ] && . /etc/sysconfig/system |
170 |
|
171 |
DKMS_TOOL=%{_sbindir}/dkms_autoinstaller |
172 |
if [ "$DKMS_ONBOOT" != "no" ] && [ -x $DKMS_TOOL ]; then |
173 |
# dkms_autoinstaller evaluates $verbose so enable it here for complete logging |
174 |
verbose=yes $DKMS_TOOL start |
175 |
fi |
176 |
EOF |
177 |
|
178 |
chmod 755 %{buildroot}%{_sbindir}/%{name}-autorebuild.sh |
179 |
|
180 |
%define _dkms_autorebuild_installed %{_localstatedir}/lib/rpm-state/dkms-autorebuild-installed |
181 |
|
182 |
%pre |
183 |
if [ $1 -eq 2 ] ; then |
184 |
if [ -f %{_unitdir}/%{name}-autorebuild.service ] ; then |
185 |
touch %{_dkms_autorebuild_installed} |
186 |
fi |
187 |
fi |
188 |
|
189 |
%post |
190 |
if [ -f %{_dkms_autorebuild_installed} ] ; then |
191 |
# We are upgrading from a version that included the dkms-autorebuild |
192 |
# service. |
193 |
rm %{_dkms_autorebuild_installed} |
194 |
else |
195 |
# We are either installing or upgrading from a version that didn't |
196 |
# include the dkms-autorebuild service. Force it to be installed. |
197 |
set -- 1 |
198 |
fi |
199 |
%_post_service %{name}-autorebuild |
200 |
|
201 |
%preun |
202 |
%_preun_service %{name}-autorebuild |
203 |
|
204 |
%triggerpostun -- dkms < 2.0.19-11 |
205 |
rm -f /etc/rc.d/*/{K,S}??dkms |
206 |
|
207 |
%files |
208 |
%doc %attr (-,root,root) sample.spec sample.conf AUTHORS COPYING template-dkms-mkrpm.spec |
209 |
%{_sbindir}/dkms_autoinstaller |
210 |
%{_unitdir}/%{name}-autorebuild.service |
211 |
%{_sbindir}/%{name}-autorebuild.sh |
212 |
|
213 |
%files minimal |
214 |
%{_sbindir}/dkms |
215 |
%{_dkmsdir} |
216 |
%dir %{_dkmsbinarydir} |
217 |
%{_sbindir}/dkms_mkkerneldoth |
218 |
%{_sbindir}/dkms_autoload |
219 |
%{_mandir}/man8/dkms.8* |
220 |
%config(noreplace) %{_sysconfdir}/dkms |
221 |
# these dirs are for plugins - owned by other packages |
222 |
%{_sysconfdir}/kernel/postinst.d/%{name} |
223 |
%{_sysconfdir}/kernel/prerm.d/%{name} |
224 |
%{_sysconfdir}/bash_completion.d/%{name} |
225 |
%{_sysconfdir}/depmod.d/%{name}.conf |