forked from hannesmann/gcadapter-oc-kmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcadapter_oc-kmod.spec
51 lines (38 loc) · 1.83 KB
/
gcadapter_oc-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
%if 0%{?fedora}
%global buildforkernels akmod
%global debug_package %{nil}
%endif
Name: gcadapter_oc-kmod
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter.
License: GPLv2
URL: https://github.com/KyleGospo/gcadapter_oc-dkms
Source: %{url}/archive/refs/heads/master.tar.gz
BuildRequires: kmodtool
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
Kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter. The default overclock is from 125 Hz to 1000 Hz.
%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
%setup -q -c gcadapter_oc-dkms-master
find . -type f -name '*.c' -exec sed -i "s/#VERSION#/%{version}/" {} \+
for kernel_version in %{?kernel_versions} ; do
cp -a gcadapter_oc-dkms-master _kmod_build_${kernel_version%%___*}
done
%build
for kernel_version in %{?kernel_versions} ; do
make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} VERSION=v%{version} modules
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%%___*}/gcadapter_oc.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/gcadapter_oc.ko
done
%{?akmod_install}
%changelog
{{{ git_dir_changelog }}}