From 8dd7beb534a4f3b6b3ad10050f9e4a23e88cc8e7 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Thu, 16 Feb 2012 16:53:27 +0800 Subject: bbswitch-kmod 0.4.1 --- bbswitch-kmod/bbswitch-kmod.spec | 74 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 bbswitch-kmod/bbswitch-kmod.spec diff --git a/bbswitch-kmod/bbswitch-kmod.spec b/bbswitch-kmod/bbswitch-kmod.spec new file mode 100644 index 0000000..7c9bebd --- /dev/null +++ b/bbswitch-kmod/bbswitch-kmod.spec @@ -0,0 +1,74 @@ +%global kmodname bbswitch + +# (un)define the next line to either build for the newest or all current kernels +#define buildforkernels newest +#define buildforkernels current +%define buildforkernels akmod + +# name should have a -kmod suffix +Name: bbswitch-kmod + +Version: 0.4.1 +Release: 1%{?dist} +Summary: bbswitch Kernel module + +Group: System Environment/Kernel + +License: GPL +URL: https://github.com/Bumblebee-Project/bbswitch +Source0: https://github.com/downloads/Bumblebee-Project/bbswitch/bbswitch-%{version}.tar.gz + +BuildRequires: %{_bindir}/kmodtool + + +# needed for plague to make sure it builds for i586 and i686 +ExclusiveArch: i586 i686 x86_64 ppc ppc64 + +# get the proper build-sysbuild package from the repo, which +# tracks in all the kernel-devel packages +BuildRequires: %{_bindir}/kmodtool + +%{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } + +# kmodtool does its magic here +%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } + + +%description +bbswitch is a kernel module which automatically detects the required ACPI calls for two kinds of Optimus laptops. + +%prep +# error out if there was something wrong with kmodtool +%{?kmodtool_check} + +# print kmodtool output for debugging purposes: +kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null + +%setup -q -c -T -a 0 + +# apply patches and do other stuff here +# pushd %{kmodname}-%{version} +# #patch0 -p1 -b .suffix +# popd + +for kernel_version in %{?kernel_versions} ; do + cp -a %{kmodname}-%{version} _kmod_build_${kernel_version%%___*} +done + + +%build +for kernel_version in %{?kernel_versions}; do + make %{?_smp_mflags} -C "${kernel_version##*___}" SUBDIRS=${PWD}/_kmod_build_${kernel_version%%___*} modules +done + + +%install +for kernel_version in %{?kernel_versions}; do + install -D -m 755 _kmod_build_${kernel_version%%___*}/%{kmodname}.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{kmodname}.ko +done +%{?akmod_install} + + +%changelog +* Thu Feb 16 2012 Robin Lee - 0.4.1-1 +- Initial specfile with the template -- cgit