-
Notifications
You must be signed in to change notification settings - Fork 1
/
sunhme2g-kmod.spec
80 lines (57 loc) · 2.44 KB
/
sunhme2g-kmod.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# (un)define the next line to either build for the newest or all current kernels
#define buildforkernels newest
#define buildforkernels current
%define buildforkernels akmod
%define modname sunhme2g
Name: %{modname}-kmod
Version: 0.0.1
Release: 1%{?dist}.1
Summary: Modified version of sunhme driver
Group: System Environment/Kernel
License: GPL
#URL:
Source0: sunhme-0.0.1.tar.gz
Patch0: sunhme-2gb-bugfix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
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
A patched version of sunhme driver that works on machines
with more than 2GB of ram
%prep
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --repo %{repo} --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 sunhme
%patch0 -p1 -b .2gb-bugfix
popd
for kernel_version in %{?kernel_versions} ; do
pwd
cp -a sunhme _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
rm -rf ${RPM_BUILD_ROOT}
for kernel_version in %{?kernel_versions}; do
install -dm 755 %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
install -D -m 755 _kmod_build_${kernel_version%%___*}/sunhme.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{modname}.ko
done
%{?akmod_install}
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Apr 05 2013 Sebastian Mäki <[email protected]> - 0.0.1-1
- initial spec