-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnvidia-persistenced.spec
70 lines (56 loc) · 1.71 KB
/
nvidia-persistenced.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
Name: nvidia-persistenced
Version: 570.00
Release: 1%{?dist}
Summary: A daemon to maintain persistent software state in the NVIDIA driver
Epoch: 3
License: GPLv2+
URL: http://www.nvidia.com/object/unix.html
ExclusiveArch: x86_64 aarch64
Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2
Source1: %{name}.service
BuildRequires: gcc
BuildRequires: libtirpc-devel
BuildRequires: m4
BuildRequires: systemd-rpm-macros
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: libnvidia-cfg%{?_isa} >= %{?epoch:%{epoch}:}%{version}
%description
The %{name} utility is used to enable persistent software state in the NVIDIA
driver. When persistence mode is enabled, the daemon prevents the driver from
releasing device state when the device is not in use. This can improve the
startup time of new clients in this scenario.
%prep
%autosetup
# Remove additional CFLAGS added when enabling DEBUG
sed -i -e '/+= -O0 -g/d' utils.mk
%build
export CFLAGS="%{optflags} -I%{_includedir}/tirpc"
%make_build \
DEBUG=1 \
LIBS="-ldl -ltirpc" \
NV_VERBOSE=1 \
PREFIX=%{_prefix} \
STRIP_CMD=true
%install
%make_install \
NV_VERBOSE=1 \
PREFIX=%{_prefix} \
STRIP_CMD=true
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
# Systemd unit files
install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.*
%{_sharedstatedir}/%{name}
%{_unitdir}/%{name}.service
%changelog