forked from frankcrawford/it87
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathit87-extras-kmod.spec
57 lines (45 loc) · 1.74 KB
/
it87-extras-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
%global modname it87-extras
%global srcversion master
%global srcname it87
%global pkgname it87-extras
%global maintainer frankcrawford
%if 0%{?fedora}
%global buildforkernels akmod
%global debug_package %{nil}
%endif
# name should have a -kmod suffix
Name: %{pkgname}-kmod
Version: {{{ git_dir_version }}}
Release: 2%{?dist}
Summary: Linux Driver for ITE LPC chips
License: GPLv2
URL: https://github.com/%{maintainer}/it87
Source0: %{url}/archive/refs/heads/%{srcversion}.zip
BuildRequires: kmodtool
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
Linux Driver for ITE LPC chips
%prep
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
%autosetup -c %{pkgname}
for kernel_version in %{?kernel_versions} ; do
cp -a %{srcname}-%{srcversion} _kmod_build_${kernel_version%%___*}/
done
%build
for kernel_version in %{?kernel_versions} ; do
pushd _kmod_build_${kernel_version%%___*}/
make clean
make KVER=${kernel_version%%___*}
popd
done
%install
for kernel_version in %{?kernel_versions}; do
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
install -D -m 755 _kmod_build_${kernel_version%%___*}/%{modname}.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{modname}.ko
done
%{?akmod_install}
%changelog