nvieville / rpms / akmods

Forked from rpms/akmods 6 years ago
Clone
c1a53c5
Name:           akmods
c1a53c5
Version:        0.5.6
dad8a04
Release:        23%{?dist}
c1a53c5
Summary:        Automatic kmods build and install tool 
c1a53c5
c1a53c5
License:        MIT
c1a53c5
URL:            http://rpmfusion.org/Packaging/KernelModules/Akmods
c1a53c5
c1a53c5
# We are upstream, these files are maintained directly in pkg-git
c1a53c5
Source0:        95-akmods.preset
c1a53c5
Source1:        akmods
c1a53c5
Source2:        akmodsbuild
c1a53c5
Source3:        akmods.h2m
c1a53c5
Source4:        akmodsinit
c1a53c5
Source5:        akmodsposttrans
c1a53c5
Source6:        akmods.service.in
c1a53c5
Source7:        akmods-shutdown
c1a53c5
Source8:        akmods-shutdown.service
c1a53c5
Source9:        README
c1a53c5
Source10:       LICENSE
ed24a73
Source11:       akmods@.service
2117073
Source12:       akmods-ostree-post
e53285e
Source13:       95-akmodsposttrans.install
c1a53c5
c1a53c5
BuildArch:      noarch
c1a53c5
c1a53c5
BuildRequires:  help2man
c1a53c5
c1a53c5
# not picked up automatically
ed24a73
%if 0%{?rhel} == 6
c1a53c5
Requires:       %{_bindir}/nohup
ed24a73
%endif
c1a53c5
Requires:       %{_bindir}/flock
c1a53c5
Requires:       %{_bindir}/time
c1a53c5
c1a53c5
# needed for actually building kmods:
c1a53c5
Requires:       %{_bindir}/rpmdev-vercmp
c1a53c5
Requires:       kmodtool >= 1-9
c1a53c5
c1a53c5
# this should track in all stuff that is normally needed to compile modules:
c1a53c5
Requires:       bzip2 coreutils diffutils file findutils gawk gcc grep
b6055fc
Requires:       gzip make sed tar unzip util-linux which rpm-build
c1a53c5
dad8a04
%if 0%{?rhel}
dad8a04
Requires:       kernel-abi-whitelists
dad8a04
%endif
629f727
%if 0%{?fedora} || 0%{?rhel} > 7
c1a53c5
# We use a virtual provide that would match either
c1a53c5
# kernel-devel or kernel-PAE-devel
c1a53c5
Requires:       kernel-devel-uname-r
b2c9700
Suggests:       (kernel-debug-devel if kernel-debug)
b2c9700
Suggests:       (kernel-devel if kernel)
b2c9700
Suggests:       (kernel-lpae-devel if kernel-lpae)
b2c9700
Suggests:       (kernel-PAE-devel if kernel-PAE)
b2c9700
Suggests:       (kernel-PAEdebug-devel if kernel-PAEdebug)
b2c9700
# Theses are from planetccrma-core or rhel-7-server-rt-rpms
b2c9700
Suggests:       (kernel-rt-devel if kernel-rt)
b2c9700
Suggests:       (kernel-rtPAE-devel if kernel-rtPAE)
3a98aed
%else
3a98aed
# There is no much variant there, so using a sane default
3a98aed
Requires:       kernel-devel
c1a53c5
%endif
c1a53c5
c1a53c5
# we create a special user that used by akmods to build kmod packages
c1a53c5
Requires(pre):  shadow-utils
c1a53c5
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
c1a53c5
# systemd unit requirements.
c1a53c5
BuildRequires:  systemd
c1a53c5
Requires(post): systemd
c1a53c5
Requires(preun): systemd
c1a53c5
Requires(postun): systemd
2622aee
# Optional but good to have on recent kernel
2622aee
Requires: elfutils-libelf-devel
e22772a
%endif
c1a53c5
c1a53c5
c1a53c5
%description
08ac4b3
Akmods startup script will rebuild akmod packages during system
c1a53c5
boot while its background daemon will build them for kernels right
c1a53c5
after they were installed.
c1a53c5
c1a53c5
c1a53c5
%prep
fd6e351
%setup -q -c -T
c1a53c5
cp -p %{SOURCE9} %{SOURCE10} .
c1a53c5
c1a53c5
c1a53c5
%build
c1a53c5
# Nothing to build
c1a53c5
c1a53c5
c1a53c5
%install
c1a53c5
mkdir -p %{buildroot}%{_usrsrc}/akmods \
c1a53c5
         %{buildroot}%{_sbindir} \
c1a53c5
         %{buildroot}%{_sysconfdir}/kernel/postinst.d \
e22772a
         %{buildroot}%{_localstatedir}/cache/akmods
e22772a
c1a53c5
install -pm 0755 %{SOURCE1} %{buildroot}%{_sbindir}/
c1a53c5
install -pm 0755 %{SOURCE2} %{buildroot}%{_sbindir}/
2117073
install -pm 0755 %{SOURCE12} %{buildroot}%{_sbindir}/
c1a53c5
install -pm 0755 %{SOURCE5} %{buildroot}%{_sysconfdir}/kernel/postinst.d/
c1a53c5
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
e53285e
mkdir -p %{buildroot}%{_prefix}/lib/kernel/install.d
e53285e
install -pm 0755 %{SOURCE13} %{buildroot}%{_prefix}/lib/kernel/install.d/
e22772a
mkdir -p \
e22772a
         %{buildroot}%{_unitdir} \
e22772a
         %{buildroot}%{_presetdir}
c1a53c5
sed "s|@SERVICE@|display-manager.service|" %{SOURCE6} >\
c1a53c5
    %{buildroot}%{_unitdir}/akmods.service
c1a53c5
install -pm 0644 %{SOURCE0} %{buildroot}%{_presetdir}/
e22772a
install -pm 0755 %{SOURCE7} %{buildroot}%{_sbindir}/
e22772a
install -pm 0644 %{SOURCE8} %{buildroot}%{_unitdir}/
ed24a73
install -pm 0644 %{SOURCE11} %{buildroot}%{_unitdir}/
e22772a
%else
e22772a
mkdir -p %{buildroot}%{_initddir}/
e22772a
install -pm 0755 %{SOURCE4} %{buildroot}%{_initddir}/akmods
e22772a
%endif
c1a53c5
c1a53c5
# Generate and install man pages.
c1a53c5
mkdir -p %{buildroot}%{_mandir}/man1
c1a53c5
help2man -N -i %{SOURCE3} -s 1 \
c1a53c5
    -o %{buildroot}%{_mandir}/man1/akmods.1 \
c1a53c5
       %{buildroot}%{_sbindir}/akmods
c1a53c5
help2man -N -i %{SOURCE3} -s 1 \
c1a53c5
    -o %{buildroot}%{_mandir}/man1/akmodsbuild.1 \
c1a53c5
       %{buildroot}%{_sbindir}/akmodsbuild
c1a53c5
c1a53c5
c1a53c5
%pre
c1a53c5
# create group and user
c1a53c5
getent group akmods >/dev/null || groupadd -r akmods
c1a53c5
getent passwd akmods >/dev/null || \
c1a53c5
useradd -r -g akmods -d /var/cache/akmods/ -s /sbin/nologin \
c1a53c5
    -c "User is used by akmods to build akmod packages" akmods
c1a53c5
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
c1a53c5
%post
c1a53c5
%systemd_post akmods.service
ed24a73
%systemd_post akmods@.service
c1a53c5
%systemd_post akmods-shutdown.service
c1a53c5
c1a53c5
%preun
c1a53c5
%systemd_preun akmods.service
ed24a73
%systemd_preun akmods@.service
c1a53c5
%systemd_preun akmods-shutdown.service
c1a53c5
c1a53c5
%postun
c1a53c5
%systemd_postun akmods.service
ed24a73
%systemd_postun akmods@.service
c1a53c5
%systemd_postun akmods-shutdown.service
e22772a
%else
e22772a
%post
e22772a
if [ $1 -eq 1 ] ; then
e22772a
  /sbin/chkconfig --add akmods ||:
e22772a
fi
e22772a
e22772a
%preun
e22772a
if [ $1 -eq 0 ] ; then
e22772a
  /sbin/chkconfig --del akmods || :
e22772a
fi
e22772a
%endif
c1a53c5
c1a53c5
c1a53c5
%files
c1a53c5
%doc README
5bab47b
%if 0%{?rhel} > 6 || 0%{?fedora} > 20
c1a53c5
%license LICENSE
5bab47b
%else
5bab47b
%doc LICENSE
5bab47b
%endif
c1a53c5
%{_sbindir}/akmodsbuild
c1a53c5
%{_sbindir}/akmods
2117073
%{_sbindir}/akmods-ostree-post
c1a53c5
%{_sysconfdir}/kernel/postinst.d/akmodsposttrans
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
c1a53c5
%{_unitdir}/akmods.service
ed24a73
%{_unitdir}/akmods@.service
e22772a
%{_sbindir}/akmods-shutdown
c1a53c5
%{_unitdir}/akmods-shutdown.service
e53285e
%{_prefix}/lib/kernel/install.d/95-akmodsposttrans.install
c8ef8db
# akmods was enabled in the default preset by f28
c8ef8db
%if 0%{?fedora} && 0%{?fedora} >= 28
c8ef8db
%exclude %{_presetdir}/95-akmods.preset
c8ef8db
%else
c1a53c5
%{_presetdir}/95-akmods.preset
c8ef8db
%endif
e22772a
%else
e22772a
%{_initddir}/akmods
e22772a
%endif
c1a53c5
%{_usrsrc}/akmods
c1a53c5
%attr(-,akmods,akmods) %{_localstatedir}/cache/akmods
c1a53c5
%{_mandir}/man1/*
c1a53c5
c1a53c5
c1a53c5
%changelog
dad8a04
* Wed Oct 16 2019 Leigh Scott <leigh123linux@googlemail.com> - 0.5.6-23
dad8a04
- Add requires kernel-abi-whitelists for RHEL
dad8a04
0886c6d
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-22
0886c6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0886c6d
9deb876
* Mon May 20 2019 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-21
9deb876
- Add check for rhel8
9deb876
e53285e
* Wed May 15 2019 Nicolas Viéville <nicolas.vieville@uphf.fr> - 0.5.6-20
e53285e
- Fix akmodsposttrans after kernel update/install on Fedora >= 28 and 
e53285e
  RHEL >= 7 - rhbz#1709055
e53285e
2117073
* Thu Feb 28 2019 Alexander Larsson <alexl@redhat.com> - 0.5.6-19
2117073
- Support ostree/silverblue builds - rhbz#1667014
2117073
2117073
* Thu Feb 28 2019 Hans de Goede <hdegoede@redhat.com>
1a31208
- Do not fail when the old initscripts pkg is not installed - rhbz#1680121
1a31208
38cf6da
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-18
38cf6da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
38cf6da
fc8e6cb
* Mon Nov 05 2018 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-17
fc8e6cb
- Don't enforce target arch - rhbz#1644430
fc8e6cb
- Rework log file path
fc8e6cb
- Avoid using /usr/lib/modules for el6 compat
fc8e6cb
082bf4f
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-16
082bf4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
082bf4f
ed833bd
* Mon Mar 26 2018 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-15
ed833bd
- Add inihibitor for akmods@.service
ed833bd
- Use restart on akmodsposttrans
ed833bd
a103e44
* Mon Mar 26 2018 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-14
a103e44
- Switch to always retry by default
a103e44
- Drop akmods preset by f28
a103e44
- Don't enable service on ah
a103e44
- Test a rw directory
a103e44
5d9ce37
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-13
5d9ce37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5d9ce37
ed24a73
* Wed Dec 13 2017 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-12
ed24a73
- Update kernel posttrans method - rhbz#1518401
ed24a73
3a98aed
* Thu Aug 03 2017 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-11
3a98aed
- Rework kernel-devel requires on el
3a98aed
f20e099
* Thu Aug 03 2017 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-10
f20e099
- Enable suggests on fedora
f20e099
- Add back el6 support in spec
f20e099
- Add Requires elfutils-libelf-devel
f20e099
97ce993
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-9
97ce993
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
97ce993
bf65b34
* Thu Jul 13 2017 Petr Pisar <ppisar@redhat.com> - 0.5.6-8
bf65b34
- perl dependency renamed to perl-interpreter
bf65b34
  <https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules>
bf65b34
3b4a499
* Thu May  4 2017 Hans de Goede <hdegoede@redhat.com> - 0.5.6-7
3b4a499
- "udevadm trigger" may have bad side-effects (rhbz#454407) instead
3b4a499
  look for modalias files under /sys/devices and call modprobe directly
3b4a499
- Fix exit status when no akmod packages are installed, so that systemd
3b4a499
  does not consider the akmods.service as having failed to start
3b4a499
fd6e351
* Wed May  3 2017 Hans de Goede <hdegoede@redhat.com> - 0.5.6-6
fd6e351
- Run "udevadm trigger" and "systemctl restart systemd-modules-load.service"
fd6e351
  when new kmod packages have been build and installed so that the new
fd6e351
  modules may be used immediately without requiring a reboot
fd6e351
c1a53c5
* Mon Mar  6 2017 Hans de Goede <hdegoede@redhat.com> - 0.5.6-5
c1a53c5
- Add LICENSE file (rhbz#1422918)
c1a53c5
c1a53c5
* Fri Feb 24 2017 Hans de Goede <hdegoede@redhat.com> - 0.5.6-4
c1a53c5
- Replace %%{_prefix}/lib/systemd/system-preset with %%{_presetdir}
c1a53c5
c1a53c5
* Thu Feb 16 2017 Hans de Goede <hdegoede@redhat.com> - 0.5.6-3
c1a53c5
- Submit to Fedora for package review
c1a53c5
c1a53c5
* Mon Nov 28 2016 Nicolas Chauvet <kwizart@gmail.com> - 0.5.6-2
c1a53c5
- Use Suggests kernel-devel weak-dependency - see rfbz#3386
c1a53c5
c1a53c5
* Fri Oct 14 2016 Richard Shaw <hobbes1069@gmail.com> - 0.5.6-1
c1a53c5
- Disable shutdown systemd service file by default.
c1a53c5
- Remove modprobe line from main service file.
c1a53c5
c1a53c5
* Wed Aug 17 2016 Sérgio Basto <sergio@serjux.com> - 0.5.4-3
c1a53c5
- New release
c1a53c5
c1a53c5
* Sun Jan 03 2016 Nicolas Chauvet <kwizart@gmail.com> - 0.5.4-2
c1a53c5
- Revert conflicts kernel-debug-devel
c1a53c5
c1a53c5
* Thu Jul 23 2015 Richard Shaw <hobbes1069@gmail.com> - 0.5.4-1
c1a53c5
- Do not mark a build as failed when only installing the RPM fails.
c1a53c5
- Run akmods-shutdown script instead of akmods on shutdown.
c1a53c5
- Add systemd preset file to enable services by default.
c1a53c5
c1a53c5
* Wed Jul 15 2015 Richard Shaw <hobbes1069@gmail.com> - 0.5.3-2
c1a53c5
- Add package conflicts to stop pulling in kernel-debug-devel, fixes BZ#3386.
c1a53c5
- Add description for the formatting of the <kernel> parameter, BZ#3580.
c1a53c5
- Update static man pages and clean them up.
c1a53c5
- Fixed another instance of TMPDIR causing issues.
c1a53c5
- Added detection of dnf vs yum to akmods, fixed BZ#3481.
c1a53c5
c1a53c5
* Wed Apr  1 2015 Richard Shaw <hobbes1069@gmail.com> - 0.5.2-1
c1a53c5
- Fix temporary directory creation when TMPDIR environment variable is set,
c1a53c5
  fixes BZ#2596.
c1a53c5
- Update systemd scripts to use macros.
c1a53c5
- Fix akmods run on shutdown systemd unit file, fixes BZ#3503.
c1a53c5
c1a53c5
* Sun Nov 16 2014 Nicolas Chauvet <kwizart@gmail.com> - 0.5.1-4
c1a53c5
- Fix akmods on armhfp - rfbz#3117
c1a53c5
- Use yum instead of rpm to install packages - rfbz#3350
c1a53c5
  Switch to a better date format
c1a53c5
c1a53c5
* Fri Jan 11 2013 Richard Shaw <hobbes1069@gmail.com> - 0.5.1-3
c1a53c5
- Really fix akmods.service.in.
c1a53c5
c1a53c5
* Fri Jun 01 2012 Richard Shaw <hobbes1069@gmail.com> - 0.5.1-2
c1a53c5
- Add service file to run again on shutdown.
c1a53c5
- Add conditional for Fedora 18 to specify correct systemd graphical service.
c1a53c5
c1a53c5
* Thu Apr 12 2012 Nicolas Chauvet <kwizart@gmail.com> - 0.4.0-4
c1a53c5
- Rebuilt
c1a53c5
c1a53c5
* Tue Mar 20 2012 Richard Shaw <hobbes1069@gmail.com> - 0.4.0-3
c1a53c5
- Add additional error output if the needed kernel development files are not
c1a53c5
  installed. (Fixes #561)
c1a53c5
c1a53c5
* Mon Mar 05 2012 Richard Shaw <hobbes1069@gmail.com> - 0.4.0-2
c1a53c5
- Remove remaining references to previous Fedora releases
c1a53c5
- Remove legacy SysV init script from CVS.
c1a53c5
- Added man page for akmods and cleaned up man page for akmodsbuild.
c1a53c5
c1a53c5
* Tue Feb 07 2012 Nicolas Chauvet <kwizart@gmail.com> - 0.4.0-1
c1a53c5
- Update for UsrMove support
c1a53c5
- Remove unused references to older fedora
c1a53c5
- Change Requires from kernel-devel to kernel-devel-uname-r