%global __requires_exclude /bin/awk Summary: Dynamic Kernel Module Support Framework Name: dkms Version: 2.8.3 URL: https://github.com/dell/dkms Release: %mkrel 11 License: GPLv2+ Group: System/Base BuildArch: noarch Requires: kernel-devel Recommends: kernel-devel-latest Requires: %{name}-minimal = %{version}-%{release} Requires(pre): rpm-helper Requires(post): rpm-helper >= %{rpmhelper_required_version} Requires(preun): rpm-helper >= %{rpmhelper_required_version} Requires: patch Source0: https://github.com/dell/dkms/archive/v%{version}/%{name}-%{version}.tar.gz Source1: template-dkms-mkrpm.spec.gz Source2: dkms.depmod.conf # upstream patches from 1 Patch1: 0001-Makefile-also-install-in-etc-the-kernel_install.d_dk.patch Patch2: 0002-Makefile-install-the-new-kernel_install.d_dkms-and-s.patch Patch3: 0003-Do-not-require-root-access-for-the-build-command.patch # upstreamable patches from 101 Patch101: dkms-2.6.1-fix-kernel-make-prepare.patch # Mageia patches from 201 # Add Mageia detection to new codepaths, # We ignore the obsolete prepare_kernel() and dkms_mkkerneldoth Patch201: dkms-2.6.1-detect-Mageia.patch ## (ngompa): This is an analysis of the patches for DKMS. ## Unless otherwise noted, I did not write or rediff the patches # Do not depend on kernel rpm version for identifying kernel # This is necessary as Mageia kernels do not currently have the real version-release # in the version and release fields of the RPM data Patch9: dkms-2.8.3-norpm.patch # Don't copy over the SRPMs, we don't care about them... Patch10: dkms-2.6.1-binary_only.patch # Drop overrides to use external dependency generator # This is probably still needed... Patch15: dkms-2.6.1-no_custom_rpm_provides.patch # Add binary module installation type/status Patch16: dkms-2.8.3-binary-incomplete.patch # Hunks from dkms-2.0.19-binary.patch still to be ported Source16: dkms-2.0.19-binary-left-to-be-ported.patch Source17: dkms-2.0.19-binary.patch # Autogenerate modaliases #Patch17: dkms-2.0.19-autoalias.patch # Ensure that make_rpm() function exits with success Patch18: dkms-2.8.3-mkrpm_status.patch # Deletes a check that doesn't seem to be used... #Patch19: dkms-2.0.19-skip-unused-check.patch # Speed up module removal #Patch20: dkms-2.0.19-uninstall-speedup.patch # Populate module symvers Patch22: dkms-2.8.3-symvers.patch # Don't load modules automatically while installer is running (mga#20368) #Patch28: dkms-no-autoload-during-install.patch # Display text while building+installing driver through Plymouth Patch29: dkms-2.8.3-display-bootsplash-message.patch %define _dkmsdir %{_localstatedir}/lib/%{name} %define _dkmsbinarydir %{_localstatedir}/lib/%{name}-binary %description This package contains the framework for the Dynamic Kernel Module Support (DKMS) method for installing module RPMS as originally developed by the Dell Computer Corporation. This package is intended for building binary kernel modules with dkms source packages installed %package minimal Summary: Dynamic Kernel Module Support Framework - minimal package License: GPL Group: System/Base Requires: lsb-release Requires(preun): rpm-helper Requires(post): rpm-helper %description minimal This package contains the framework for the Dynamic Kernel Module Support (DKMS) method for installing module RPMS as originally developed by the Dell Computer Corporation. This package is intended for installing binary module RPMS as created by dkms. %prep %setup -q %autopatch -p1 sed -i -e 's,/var/%{name},%{_dkmsdir},g;s,init.d/dkms_autoinstaller,init.d/%{name},g' \ dkms_autoinstaller \ dkms_framework.conf \ kernel_*.d_dkms \ %{name}.8 \ dkms %build %install mkdir -p %{buildroot}%{_mandir}/man8 %makeinstall_std INITD=%{buildroot}%{_initrddir} install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/ install -m 755 dkms_mkkerneldoth %{buildroot}/%{_sbindir}/dkms_mkkerneldoth mv %{buildroot}%{_prefix}/lib/dkms/dkms_autoinstaller %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_dkmsbinarydir} mkdir -p %{buildroot}%{_sysconfdir}/depmod.d install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/depmod.d/%{name}.conf mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ mv %{buildroot}%{_datadir}/bash-completion/completions/dkms %{buildroot}%{_sysconfdir}/bash_completion.d/%{name} # (doktor5000) systemd service file to run dkms_autoinstaller on every boot # necessary to rebuild dkms modules for kernels booting the first time mkdir -p %{buildroot}%{_unitdir} cat << 'EOF' > %{buildroot}%{_unitdir}/%{name}-autorebuild.service [Unit] Description=run dkms_autoinstaller on every boot to rebuild dkms modules for newly booted kernels DefaultDependencies=no Conflicts=shutdown.target Before=basic.target shutdown.target After=local-fs.target [Service] ExecStart=%{_sbindir}/dkms-autorebuild.sh Type=oneshot RemainAfterExit=yes [Install] Alias=dkms_autoinstaller.service WantedBy=basic.target EOF # (doktor5000) split out from /etc/init.d/mandrake_everytime / mandriva-everytime.service # triggered by above systemd service on every boot (mga# cat << 'EOF' > %{buildroot}%{_sbindir}/%{name}-autorebuild.sh #!/bin/sh # start dkms module build for newly booted kernels via %%{name}-autorebuild.service # rebuild can be disabled by setting DKMS_ONBOOT=no in /etc/sysconfig/system [ -r /etc/sysconfig/system ] && . /etc/sysconfig/system DKMS_TOOL=%{_sbindir}/dkms_autoinstaller if [ "$DKMS_ONBOOT" != "no" ] && [ -x $DKMS_TOOL ]; then # dkms_autoinstaller evaluates $verbose so enable it here for complete logging verbose=yes $DKMS_TOOL start fi EOF chmod 755 %{buildroot}%{_sbindir}/%{name}-autorebuild.sh %define _dkms_autorebuild_installed %{_localstatedir}/lib/rpm-state/dkms-autorebuild-installed %pre if [ $1 -eq 2 ] ; then if [ -f %{_unitdir}/%{name}-autorebuild.service ] ; then touch %{_dkms_autorebuild_installed} fi fi %post if [ -f %{_dkms_autorebuild_installed} ] ; then # We are upgrading from a version that included the dkms-autorebuild # service. rm %{_dkms_autorebuild_installed} else # We are either installing or upgrading from a version that didn't # include the dkms-autorebuild service. Force it to be installed. set -- 1 fi %_post_service %{name}-autorebuild %preun %_preun_service %{name}-autorebuild %triggerpostun -- dkms < 2.0.19-11 rm -f /etc/rc.d/*/{K,S}??dkms %files %doc %attr (-,root,root) sample.spec sample.conf AUTHORS COPYING template-dkms-mkrpm.spec %{_sbindir}/dkms_autoinstaller %{_unitdir}/%{name}-autorebuild.service %{_sbindir}/%{name}-autorebuild.sh %files minimal %{_sbindir}/dkms %{_dkmsdir} %dir %{_dkmsbinarydir} %{_sbindir}/dkms_mkkerneldoth %{_mandir}/man8/dkms.8* %config(noreplace) %{_sysconfdir}/dkms # these dirs are for plugins - owned by other packages %{_sysconfdir}/kernel/postinst.d/%{name} %{_sysconfdir}/kernel/prerm.d/%{name} %{_sysconfdir}/bash_completion.d/%{name} %{_sysconfdir}/depmod.d/%{name}.conf %{_prefix}/lib/%{name}/common.postinst