[Fedora-packaging] Updated kernel-module-packaging example with ndiswrapper (Was: example kernel-module package)

Thorsten Leemhuis fedora at leemhuis.info
Sun Jul 3 14:11:49 UTC 2005

Hi *

Am Donnerstag, den 30.06.2005, 15:52 +0200 schrieb Thorsten Leemhuis:
> Anyway, I created a example package with kernel-modules for ndiswrapper
> to play a bit with the discussed scheme. It

I updated the example found online at 
and in the wiki at

Changes to the kernel-module-package:

- These macro definitions are now found in the top of the spec file:
%{!?kver:  %define  kver            %(uname -r)}
           %define  ksrc            %{_usrsrc}/kernels/%{kver}-%{_target_cpu}
           %define  moddir          /lib/modules/%{kver}/kernel/misc
           %define  mainpkgname     ndiswrapper
           %define  mainpkgversion  1.2
           %define  mainpgkrelease  1
Yes, in other packages I would not like these "mainpkg*" definitions on
the top, but in this type of package I think they are helpful.

- The main kernel-module package is now named
"kernel-module-%{mainpkgname}-base" (if someones knows something better
then "base" tell me). The kernel-module itself is now placed in
 %package -n kernel-module-%{mainpkgname}
So only one SRPM is created no matter how much different kernel-modules
are build. Also the CVS tags don't depend on the local kernel-version (I
did not try but it got to this idea when I saw "Sacrifice
no-args-builds-for-current-kernel for benefit of CVS tag sanity." 

- Now: 
 Release: 	%{mainpgkrelease}.%(echo %{kver} | tr - _)
 Provides:       kernel-module = %{kver}
as suggested by spot on this list yesterday 

- Avoid some problems when kernel-module and kernel are deleted in one
rpm transaction (anyone knows a better way to fix? "Requires(postun):
kernel-%{_target_cpu} = %{kver}" does not work):  
-- Only depmod when System.map is still there
 %postun -n kernel-module-%{mainpkgname}
 [ -e "/boot/System.map-%{kver}" ] && \
 /sbin/depmod -e -F /boot/System.map-%{kver} %{kver}> /dev/null || :
-- In %files:
%dir /lib/modules/%{kver}/
so that dir is removed during remove. 


P.S: I'm on a trip the next weeks -- I don't know how often and how long
I'll have access to the Internet. So don't expect a fast reply from me
during that time. And if you want to propose a kernel-module scheme that
I would not like: this is you chance! ;-)
Thorsten Leemhuis <fedora at leemhuis.info>

More information about the Fedora-packaging mailing list