[Fedora-packaging] Kernel modules (was: Re: tpctl in extras missing dependancy for kernel-module-thinkpad)

Tom 'spot' Callaway tcallawa at redhat.com
Wed Jun 29 16:55:18 UTC 2005

On Wed, 2005-06-29 at 18:23 +0200, Ralf Corsepius wrote:

> > I honestly don't care which is the base and which is the subpackage. The
> > biggest issue I see is with arch determination, since they HAVE to be
> > the same between base and subpackage.
> Not, if you separate "building the rpm" from "releasing the rpm".
> Example:
> # rpm -q --qf '%{ARCH} %{SOURCERPM}\n' glibc-headers glibc
> i386 glibc-2.3.5-10.src.rpm
> i686 glibc-2.3.5-10.src.rpm

Thats a very good point, but it will certainly make conditionalizing the
spec file fun. :)

I'm not opposed to that.

Example spec:

# This is defined by the buildsystem, NOT on a per package basis.
#%define kver 2.6.11-1.1369_FC4
%define cleankver %(echo %{kver} | sed s,-,_,g)
%define kernelonlyarches i586 i686 ppc64 sparc64
%define userspacearches i386 ppc sparc 
%define kernelanduserarches ia64 x86_64

Name:		foo
Version:	0.3.6
Release:	1
Summary:	Userspace components for foo
Group:		System Environment/Base
License:	Whatever
URL:		http://www.example.com/foo
Source0:        http://www.example.com/foo/foo-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:	kernel-module-%{name}
BuildRequires:	kernel-devel-%{_target_cpu} = %{kver}
ExclusiveArch:  %{kernelonlyarches} %{userspacearches} %{kernelanduserarches}

These are userspace libraries and binaries to make the foo module usable.

%package devel
Group:		Development/Libraries
Summary:	Development headers and libraries for foo
Requires:	%{name} = %{version}-%{release}

%description devel
This package contains the include files and static libraries for 
developing applications that use foo.

%package -n kernel-module-%{name}
Group:		System Environment/Base
Version:        %{version}
Release:        %{release}.%{cleankver}
Requires:       kernel-%{_target_cpu} = %{kver}
Provides:       kernel-module

%description -n kernel-module-%{name}
This package contains the foo module compiled for kernel %{kver} on %{_target_cpu}.

%setup -q

make %{?_smp_mflags} ...



%post -n kernel-module-%{name}
[ $1 -eq 1 ] && depmod -ae -F /boot/System.map-%{kver} %{kver} >/dev/null || :

%postun -n kernel-module-%{name}
depmod -ae -F /boot/System.map-%{kver} %{kver} >/dev/null || :

%ifarch %{userspacearches} %{kernelanduserarches}
# docs go here
%doc ...

%files devel

%ifarch %{kernelspacearches} %{kernelanduserarches}
%files -n kernel-module-%{name}
# This package should NOT have anything besides the module, to avoid file conflicts.

* Gud Fez 74 6395 Foobly Barowitz <foobly at barowitz.tld>
- Initial RPM release

Tom "spot" Callaway: Red Hat Sales Engineer || GPG Fingerprint: 93054260
Fedora Extras Steering Committee Member (RPM Standards and Practices)
Aurora Linux Project Leader: http://auroralinux.org
Lemurs, llamas, and sparcs, oh my!

More information about the Fedora-packaging mailing list