Name: kernel-module-thinkpad Version: 5.5 Release: 0.fdr.1 Summary: kernel module for IBM Thinkpad devices. Group: System Environment/Kernel License: GPL URL: http://tcptl.sourceforge.net/ Source: http://download.sourceforge.net/tcptl/thinkpad_%{version}.tar.gz Source1: thinkpad.makedev Patch: thinkpad.autotools.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # what kernel are we building for ? %{!?kernel: %define kernel %(uname -r)} # get the correct kernel package release by stripping kernel modifiers %define krel %(echo %{kernel} | sed -e s/smp//g -) # get a type modifier for the kernel, (null) or -smp %if %(echo %{kernel} | grep -c smp) %{expand:%%define ktype -smp} %else %define ktype %{nil} %endif # what kernel "flavor" are we building for ? %{expand:%%define post26 %(if echo %{kernel} | grep -c "^2\.[01234]" > /dev/null; then echo 0; else echo 1; fi)} # require some tools for the base package %ifarch noarch BuildRequires: MAKEDEV BuildRequires: sed %endif # require correct kernel development packages for noarch %ifnarch noarch %if %{post26} BuildRequires: kernel-module-devel-%{krel} %else BuildRequires: kernel-source = %{krel} %endif %endif # set correct architectures based on kernel version %if %{post26} ExclusiveArch: noarch i586 i686 %else ExclusiveArch: noarch i686 athlon %endif # where the kernel build tree lives for 2.6 %define basedeveldir %{_libdir}/kernel-module-devel-%{krel} %define develdir %{basedeveldir}/kernel%{ktype}-%{krel}.%{_target_cpu}.rpm # since we have a patch to the build and run autogen.sh BuildRequires: automake BuildRequires: autoconf # we don't want debug packages %define debug_package %{nil} %description This package contains kernel modules for the IBM Thinkpad. You can rebuild this RPM by using --target target_arch --define "kernel (uname -r value)" %package %{kernel} Summary: %{summary} Group: System Environment/Kernel Provides: kernel-module Provides: kernel-module-thinkpad = %{version}-%{release} Requires: kernel-module-thinkpad-base Requires: /boot/vmlinuz-%{kernel} Requires(pre): modutils %description %{kernel} This package contains kernel modules for the IBM Thinkpad. %package base Summary: %{summary} Group: System Environment/Kernel %description base This package contains the man page and device entry for the kernel modules for the IBM Thinkpad. %prep %setup -q -n thinkpad-%{version} %patch -p2 %build %if %{post26} bash autogen.sh || true %configure \ %ifarch noarch --without-modules %else --without-userspace \ --with-linuxdir=%{develdir} %endif %else # we supply arguments to autogen.sh so its configure doesn't fail bash autogen.sh \ --with-rpm-target=%{_target_cpu} \ --with-kernel-release=%{kernel} \ --with-linuxdir=/usr/src/linux-%{krel} %configure \ %ifarch noarch --without-modules \ %else --without-userspace \ --with-rpm-target=%{_target_cpu} \ --with-kernel-release=%{kernel} \ --with-linuxdir=/usr/src/linux-%{krel} %endif %endif make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT %makeinstall modulesdir=$RPM_BUILD_ROOT/lib/modules/%{kernel} %ifarch noarch install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d/thinkpad /dev/MAKEDEV -M \ -c $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d \ -d $RPM_BUILD_ROOT/dev thinkpad | sed "s|$RPM_BUILD_ROOT||g" > devices.list %endif %clean rm -rf $RPM_BUILD_ROOT %post %{kernel} depmod -ae -F /boot/System.map-%{kernel} %{kernel} > /dev/null %postun %{kernel} depmod -ae -F /boot/System.map-%{kernel} %{kernel} > /dev/null %pre base groupadd -r thinkpad >/dev/null 2>&1 || : %ifarch noarch %files base -f devices.list %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING README SUPPORTED-MODELS TECHNOTES %config %{_sysconfdir}/makedev.d %{_mandir}/man4/thinkpad.4* %else %files %{kernel} %defattr(-,root,root,-) /lib/modules/%{kernel}/kernel/drivers/thinkpad %endif %changelog * Fri Jul 16 2004 Thomas Vander Stichele - 5.5-0.fdr.1: initial package, works for FC2 and FC1 - use a -base package for man page and device stuff - use part of Ville Skyttä's RH9 package for groups and devices