-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacetimehd-dkms.spec
83 lines (64 loc) · 2.23 KB
/
facetimehd-dkms.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
80
81
82
83
%global commitdate 20240605
%global commit d47bb259d9810c97488486eff7c91893ba8b6bde
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global srcname facetimehd
%define module facetimehd
%define version 0.6.8.2
Summary: %{module} %{version} dkms package
Name: %{module}
Version: %{version}
Release: %{commitdate}git%{shortcommit}.2dkms
License: GPLv2
Group: System Environment/Kernel
Requires: dkms >= 1.00
Requires: bash
URL: https://github.com/patjak/facetimehd/
Source0: https://github.com/patjak/bcwc_pcie/archive/%{commit}/%{srcname}-%{version}-%{shortcommit}.tar.gz
%description
This package contains %{module} module wrapped for the DKMS framework.
%global debug_package %{nil}
%prep
%setup -q -c -T -a 0
%install
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
mkdir -p $RPM_BUILD_ROOT/usr/src/%{module}-%{version}/
cp -rf %{srcname}-%{commit}/* $RPM_BUILD_ROOT/usr/src/%{module}-%{version}/
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/%{module}/
cp %{srcname}-%{commit}/README.md $RPM_BUILD_ROOT/usr/share/doc/%{module}/
mkdir -p $RPM_BUILD_ROOT/etc/modules-load.d/
echo -e "# Load facetimehd.ko at boot\nfacetimehd" > $RPM_BUILD_ROOT/etc/modules-load.d/facetimehd.conf
%clean
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%files
%defattr(-,root,root)
%config /etc/modules-load.d/facetimehd.conf
/usr/src/%{module}-%{version}/
/usr/share/doc/%{module}/
%pre
%post
dkms add -m %{module} -v %{version} --rpm_safe_upgrade
if [ `uname -r | grep -c "BOOT"` -eq 0 ] && [ -e /lib/modules/`uname -r`/build/include ]; then
dkms build -m %{module} -v %{version}
dkms install -m %{module} -v %{version}
elif [ `uname -r | grep -c "BOOT"` -gt 0 ]; then
echo -e ""
echo -e "Module build for the currently running kernel was skipped since you"
echo -e "are running a BOOT variant of the kernel."
else
echo -e ""
echo -e "Module build for the currently running kernel was skipped since the"
echo -e "kernel headers for this kernel do not seem to be installed."
fi
exit 0
%preun
echo -e
echo -e "Uninstall of %{module} module (version %{version}) beginning:"
dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
exit 0
%changelog
* Wed May 13 2020 Stanislav Ashirov <[email protected]>
- Initial RPM release