c1a53c5
Name:           akmods
c1a53c5
Version:        0.5.6
f20e099
Release:        10%{?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
c1a53c5
c1a53c5
BuildArch:      noarch
c1a53c5
c1a53c5
BuildRequires:  help2man
c1a53c5
c1a53c5
# not picked up automatically
c1a53c5
Requires:       %{_bindir}/nohup
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
c1a53c5
# We use a virtual provide that would match either
c1a53c5
# kernel-devel or kernel-PAE-devel
c1a53c5
Requires:       kernel-devel-uname-r
c1a53c5
%if 0%{?fedora}
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)
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
c1a53c5
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}/
c1a53c5
install -pm 0755 %{SOURCE5} %{buildroot}%{_sysconfdir}/kernel/postinst.d/
c1a53c5
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
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}/
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
c1a53c5
%systemd_post akmods-shutdown.service
c1a53c5
c1a53c5
%preun
c1a53c5
%systemd_preun akmods.service
c1a53c5
%systemd_preun akmods-shutdown.service
c1a53c5
c1a53c5
%postun
c1a53c5
%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
c1a53c5
%license LICENSE
c1a53c5
%{_sbindir}/akmodsbuild
c1a53c5
%{_sbindir}/akmods
c1a53c5
%{_sysconfdir}/kernel/postinst.d/akmodsposttrans
e22772a
%if 0%{?fedora} || 0%{?rhel} > 6
c1a53c5
%{_unitdir}/akmods.service
e22772a
%{_sbindir}/akmods-shutdown
c1a53c5
%{_unitdir}/akmods-shutdown.service
c1a53c5
%{_presetdir}/95-akmods.preset
e22772a
%else
e22772a
%{_initddir}/akmods
e22772a
%endif
c1a53c5
%{_usrsrc}/akmods
c1a53c5
%attr(-,akmods,akmods) %{_localstatedir}/cache/akmods
c1a53c5
%{_mandir}/man1/*
c1a53c5
c1a53c5
c1a53c5
%changelog
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