/[packages]/backports/6/nvidia-current/current/SPECS/nvidia-current.spec
ViewVC logotype

Contents of /backports/6/nvidia-current/current/SPECS/nvidia-current.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1335662 - (show annotations) (download)
Mon Nov 26 21:31:22 2018 UTC (5 years, 6 months ago) by tmb
File size: 46267 byte(s)
add libglx compat symlinks (mga#23901)
1 # I love OpenSource :-(
2
3 ## NOTE: When modifying this .spec, you do not necessarily need to care about
4 ## the %simple stuff. It is fine to break them, I'll fix it when I need them :)
5 ## - Anssi
6
7 # %simple mode can be used to transform an arbitrary nvidia installer
8 # package to rpms, similar to %atibuild mode in fglrx.
9 # Macros version, rel, nsource, pkgname, distsuffix should be manually defined.
10 %define simple 0
11 %{?_without_simple: %global simple 0}
12 %{?_with_simple: %global simple 1}
13
14 # debugfiles.list is empty, dont try to create the rpms
15 %define _enable_debug_packages %{nil}
16 %define debug_package %{nil}
17
18 # dont try to check the desktop file, its a ghost for update-alternatives
19 %global dont_check_desktop_files 1
20
21 %define name nvidia-current
22
23 %if !%simple
24 # When updating, please add new ids to ldetect-lst (merge2pcitable.pl)
25 %define version 410.78
26 %define subrel 1
27 %define rel 1
28 # the highest supported videodrv abi (currently xorg 1.20)
29 %define videodrv_abi 24
30 %endif
31
32 %define priority 9700
33
34 %define pkgname64 NVIDIA-Linux-x86_64-%{version}
35
36 # Disable when the sources aren't on ftp yet, but can be downloaded from
37 # http://us.download.nvidia.com
38 %define ftp 0
39
40 # For now, backportability is kept for 2008.0 forwards.
41
42 %define drivername nvidia-current
43 %define driverpkgname x11-driver-video-%{drivername}
44 %define modulename %{drivername}
45 # for description and documentation
46 %define cards GeForce 420 and later cards
47 %define xorg_extra_modules %{_libdir}/xorg/extra-modules
48 %define nvidia_driversdir %{_libdir}/%{drivername}/xorg
49 %define nvidia_extensionsdir %{_libdir}/%{drivername}/xorg
50 %define nvidia_modulesdir %{_libdir}/%{drivername}/xorg
51 %define nvidia_libdir %{_libdir}/%{drivername}
52 %define nvidia_libdir32 %{_prefix}/lib/%{drivername}
53 %define nvidia_bindir %{nvidia_libdir}/bin
54 %define nvidia_datadir %{_datadir}/nvidia-alt-%{drivername}
55 # The entry in Cards+ this driver should be associated with, if there is
56 # no entry in ldetect-lst default pcitable:
57 # cooker ldetect-lst should be up-to-date
58 %define ldetect_cards_name %nil
59
60 %if %simple
61 # assign a Cards+ entry according to Mageia version
62 %if %mgaversion < 7
63 %define ldetect_cards_name NVIDIA GeForce 420 series and later
64 %else
65 %define ldetect_cards_name NVIDIA GeForce 635 series and later
66 %endif
67 %endif
68
69 %if !%simple
70 %ifarch %{ix86}
71 %define nsource %{SOURCE0}
72 %endif
73 %ifarch x86_64
74 %define nsource %{SOURCE1}
75 %define pkgname %{pkgname64}
76 %endif
77 %endif
78
79 # Other packages should not require any NVIDIA libraries, and this package
80 # should not be pulled in when libGL.so.1 is required
81 %global __provides_exclude \\.so
82 %global common__requires_exclude ^libGL\\.so|^libGLcore\\.so|^libGLdispatch\\.so|^libnvidia.*\\.so
83
84 # (anssi) Allow installing of 64-bit package if the runtime dependencies
85 # of 32-bit libraries are not satisfied. If a 32-bit package that requires
86 # libGL.so.1 is installed, the 32-bit mesa libs are pulled in and that will
87 # pull the dependencies of 32-bit nvidia libraries in as well.
88 %global __requires_exclude %common__requires_exclude|^libX11\\.so\\.6$|^libXext\\.so\\.6$|^libdl\\.so\\.2$|^libm\\.so\\.6$|^libpthread\\.so\\.0$|^librt\\.so\\.1$
89
90 # (anssi) Workaround wrong linking as of 310.19.
91 # This will probably be fixed soon (at least similar issues have been in the past).
92 # https://devtalk.nvidia.com/default/topic/523762/libnvidia-encode-so-310-19-has-dependency-on-missing-library/
93 %global __requires_exclude_from libnvidia-encode.so.%version
94
95 # backportability
96 %global _provides_exceptions %(echo '%__provides_exclude' | sed 's,|,\\\\|,g')
97 %global _requires_exceptions %(echo '%__requires_exclude' | sed 's,|,\\\\|,g')
98 %global _exclude_files_from_autoreq %(echo '%__requires_exclude_from' | sed 's,|,\\\\|,g')
99
100 Summary: NVIDIA proprietary X.org driver and libraries, current driver series
101 Name: %{name}
102 Version: %{version}
103 Release: %mkrel %{rel}
104 %if !%simple
105 %if %ftp
106 Source1: ftp://download.nvidia.com/XFree86/Linux-x86_64/%{version}/%{pkgname64}.run
107 # GPLv2 source code; see also http://cgit.freedesktop.org/~aplattner/
108 Source2: ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-%{version}.tar.bz2
109 Source3: ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-%{version}.tar.bz2
110 Source4: ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-%{version}.tar.bz2
111 Source5: ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-%{version}.tar.bz2
112 %else
113 Source1: https://download.nvidia.com/XFree86/Linux-x86_64/%{version}/%{pkgname64}.run
114 # GPLv2 source code; see also http://cgit.freedesktop.org/~aplattner/
115 Source2: https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-%{version}.tar.bz2
116 Source3: https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-%{version}.tar.bz2
117 Source4: https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-%{version}.tar.bz2
118 Source5: https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-%{version}.tar.bz2
119 %endif
120 # Script for building rpms of arbitrary nvidia installers (needs this .spec appended)
121 Source10: nvidia-mgabuild-skel
122 # include xf86vmproto for X_XF86VidModeGetGammaRampSize, fixes build on cooker
123 Patch3: nvidia-settings-include-xf86vmproto.patch
124 %endif
125
126 License: Freeware
127 BuildRoot: %{_tmppath}/%{name}-buildroot
128 URL: http://www.nvidia.com/object/unix.html
129 Group: System/Kernel and hardware
130 ExclusiveArch: x86_64
131 %if !%simple
132 BuildRequires: ImageMagick
133 BuildRequires: gtk+2-devel
134 BuildRequires: gtk+3-devel
135 BuildRequires: libxv-devel
136 BuildRequires: MesaGL-devel
137 BuildRequires: libxxf86vm-devel
138 BuildRequires: vdpau-devel >= 0.9
139 %endif
140
141 %description
142 Source package of the current NVIDIA proprietary driver. Binary
143 packages are named %{driverpkgname}.
144
145 %package -n %{driverpkgname}
146 Summary: NVIDIA proprietary X.org driver and libraries for %cards
147 Group: System/Kernel and hardware
148 Requires(post): update-alternatives
149 Requires(postun): update-alternatives
150 Requires: x11-server-common
151 Recommends: %{drivername}-doc-html = %{version}
152 # Proper support for versioned kmod() was added in 2008.1:
153 Requires: kmod(%{modulename}.ko) = %{version}
154 # At least mplayer dlopens libvdpau.so.1, so the software will not pull in
155 # the vdpau library package. We ensure its installation here.
156 Requires: %{_lib}vdpau1
157 %if !%simple && %mgaversion >= 2
158 Requires: xserver-abi(videodrv) < %(echo $((%{videodrv_abi}+1)))
159 %endif
160 Conflicts: nvidia-current-cuda-opencl <= 295.59-1
161 # Obsoletes for naming changes:
162 Obsoletes: nvidia < 1:%{version}-%{release}
163 Provides: nvidia = 1:%{version}-%{release}
164 Obsoletes: nvidia97xx < %{version}-%{release}
165 Provides: nvidia97xx = %{version}-%{release}
166 Requires: ldetect-lst >= 0.3.7.9-4
167
168 %description -n %{driverpkgname}
169 NVIDIA proprietary X.org graphics driver, related libraries and
170 configuration tools for %cards,
171 including the associated Quadro cards.
172
173 NOTE: You should use XFdrake to configure your NVIDIA card. The
174 correct packages will be automatically installed and configured.
175
176 If you do not want to use XFdrake, see README.manual-setup.
177
178 This NVIDIA driver should be used with %cards,
179 including the associated Quadro cards.
180
181 %package -n dkms-%{drivername}
182 Summary: NVIDIA kernel module for %cards
183 Group: System/Kernel and hardware
184 Requires: dkms >= 2.0.19-37
185 Requires(post): dkms >= 2.0.19-37
186 Requires(preun): dkms >= 2.0.19-37
187 Provides: kmod(%{modulename}.ko) = %{version}
188 Obsoletes: dkms-nvidia < 1:%{version}-%{release}
189 Provides: dkms-nvidia = 1:%{version}-%{release}
190 Obsoletes: dkms-nvidia97xx < %{version}-%{release}
191 Provides: dkms-nvidia97xx = %{version}-%{release}
192 Requires: ldetect-lst >= 0.3.7.9-4
193 # (tmb) prebuilt kmods violates gpl
194 %ifarch %{ix86}
195 %rename nvidia-current-kernel-desktop586-latest
196 %endif
197 %rename nvidia-current-kernel-desktop-latest
198 %rename nvidia-current-kernel-server-latest
199
200 %description -n dkms-%{drivername}
201 NVIDIA kernel module for %cards. This
202 is to be used with the %{driverpkgname} package.
203
204 %package -n %{drivername}-devel
205 Summary: NVIDIA OpenGL/CUDA development liraries and headers
206 Group: Development/C
207 Requires: %{driverpkgname} = %{version}-%{release}
208 Requires: %{drivername}-cuda-opencl = %{version}-%{release}
209 Obsoletes: nvidia-devel < 1:%{version}-%{release}
210 Provides: nvidia-devel = 1:%{version}-%{release}
211 Obsoletes: nvidia97xx-devel < %{version}-%{release}
212 Provides: nvidia97xx-devel = %{version}-%{release}
213 Requires: %{_lib}vdpau-devel
214
215 %description -n %{drivername}-devel
216 NVIDIA OpenGL/CUDA headers for %cards. This package
217 is not required for normal use.
218
219 %package -n %{drivername}-cuda-opencl
220 Summary: CUDA and OpenCL libraries for NVIDIA proprietary driver
221 Group: System/Kernel and hardware
222 Provides: %{drivername}-cuda = %{version}-%{release}
223 Requires: kmod(%{modulename}.ko) = %{version}
224 Conflicts: nvidia < 1:195.36.15-4
225 Conflicts: x11-driver-video-nvidia-current <= 295.59-1
226
227 %description -n %{drivername}-cuda-opencl
228 Cuda and OpenCL libraries for NVIDIA proprietary driver. This package is not
229 required for normal use, it provides libraries to use NVIDIA cards for High
230 Performance Computing (HPC).
231
232 # HTML doc splitted off because of size, for live cds:
233 %package -n %{drivername}-doc-html
234 Summary: NVIDIA html documentation (%{drivername})
235 Group: System/Kernel and hardware
236 Requires: %{driverpkgname} = %{version}-%{release}
237
238 %description -n %{drivername}-doc-html
239 HTML version of the README.txt file provided in package
240 %{driverpkgname}.
241
242 %prep
243 # No patches applied when %simple is set
244 %if %simple
245 %setup -q -c -T
246 %else
247 %setup -q -c -T -a 2 -a 3 -a 4 -a 5
248 cd nvidia-settings-%{version}
249 %patch3 -p1
250 cd ..
251 %endif
252 sh %{nsource} --extract-only
253
254 %if !%simple
255 cd %{pkgname}
256 %ifarch x86_64
257 # extra patches here
258 %endif
259 cd ..
260 %endif
261
262 rm -rf %{pkgname}/usr/src/nv/precompiled
263
264 %if %simple
265 # for old releases
266 mkdir -p %{pkgname}/kernel
267 %endif
268
269 # (tmb) nuke nVidia provided dkms.conf as we need our own
270 rm -f %{pkgname}/kernel/dkms.conf
271
272 # install our own dkms.conf
273 cat > %{pkgname}/kernel/dkms.conf <<EOF
274 PACKAGE_NAME="%{drivername}"
275 PACKAGE_VERSION="%{version}-%{release}"
276 BUILT_MODULE_NAME[0]="nvidia"
277 DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
278 DEST_MODULE_NAME[0]="%{modulename}"
279 BUILT_MODULE_NAME[1]="nvidia-modeset"
280 DEST_MODULE_LOCATION[1]="/kernel/drivers/char/drm"
281 BUILT_MODULE_NAME[2]="nvidia-drm"
282 DEST_MODULE_LOCATION[2]="/kernel/drivers/char/drm"
283 BUILT_MODULE_NAME[3]="nvidia-uvm"
284 DEST_MODULE_LOCATION[3]="/kernel/drivers/char/drm"
285 MAKE[0]="'make' -j\${parallel_jobs} SYSSRC=\${kernel_source_dir} modules"
286 AUTOINSTALL="yes"
287 EOF
288
289 %if %simple
290 # backward-compatibility randomness
291 if ! [ -e %{pkgname}/kernel/uvm ]; then
292 grep -v uvm %{pkgname}/kernel/dkms.conf > %{pkgname}/kernel/dkms.conf.2
293 mv -f %{pkgname}/kernel/dkms.conf.2 %{pkgname}/kernel/dkms.conf
294 fi
295 %endif
296
297 cat > README.install.urpmi <<EOF
298 This driver is for %cards.
299
300 Use XFdrake to configure X to use the correct NVIDIA driver. Any needed
301 packages will be automatically installed if not already present.
302 1. Run XFdrake as root.
303 2. Go to the Graphics Card list.
304 3. Select your card (it is usually already autoselected).
305 4. Answer any questions asked and then quit.
306
307 If you do not want to use XFdrake, see README.manual-setup.
308 EOF
309
310 cat > README.manual-setup <<EOF
311 This file describes the procedure for the manual installation of this NVIDIA
312 driver package. You can find the instructions for the recommended automatic
313 installation in the file 'README.install.urpmi' in this directory.
314
315 - Open %{_sysconfdir}/X11/xorg.conf and make the following changes:
316 o Change the Driver to "nvidia" in the Device section
317 o Make the line below the only 'glx' related line in the Module section,
318 adding it if it is not already there:
319 Load "glx"
320 o Remove any 'ModulePath' lines from the Files section
321 - Run "update-alternatives --set gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf" as root.
322 - Run "ldconfig -X" as root.
323 EOF
324
325 %if !%simple
326 #rm nvidia-settings-%{version}/src/*/*.a
327
328 %build
329 # The code contains dozens on top of dozens on top of dozens of "false" positives
330 export CFLAGS="%optflags -Wno-error=format-security"
331 export CXXFLAGS="$CFLAGS"
332 export LDFLAGS="%{?ldflags}"
333 %make -C nvidia-settings-%{version}/src/libXNVCtrl
334 %make -C nvidia-settings-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
335 %make -C nvidia-xconfig-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
336 %make -C nvidia-modprobe-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
337 %make -C nvidia-persistenced-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
338
339 # %simple
340 %endif
341
342 %install
343 rm -rf %{buildroot}
344 cd %{pkgname}
345
346 # menu entry
347 install -d -m755 %{buildroot}%{_datadir}/%{drivername}
348 cat > %{buildroot}%{_datadir}/%{drivername}/mageia-nvidia-settings.desktop <<EOF
349 [Desktop Entry]
350 Name=NVIDIA Display Settings
351 Comment=Configure NVIDIA X driver
352 Exec=%{_bindir}/nvidia-settings
353 Icon=%{drivername}-settings
354 Terminal=false
355 Type=Application
356 Categories=GTK;Settings;HardwareSettings;
357 EOF
358
359 install -d -m755 %{buildroot}%{_datadir}/applications
360 touch %{buildroot}%{_datadir}/applications/mageia-nvidia-settings.desktop
361
362 # icons
363 install -d -m755 %{buildroot}%{_iconsdir}/hicolor/{16x16,32x32,48x48}/apps
364 %if !%simple
365 convert nvidia-settings.png -resize 16x16 %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{drivername}-settings.png
366 convert nvidia-settings.png -resize 32x32 %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{drivername}-settings.png
367 convert nvidia-settings.png -resize 48x48 %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
368 %else
369 # no imagemagick
370 [ -e nvidia-settings.png ] || cp -a usr/share/pixmaps/nvidia-settings.png .
371 install -m644 nvidia-settings.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
372 %endif
373
374 error_fatal() {
375 echo "Error: $@." >&2
376 exit 1
377 }
378
379 error_unhandled() {
380 echo "Warning: $@." >&2
381 echo "Warning: $@." >> warns.log
382 %if !%simple
383 # cause distro builds to fail in case of unhandled files
384 exit 1
385 %endif
386 }
387
388 parseparams() {
389 for value in $rest; do
390 local param=$1
391
392 if [[ $value == MODULE:* ]]; then
393 # skip nvidia installer specific tag
394 continue
395 fi
396
397 [ -n "$param" ] || error_fatal "unhandled parameter $value"
398 shift
399 eval $param=$value
400
401 [ -n "$value" ] || error_fatal "empty $param"
402
403 # resolve libdir based on $arch
404 if [ "$param" = "arch" ]; then
405 case "$arch" in
406 NATIVE) nvidia_libdir=%{nvidia_libdir};;
407 COMPAT32) nvidia_libdir=%{nvidia_libdir32};;
408 *) error_fatal "unknown arch $arch"
409 esac
410 fi
411 if [ "$param" = "libtype" ]; then
412 case "$libtype" in
413 NON_GLVND);;
414 GLVND);;
415 *) error_fatal "unknown libtype $libtype"
416 esac
417 fi
418 done
419 }
420
421 add_to_list() {
422 %if !%simple
423 # on distro builds, only use .manifest for %doc files
424 [ "${2#%doc}" = "${2}" ] && return
425 %endif
426 local list="$1.files"
427 local entry="$2"
428 echo $entry >> $list
429 }
430
431 install_symlink() {
432 local pkg="$1"
433 local dir="$2"
434 mkdir -p %{buildroot}$dir
435 ln -s $dest %{buildroot}$dir/$file
436 add_to_list $pkg $dir/$file
437 }
438
439 install_lib_symlink() {
440 local pkg="$1"
441 local dir="$2"
442 case "$file" in
443 libvdpau_*.so)
444 # vdpau drivers => not put into -devel
445 ;;
446 *.so)
447 pkg=nvidia-devel;;
448 esac
449 install_symlink $pkg $dir
450 }
451
452 install_file_only() {
453 local pkg="$1"
454 local dir="$2"
455 mkdir -p %{buildroot}$dir
456 # replace 0444 with more usual 0644
457 [ "$perms" = "0444" ] && perms="0644"
458 install -m $perms $file %{buildroot}$dir
459 }
460
461 install_file() {
462 local pkg="$1"
463 local dir="$2"
464 install_file_only $pkg $dir
465 add_to_list $pkg $dir/$(basename $file)
466 }
467
468 install_src_file() {
469 local pkg="$1"
470 local dir="$2"
471 local moddir=$(dirname $file)
472 local subdir=${moddir#kernel}
473 install_file_only $pkg $dir$subdir
474 add_to_list $pkg $dir$subdir/$(basename $file)
475 }
476
477 get_module_dir() {
478 local subdir="$1"
479 case "$subdir" in
480 extensions*) echo %{nvidia_extensionsdir};;
481 drivers/) echo %{nvidia_driversdir};;
482 /) echo %{nvidia_modulesdir};;
483 *) error_unhandled "unhandled module subdir $subdir"
484 echo %{nvidia_modulesdir};;
485 esac
486 }
487
488 for file in nvidia.files nvidia-devel.files nvidia-cuda.files nvidia-dkms.files nvidia-html.files; do
489 rm -f $file
490 touch $file
491 done
492
493 # install files according to .manifest
494 cat .manifest | tail -n +9 | while read line; do
495 arch=
496 style=
497 subdir=
498 dest=
499 nvidia_libdir=
500 libtype=
501
502 rest=${line}
503 file=${rest%%%% *}
504 rest=${rest#* }
505 perms=${rest%%%% *}
506 rest=${rest#* }
507 type=${rest%%%% *}
508 [ "${rest#* }" = "$rest" ] && rest= || rest=${rest#* }
509
510 case "$type" in
511 CUDA_LIB)
512 parseparams arch subdir
513 install_file nvidia-cuda $nvidia_libdir/$subdir
514 ;;
515 CUDA_SYMLINK)
516 parseparams arch subdir dest
517 install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
518 ;;
519 EGL_CLIENT_LIB)
520 parseparams arch libtype
521 # (tmb) skip for now
522 case $libtype in NON_GLVND);; *) continue; esac
523 install_file nvidia $nvidia_libdir
524 ;;
525 EGL_CLIENT_SYMLINK)
526 parseparams arch dest libtype
527 # (tmb) skip for now
528 case $libtype in NON_GLVND);; *) continue; esac
529 install_lib_symlink nvidia $nvidia_libdir
530 ;;
531 EGL_EXTERNAL_PLATFORM_JSON)
532 # (tmb) skip for now
533 case $libtype in NON_GLVND);; *) continue; esac
534 install_file nvidia %{_sysconfdir}/%{drivername}
535 ;;
536 ENCODEAPI_LIB)
537 parseparams arch subdir
538 install_file nvidia $nvidia_libdir/$subdir
539 ;;
540 ENCODEAPI_LIB_SYMLINK)
541 parseparams arch dest
542 install_lib_symlink nvidia $nvidia_libdir
543 ;;
544 EXPLICIT_PATH)
545 parseparams dest
546 dest="$(echo "$dest" | sed s,%{_datadir}/nvidia,%{nvidia_datadir},)"
547 install_file nvidia $dest
548 ;;
549 GLVND_EGL_ICD_JSON)
550 # (tmb) skip for now
551 case $libtype in NON_GLVND);; *) continue; esac
552 install_file nvidia %{_sysconfdir}/%{drivername}
553 ;;
554 GLVND_LIB)
555 parseparams arch
556 install_file nvidia $nvidia_libdir
557 ;;
558 GLVND_SYMLINK)
559 parseparams arch dest
560 install_lib_symlink nvidia $nvidia_libdir
561 ;;
562 GLX_CLIENT_LIB)
563 parseparams arch libtype
564 # (tmb) skip for now
565 case $libtype in NON_GLVND);; *) continue; esac
566 install_file nvidia $nvidia_libdir
567 ;;
568 GLX_CLIENT_SYMLINK)
569 parseparams arch dest libtype
570 # (tmb) skip for now
571 case $libtype in NON_GLVND);; *) continue; esac
572 install_lib_symlink nvidia $nvidia_libdir
573 ;;
574 NVCUVID_LIB)
575 parseparams arch subdir
576 install_file nvidia-cuda $nvidia_libdir/$subdir
577 ;;
578 NVCUVID_LIB_SYMLINK)
579 parseparams arch dest
580 install_lib_symlink nvidia-cuda $nvidia_libdir
581 ;;
582 NVIFR_LIB)
583 parseparams arch subdir
584 install_file nvidia $nvidia_libdir/$subdir
585 ;;
586 NVIFR_LIB_SYMLINK)
587 parseparams arch dest
588 install_lib_symlink nvidia $nvidia_libdir
589 ;;
590 OPENCL_LIB)
591 parseparams arch subdir
592 install_file nvidia-cuda $nvidia_libdir/$subdir
593 ;;
594 OPENCL_LIB_SYMLINK)
595 parseparams arch subdir dest
596 install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
597 ;;
598 OPENCL_WRAPPER_LIB)
599 parseparams arch subdir
600 install_file nvidia-cuda $nvidia_libdir/$subdir
601 ;;
602 OPENCL_WRAPPER_SYMLINK)
603 parseparams arch subdir dest
604 install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
605 ;;
606 OPENGL_LIB)
607 parseparams arch
608 install_file nvidia $nvidia_libdir
609 ;;
610 OPENGL_SYMLINK)
611 parseparams arch dest
612 install_lib_symlink nvidia $nvidia_libdir
613 ;;
614 TLS_LIB)
615 parseparams arch style subdir
616 install_file nvidia $nvidia_libdir/$subdir
617 ;;
618 TLS_SYMLINK)
619 parseparams arch style subdir dest
620 install_lib_symlink nvidia $nvidia_libdir/$subdir
621 ;;
622 UTILITY_LIB)
623 %if !%simple
624 # skip libnvidia-gtk[23], we build those by ourself
625 echo "$file" | grep -q nvidia-gtk && continue
626 %endif
627 # backward-compatibility
628 [ -n "${rest}" ] || rest="NATIVE $rest"
629 parseparams arch subdir
630 install_file nvidia $nvidia_libdir/$subdir
631 ;;
632 UTILITY_LIB_SYMLINK)
633 # backward-compatibility
634 [ "${rest#* }" != "$rest" ] || rest="NATIVE $rest"
635 parseparams arch dest
636 install_lib_symlink nvidia $nvidia_libdir
637 ;;
638 VDPAU_LIB)
639 parseparams arch subdir
640 case $file in *libvdpau_nvidia.so*);; *) continue; esac
641 install_file nvidia $nvidia_libdir/$subdir
642 ;;
643 VDPAU_SYMLINK)
644 parseparams arch subdir dest
645 case $file in *libvdpau_nvidia.so*);; *) continue; esac
646 install_lib_symlink nvidia $nvidia_libdir/$subdir
647 ;;
648 VDPAU_WRAPPER_LIB)
649 parseparams arch subdir
650 case $file in *libvdpau_nvidia.so*);; *) continue; esac
651 install_file nvidia $nvidia_libdir/$subdir
652 ;;
653 VDPAU_WRAPPER_SYMLINK)
654 parseparams arch subdir dest
655 case $file in *libvdpau_nvidia.so*);; *) continue; esac
656 install_lib_symlink nvidia $nvidia_libdir/$subdir
657 ;;
658 VULKAN_ICD_JSON)
659 install_file nvidia %{_sysconfdir}/vulkan/icd.d/
660 ;;
661 XLIB_STATIC_LIB)
662 install_file nvidia-devel %{nvidia_libdir}
663 ;;
664 XLIB_SHARED_LIB)
665 install_file nvidia %{nvidia_libdir}
666 ;;
667 XLIB_SYMLINK)
668 parseparams dest
669 install_lib_symlink nvidia %{nvidia_libdir}
670 ;;
671 LIBGL_LA)
672 # (Anssi) we don't install .la files
673 ;;
674 XMODULE_SHARED_LIB|GLX_MODULE_SHARED_LIB)
675 parseparams subdir
676 install_file nvidia $(get_module_dir $subdir)
677 ;;
678 XMODULE_NEWSYM)
679 # symlink that is created only if it doesn't already
680 # exist (i.e. as part of x11-server)
681 case "$file" in
682 libwfb.so)
683 continue
684 ;;
685 *)
686 error_unhandled "unknown XMODULE_NEWSYM type file $file, skipped"
687 continue
688 esac
689 parseparams subdir dest
690 install_symlink nvidia $(get_module_dir $subdir)
691 ;;
692 XORG_OUTPUTCLASS_CONFIG)
693 # (tmb) dont install xorg driver autoloader conf
694 continue
695 ;;
696 XMODULE_SYMLINK|GLX_MODULE_SYMLINK)
697 parseparams subdir dest
698 install_symlink nvidia $(get_module_dir $subdir)
699 ;;
700 VDPAU_HEADER)
701 continue
702 parseparams subdir
703 install_file_only nvidia-devel %{_includedir}/%{drivername}/$subdir
704 ;;
705 OPENGL_HEADER|CUDA_HEADER)
706 parseparams subdir
707 install_file_only nvidia-devel %{_includedir}/%{drivername}/$subdir
708 ;;
709 DOCUMENTATION)
710 parseparams subdir
711 case $subdir in
712 */html)
713 add_to_list nvidia-html "%%doc %{pkgname}/$file"
714 continue
715 ;;
716 */include/*)
717 continue
718 ;;
719 esac
720 case $file in
721 *XF86Config*|*nvidia-settings.png)
722 continue;;
723 esac
724 add_to_list nvidia "%%doc %{pkgname}/$file"
725 ;;
726 MANPAGE|NVIDIA_MODPROBE_MANPAGE)
727 parseparams subdir
728 case "$file" in
729 *nvidia-installer*)
730 # not installed
731 continue
732 ;;
733 *nvidia-settings*|*nvidia-xconfig*|*nvidia-modprobe*|*nvidia-persistenced*)
734 %if !%simple
735 # installed separately below
736 continue
737 %endif
738 ;;
739 *nvidia-smi*|*nvidia-cuda-mps-control*)
740 # ok
741 ;;
742 *)
743 error_unhandled "skipped unknown man page $(basename $file)"
744 continue
745 esac
746 install_file_only nvidia %{_mandir}/$subdir
747 ;;
748 UTILITY_BINARY)
749 case "$file" in
750 *nvidia-settings|*nvidia-xconfig|*nvidia-persistenced)
751 %if !%simple
752 # not installed, we install our own copy
753 continue
754 %endif
755 ;;
756 *nvidia-smi|*nvidia-bug-report.sh|*nvidia-debugdump)
757 # ok
758 ;;
759 *nvidia-cuda-mps-control|*nvidia-cuda-mps-server)
760 # ok
761 ;;
762 *)
763 error_unhandled "unknown binary $(basename $file) will be installed to %{nvidia_bindir}/$(basename $file)"
764 ;;
765 esac
766 install_file nvidia %{nvidia_bindir}
767 ;;
768 UTILITY_BIN_SYMLINK)
769 case $file in nvidia-uninstall) continue;; esac
770 parseparams dest
771 install_symlink nvidia %{nvidia_bindir}
772 ;;
773 NVIDIA_MODPROBE)
774 # A suid-root tool (GPLv2) used as fallback for loading the module and
775 # creating the device nodes in case the driver component is running as
776 # a non-root user (e.g. a CUDA application). While the module is automatically
777 # loaded by udev rules, the device nodes are not automatically created
778 # like with regular drivers and therefore this tool is installed on
779 # Mageia as well, at least for now.
780
781 # We install our self-compiled version in non-simple mode
782 %if %simple
783 install_file nvidia %{nvidia_bindir}
784 %endif
785 ;;
786 INSTALLER_BINARY)
787 # not installed
788 ;;
789 KERNEL_MODULE_SRC|DKMS_CONF)
790 install_src_file nvidia-dkms %{_usrsrc}/%{drivername}-%{version}-%{release}
791 ;;
792 CUDA_ICD)
793 # in theory this should go to the cuda subpackage, but it goes into the main package
794 # as this avoids one broken symlink and it is small enough to not cause space issues
795 install_file nvidia %{_sysconfdir}/%{drivername}
796 ;;
797 APPLICATION_PROFILE)
798 parseparams subdir
799 install_file nvidia %{nvidia_datadir}/$subdir
800 ;;
801 DOT_DESKTOP)
802 # we provide our own for now
803 ;;
804 *)
805 error_unhandled "file $(basename $file) of unknown type $type will be skipped"
806 esac
807 done
808
809 [ -z "$warnings" ] || echo "Please inform Anssi Hannula <anssi@mageia.org> or http://bugs.mageia.org/ of the above warnings." >> warns.log
810
811 %if %simple
812 find %{buildroot}%{_libdir} %{buildroot}%{_prefix}/lib -type d | while read dir; do
813 dir=${dir#%{buildroot}}
814 echo "$dir" | grep -q nvidia && echo "%%dir $dir" >> nvidia.files
815 done
816 [ -d %{buildroot}%{_includedir}/%{drivername} ] && echo "%{_includedir}/%{drivername}" >> nvidia-devel.files
817
818 # for old releases in %%simple mode
819 if ! [ -e %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf ]; then
820 install -m644 kernel/dkms.conf %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf
821 fi
822 %endif
823
824 %if !%simple
825 # confirm SONAME; if something else than libvdpau_nvidia.so or libvdpau_nvidia.so.1, adapt .spec as needed:
826 [ "$(objdump -p %{buildroot}%{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version} | grep SONAME | gawk '{ print $2 }')" = "libvdpau_nvidia.so.1" ]
827
828 rm -f %{buildroot}%{nvidia_libdir}/vdpau/libvdpau_nvidia.so.1
829 rm -f %{buildroot}%{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.1
830 %endif
831
832 # (tmb) libglx compat symlinks for now
833 pushd %{buildroot}%{nvidia_extensionsdir}
834 ln -s libglxserver_nvidia.so.%{version} libglx.so.%{version}
835 ln -s libglxserver_nvidia.so.%{version} libglx.so
836 popd
837
838 # vdpau alternative symlink
839 install -d -m755 %{buildroot}%{_libdir}/vdpau
840 touch %{buildroot}%{_libdir}/vdpau/libvdpau_nvidia.so.1
841 install -d -m755 %{buildroot}%{_prefix}/lib/vdpau
842 touch %{buildroot}%{_prefix}/lib/vdpau/libvdpau_nvidia.so.1
843
844 %if !%simple
845 # self-built binaries
846 install -m755 ../nvidia-settings-%{version}/src/_out/*/nvidia-settings %{buildroot}%{nvidia_bindir}
847 install -m755 ../nvidia-xconfig-%{version}/_out/*/nvidia-xconfig %{buildroot}%{nvidia_bindir}
848 install -m755 ../nvidia-persistenced-%{version}/_out/*/nvidia-persistenced %{buildroot}%{nvidia_bindir}
849 install -m4755 ../nvidia-modprobe-%{version}/_out/*/nvidia-modprobe %{buildroot}%{nvidia_bindir}
850 # nvidia-settings dlopens libnvidia-gtk*.so.VERSION
851 for file in ../nvidia-settings-%{version}/src/_out/*/libnvidia-gtk*.so; do
852 install -m755 ${file} %{buildroot}%{nvidia_libdir}/$(basename "$file").%{version}
853 done
854 %endif
855 # binary alternatives
856 install -d -m755 %{buildroot}%{_bindir}
857 touch %{buildroot}%{_bindir}/nvidia-debugdump
858 touch %{buildroot}%{_bindir}/nvidia-settings
859 touch %{buildroot}%{_bindir}/nvidia-smi
860 touch %{buildroot}%{_bindir}/nvidia-xconfig
861 touch %{buildroot}%{_bindir}/nvidia-bug-report.sh
862 touch %{buildroot}%{_bindir}/nvidia-modprobe
863 touch %{buildroot}%{_bindir}/nvidia-persistenced
864 touch %{buildroot}%{_bindir}/nvidia-cuda-mps-control
865 touch %{buildroot}%{_bindir}/nvidia-cuda-mps-server
866 # rpmlint:
867 chmod 0755 %{buildroot}%{_bindir}/*
868
869 # datadir alternative
870 mkdir -p %{buildroot}%{_datadir}/nvidia
871
872 %if !%simple
873 # See posttrans script
874 #for file in %{buildroot}%{nvidia_datadir}/pci.ids %{buildroot}%{nvidia_datadir}/monitoring.conf; do
875 # ln -T "$file" "%{buildroot}%{_datadir}/%{drivername}/$(basename "$file").mga"
876 #done
877
878 # install man pages
879 install -m644 ../nvidia-settings-%{version}/doc/_out/*/nvidia-settings.1 %{buildroot}%{_mandir}/man1
880 install -m644 ../nvidia-xconfig-%{version}/_out/*/nvidia-xconfig.1 %{buildroot}%{_mandir}/man1
881 install -m644 ../nvidia-modprobe-%{version}/_out/*/nvidia-modprobe.1 %{buildroot}%{_mandir}/man1
882 install -m644 ../nvidia-persistenced-%{version}/_out/*/nvidia-persistenced.1 %{buildroot}%{_mandir}/man1
883 %endif
884 # bug #41638 - whatis entries of nvidia man pages appear wrong
885 gunzip %{buildroot}%{_mandir}/man1/*.gz
886 sed -r -i '/^nvidia\\-[a-z]+ \\- NVIDIA/s,^nvidia\\-,nvidia-,' %{buildroot}%{_mandir}/man1/*.1
887 cd %{buildroot}%{_mandir}/man1
888 rename nvidia alt-%{drivername} *
889 cd -
890 touch %{buildroot}%{_mandir}/man1/nvidia-xconfig.1%{_extension}
891 touch %{buildroot}%{_mandir}/man1/nvidia-settings.1%{_extension}
892 touch %{buildroot}%{_mandir}/man1/nvidia-modprobe.1%{_extension}
893 touch %{buildroot}%{_mandir}/man1/nvidia-persistenced.1%{_extension}
894 touch %{buildroot}%{_mandir}/man1/nvidia-smi.1%{_extension}
895 touch %{buildroot}%{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension}
896
897 # cuda nvidia.icd
898 install -d -m755 %{buildroot}%{_sysconfdir}/OpenCL/vendors
899 touch %{buildroot}%{_sysconfdir}/OpenCL/vendors/nvidia.icd
900
901 # ld.so.conf
902 install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
903 echo "%{nvidia_libdir}" > %{buildroot}%{_sysconfdir}/%{drivername}/ld.so.conf
904 echo "%{nvidia_libdir32}" >> %{buildroot}%{_sysconfdir}/%{drivername}/ld.so.conf
905 install -d -m755 %{buildroot}%{_sysconfdir}/ld.so.conf.d
906 touch %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL.conf
907
908 # modprobe.conf
909 install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d
910 touch %{buildroot}%{_sysconfdir}/modprobe.d/display-driver.conf
911 echo "install nvidia /sbin/modprobe %{modulename} \$CMDLINE_OPTS" > %{buildroot}%{_sysconfdir}/%{drivername}/modprobe.conf
912
913 # xinit script
914 install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
915 cat > %{buildroot}%{_sysconfdir}/%{drivername}/nvidia-settings.xinit <<EOF
916 # to be sourced
917 #
918 # Do not modify this file; the changes will be overwritten.
919 # If you want to disable automatic configuration loading, create
920 # /etc/sysconfig/nvidia-settings with this line: LOAD_NVIDIA_SETTINGS="no"
921 #
922 LOAD_NVIDIA_SETTINGS="yes"
923 [ -f %{_sysconfdir}/sysconfig/nvidia-settings ] && . %{_sysconfdir}/sysconfig/nvidia-settings
924 [ "\$LOAD_NVIDIA_SETTINGS" = "yes" ] && %{_bindir}/nvidia-settings --load-config-only
925 EOF
926 chmod 0755 %{buildroot}%{_sysconfdir}/%{drivername}/nvidia-settings.xinit
927 install -d -m755 %{buildroot}%{_sysconfdir}/X11/xinit.d
928 touch %{buildroot}%{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit
929
930 # install ldetect-lst pcitable files for backports
931 # local version of merge2pcitable.pl:read_nvidia_readme:
932 section="nothingyet"
933 set +x
934 [ -e README.txt ] || cp -a usr/share/doc/README.txt .
935 cat README.txt | while read line; do
936 if [ "$section" = "nothingyet" ] || [ "$section" = "midspace" ]; then
937 if echo "$line" | grep -Pq "^\s*NVIDIA GPU product\s+Device PCI ID"; then
938 section="data"
939 elif [ "$section" = "midspace" ] && echo "$line" | grep -Pq "legacy"; then
940 break
941 fi
942 continue
943 fi
944
945 if [ "$section" = "data" ] && echo "$line" | grep -Pq "^\s*$"; then
946 section="midspace"
947 continue
948 fi
949
950 echo "$line" | grep -Pq "^\s*-+[\s-]+$" && continue
951 id=$(echo "$line" | sed -nre 's,^\s*.+?\s\s+(0x)?([0-9a-fA-F]{4}).*$,\2,p' | tr '[:upper:]' '[:lower:]')
952 #id2=$(echo "$line" | sed -nre 's,^\s*.+?\s\s+0x(....)\s0x(....).*$,\2,p' | tr '[:upper:]' '[:lower:]')
953 subsysid=
954 # not useful as of 2013-05 -Anssi
955 #[ -n "$id2" ] && subsysid=" 0x10de 0x$id2"
956 echo "0x10de 0x$id$subsysid \"Card:%{ldetect_cards_name}\""
957 done | sort -u > pcitable.nvidia.lst
958 set -x
959 [ $(wc -l pcitable.nvidia.lst | cut -f1 -d" ") -gt 200 ]
960 %if "%{ldetect_cards_name}" != ""
961 install -d -m755 %{buildroot}%{_datadir}/ldetect-lst/pcitable.d
962 gzip -c pcitable.nvidia.lst > %{buildroot}%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
963 %endif
964
965 export EXCLUDE_FROM_STRIP="$(find %{buildroot} -type f \! -name nvidia-settings \! -name nvidia-xconfig \! -name nvidia-modprobe \! -name nvidia-persistenced \! -name 'libnvidia-gtk*.so')"
966
967 # set up Vulkan ICD conf for non-glvnd driver
968 sed -i 's/__NV_VK_ICD__/libGL.so.1/' %{buildroot}%{_sysconfdir}/vulkan/icd.d/nvidia_icd.json.template
969 mv %{buildroot}%{_sysconfdir}/vulkan/icd.d/nvidia_icd.json.template %{buildroot}%{_sysconfdir}/vulkan/icd.d/nvidia_icd.json
970
971 %post -n %{driverpkgname}
972 # XFdrake used to generate an nvidia.conf file
973 [ -L %{_sysconfdir}/modprobe.d/nvidia.conf ] || rm -f %{_sysconfdir}/modprobe.d/nvidia.conf
974
975 current_glconf="$(readlink -e %{_sysconfdir}/ld.so.conf.d/GL.conf)"
976
977 # owned by libvdpau1, created in case libvdpau1 is installed only just after
978 # this package
979 mkdir -p %{_libdir}/vdpau
980
981 %{_sbindir}/update-alternatives \
982 --install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf %{priority} \
983 --slave %{_mandir}/man1/nvidia-settings.1%{_extension} man_nvidiasettings%{_extension} %{_mandir}/man1/alt-%{drivername}-settings.1%{_extension} \
984 --slave %{_mandir}/man1/nvidia-xconfig.1%{_extension} man_nvidiaxconfig%{_extension} %{_mandir}/man1/alt-%{drivername}-xconfig.1%{_extension} \
985 --slave %{_mandir}/man1/nvidia-smi.1%{_extension} nvidia-smi.1%{_extension} %{_mandir}/man1/alt-%{drivername}-smi.1%{_extension} \
986 --slave %{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension} nvidia-cuda-mps-control.1%{_extension} %{_mandir}/man1/alt-%{drivername}-cuda-mps-control.1%{_extension} \
987 --slave %{_datadir}/applications/mageia-nvidia-settings.desktop nvidia_desktop %{_datadir}/%{drivername}/mageia-nvidia-settings.desktop \
988 --slave %{_bindir}/nvidia-settings nvidia_settings %{nvidia_bindir}/nvidia-settings \
989 --slave %{_bindir}/nvidia-smi nvidia_smi %{nvidia_bindir}/nvidia-smi \
990 --slave %{_bindir}/nvidia-xconfig nvidia_xconfig %{nvidia_bindir}/nvidia-xconfig \
991 --slave %{_bindir}/nvidia-debugdump nvidia-debugdump %{nvidia_bindir}/nvidia-debugdump \
992 --slave %{_bindir}/nvidia-bug-report.sh nvidia_bug_report %{nvidia_bindir}/nvidia-bug-report.sh \
993 --slave %{_bindir}/nvidia-cuda-mps-control nvidia-cuda-mps-control %{nvidia_bindir}/nvidia-cuda-mps-control \
994 --slave %{_bindir}/nvidia-cuda-mps-server nvidia-cuda-mps-server %{nvidia_bindir}/nvidia-cuda-mps-server \
995 --slave %{_bindir}/nvidia-modprobe nvidia-modprobe %{nvidia_bindir}/nvidia-modprobe \
996 --slave %{_bindir}/nvidia-persistenced nvidia-persistenced %{nvidia_bindir}/nvidia-persistenced \
997 --slave %{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit nvidia-settings.xinit %{_sysconfdir}/%{drivername}/nvidia-settings.xinit \
998 --slave %{_libdir}/vdpau/libvdpau_nvidia.so.1 %{_lib}vdpau_nvidia.so.1 %{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version} \
999 --slave %{_sysconfdir}/modprobe.d/display-driver.conf display-driver.conf %{_sysconfdir}/%{drivername}/modprobe.conf \
1000 --slave %{_sysconfdir}/OpenCL/vendors/nvidia.icd nvidia.icd %{_sysconfdir}/%{drivername}/nvidia.icd \
1001 --slave %{_prefix}/lib/vdpau/libvdpau_nvidia.so.1 libvdpau_nvidia.so.1 %{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.%{version} \
1002 --slave %{xorg_extra_modules} xorg_extra_modules %{nvidia_extensionsdir} \
1003 --slave %{_datadir}/nvidia nvidia_datadir %{nvidia_datadir} \
1004
1005 if [ "${current_glconf}" = "%{_sysconfdir}/nvidia97xx/ld.so.conf" ]; then
1006 # Adapt for the renaming of the driver. X.org config still has the old ModulePaths
1007 # but they do not matter as we are using alternatives for libglx.so now.
1008 %{_sbindir}/update-alternatives --set gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf
1009 fi
1010 # explicit /sbin/ldconfig due to alternatives
1011 /sbin/ldconfig -X
1012
1013 %if "%{ldetect_cards_name}" != ""
1014 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
1015 %endif
1016
1017 %posttrans -n %{driverpkgname}
1018 # When upgrading 340 => 346, the alternativeszification of /usr/share/nvidia may
1019 # cause uninstallation of 340 (during upgrade) to remove these files through
1020 # the /usr/share/nvidia symlink. Restore them.
1021 for file in %{nvidia_datadir}/pci.ids %{nvidia_datadir}/monitoring.conf; do
1022 backupfile="%{_datadir}/%{drivername}/$(basename "$file").mga"
1023 if ! [ -e $file ] && [ -e "$backupfile" ]; then
1024 ln -T "$backupfile" "$file"
1025 fi
1026 done
1027
1028 %postun -n %{driverpkgname}
1029 if [ ! -f %{_sysconfdir}/%{drivername}/ld.so.conf ]; then
1030 %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf
1031 fi
1032 # explicit /sbin/ldconfig due to alternatives
1033 /sbin/ldconfig -X
1034
1035 %if "%{ldetect_cards_name}" != ""
1036 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
1037 %endif
1038
1039 %post -n %{drivername}-cuda-opencl
1040 # explicit /sbin/ldconfig due to a non-standard library directory
1041 /sbin/ldconfig -X
1042
1043 %post -n %{drivername}-devel
1044 # explicit /sbin/ldconfig due to a non-standard library directory (mga#14462)
1045 /sbin/ldconfig -X
1046
1047 %post -n dkms-%{drivername}
1048 /usr/sbin/dkms --rpm_safe_upgrade add -m %{drivername} -v %{version}-%{release}
1049 if [ -z "$DURING_INSTALL" ] ; then
1050 /usr/sbin/dkms --rpm_safe_upgrade build -m %{drivername} -v %{version}-%{release} &&
1051 /usr/sbin/dkms --rpm_safe_upgrade install -m %{drivername} -v %{version}-%{release} --force
1052 fi
1053
1054 # rmmod any old driver if present and not in use (e.g. by X)
1055 rmmod nvidia > /dev/null 2>&1 || true
1056
1057 %preun -n dkms-%{drivername}
1058 /usr/sbin/dkms --rpm_safe_upgrade remove -m %{drivername} -v %{version}-%{release} --all
1059
1060 # rmmod any old driver if present and not in use (e.g. by X)
1061 rmmod nvidia > /dev/null 2>&1 || true
1062
1063 %clean
1064 rm -rf %{buildroot}
1065
1066 %files -n %{driverpkgname} -f %{pkgname}/nvidia.files
1067 %defattr(-,root,root)
1068 # other documentation files are listed in nvidia.files
1069 %doc README.install.urpmi README.manual-setup
1070
1071 %if "%{ldetect_cards_name}" != ""
1072 %{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
1073 %endif
1074
1075 # ld.so.conf, modprobe.conf, xinit
1076 %ghost %{_sysconfdir}/ld.so.conf.d/GL.conf
1077 %ghost %{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit
1078 %ghost %{_sysconfdir}/modprobe.d/display-driver.conf
1079 %dir %{_sysconfdir}/%{drivername}
1080 %{_sysconfdir}/%{drivername}/modprobe.conf
1081 %{_sysconfdir}/%{drivername}/ld.so.conf
1082 %{_sysconfdir}/%{drivername}/nvidia-settings.xinit
1083 %{_sysconfdir}/vulkan/icd.d/nvidia_icd.json
1084 %ghost %{_datadir}/nvidia
1085 %if !%simple
1086 %{_sysconfdir}/%{drivername}/nvidia.icd
1087 %dir %{nvidia_datadir}
1088 %{nvidia_datadir}/nvidia-application-profiles-%{version}-rc
1089 %{nvidia_datadir}/nvidia-application-profiles-%{version}-key-documentation
1090 #{nvidia_datadir}/monitoring.conf
1091 #{nvidia_datadir}/pci.ids
1092 # backups, see posttrans
1093 #{_datadir}/%{drivername}/monitoring.conf.mga
1094 #{_datadir}/%{drivername}/pci.ids.mga
1095 %endif
1096
1097 %dir %{_sysconfdir}/OpenCL
1098 %dir %{_sysconfdir}/OpenCL/vendors
1099 %ghost %{_sysconfdir}/OpenCL/vendors/nvidia.icd
1100
1101 %ghost %{_bindir}/nvidia-debugdump
1102 %ghost %{_bindir}/nvidia-settings
1103 %ghost %{_bindir}/nvidia-smi
1104 %ghost %{_bindir}/nvidia-xconfig
1105 %ghost %{_bindir}/nvidia-modprobe
1106 %ghost %{_bindir}/nvidia-persistenced
1107 %ghost %{_bindir}/nvidia-bug-report.sh
1108 %ghost %{_bindir}/nvidia-cuda-mps-control
1109 %ghost %{_bindir}/nvidia-cuda-mps-server
1110 %if !%simple
1111 %dir %{nvidia_bindir}
1112 %{nvidia_bindir}/nvidia-debugdump
1113 %{nvidia_bindir}/nvidia-settings
1114 %{nvidia_bindir}/nvidia-smi
1115 %{nvidia_bindir}/nvidia-xconfig
1116 %{nvidia_bindir}/nvidia-modprobe
1117 %{nvidia_bindir}/nvidia-persistenced
1118 %{nvidia_bindir}/nvidia-bug-report.sh
1119 %{nvidia_bindir}/nvidia-cuda-mps-control
1120 %{nvidia_bindir}/nvidia-cuda-mps-server
1121 %endif
1122
1123 %ghost %{_mandir}/man1/nvidia-xconfig.1%{_extension}
1124 %ghost %{_mandir}/man1/nvidia-settings.1%{_extension}
1125 %ghost %{_mandir}/man1/nvidia-modprobe.1%{_extension}
1126 %ghost %{_mandir}/man1/nvidia-persistenced.1%{_extension}
1127 %ghost %{_mandir}/man1/nvidia-smi.1%{_extension}
1128 %ghost %{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension}
1129 %if !%simple
1130 %{_mandir}/man1/alt-%{drivername}-xconfig.1*
1131 %{_mandir}/man1/alt-%{drivername}-settings.1*
1132 %{_mandir}/man1/alt-%{drivername}-modprobe.1*
1133 %{_mandir}/man1/alt-%{drivername}-persistenced.1*
1134 %{_mandir}/man1/alt-%{drivername}-smi.1*
1135 %{_mandir}/man1/alt-%{drivername}-cuda-mps-control.1*
1136 %else
1137 %{_mandir}/man1/alt-%{drivername}-*
1138 %endif
1139
1140 %ghost %{_datadir}/applications/mageia-nvidia-settings.desktop
1141 %dir %{_datadir}/%{drivername}
1142 %{_datadir}/%{drivername}/mageia-nvidia-settings.desktop
1143
1144 %if !%simple
1145 %{_iconsdir}/hicolor/16x16/apps/%{drivername}-settings.png
1146 %{_iconsdir}/hicolor/32x32/apps/%{drivername}-settings.png
1147 %endif
1148 %{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
1149
1150 %if !%simple
1151 %dir %{nvidia_libdir}
1152 %dir %{nvidia_libdir}/tls
1153 %dir %{nvidia_libdir}/vdpau
1154 %{nvidia_libdir}/libGL.so.%{version}
1155 %{nvidia_libdir}/libnvidia-cfg.so.%{version}
1156 %{nvidia_libdir}/libnvidia-glcore.so.%{version}
1157 %{nvidia_libdir}/libnvidia-tls.so.%{version}
1158 %{nvidia_libdir}/libEGL.so.1
1159 %{nvidia_libdir}/libEGL.so.%{version}
1160 %{nvidia_libdir}/libEGL_nvidia.so.0
1161 %{nvidia_libdir}/libEGL_nvidia.so.%{version}
1162 %{nvidia_libdir}/libGL.so.1
1163 %{nvidia_libdir}/libGLdispatch.so.0
1164 %{nvidia_libdir}/libGLESv1_CM.so.1
1165 %{nvidia_libdir}/libGLESv1_CM.so.1.2.0
1166 %{nvidia_libdir}/libGLESv1_CM_nvidia.so.1
1167 %{nvidia_libdir}/libGLESv1_CM_nvidia.so.%{version}
1168 %{nvidia_libdir}/libGLESv2.so.2
1169 %{nvidia_libdir}/libGLESv2.so.2.1.0
1170 %{nvidia_libdir}/libGLESv2_nvidia.so.2
1171 %{nvidia_libdir}/libGLESv2_nvidia.so.%{version}
1172 %{nvidia_libdir}/libGLX_indirect.so.0
1173 %{nvidia_libdir}/libGLX_nvidia.so.0
1174 %{nvidia_libdir}/libGLX_nvidia.so.%{version}
1175 %{nvidia_libdir}/libOpenGL.so.0
1176 %{nvidia_libdir}/libnvidia-cbl.so.%{version}
1177 %{nvidia_libdir}/libnvidia-cfg.so.1
1178 %{nvidia_libdir}/libnvidia-eglcore.so.%{version}
1179 %{nvidia_libdir}/libnvidia-egl-wayland.so.1.1.0
1180 %{nvidia_libdir}/libnvidia-fatbinaryloader.so.%{version}
1181 %{nvidia_libdir}/libnvidia-fbc.so.1
1182 %{nvidia_libdir}/libnvidia-fbc.so.%{version}
1183 %{nvidia_libdir}/libnvidia-glsi.so.%{version}
1184 %{nvidia_libdir}/libnvidia-glvkspirv.so.%{version}
1185 %{nvidia_libdir}/libnvidia-gtk2.so.%{version}
1186 %{nvidia_libdir}/libnvidia-gtk3.so.%{version}
1187 %{nvidia_libdir}/libnvidia-ifr.so.1
1188 %{nvidia_libdir}/libnvidia-ifr.so.%{version}
1189 %{nvidia_libdir}/libnvidia-ml.so.1
1190 %{nvidia_libdir}/libnvidia-ml.so.%{version}
1191 %{nvidia_libdir}/libnvidia-ptxjitcompiler.so.1
1192 %{nvidia_libdir}/libnvidia-ptxjitcompiler.so.%{version}
1193 %{nvidia_libdir}/libnvidia-rtcore.so.%{version}
1194 %{nvidia_libdir}/libnvoptix.so.1
1195 %{nvidia_libdir}/libnvoptix.so.%{version}
1196 %{nvidia_libdir}/libvdpau_nvidia.so
1197 %{nvidia_libdir}/tls/libnvidia-tls.so.%{version}
1198 %{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version}
1199 %dir %{nvidia_libdir32}
1200 %dir %{nvidia_libdir32}/tls
1201 %dir %{nvidia_libdir32}/vdpau
1202 %{nvidia_libdir32}/libEGL.so.1
1203 %{nvidia_libdir32}/libEGL.so.%{version}
1204 %{nvidia_libdir32}/libEGL_nvidia.so.0
1205 %{nvidia_libdir32}/libEGL_nvidia.so.%{version}
1206 %{nvidia_libdir32}/libGL.so.1
1207 %{nvidia_libdir32}/libGL.so.%{version}
1208 %{nvidia_libdir32}/libGLdispatch.so.0
1209 %{nvidia_libdir32}/libGLESv1_CM.so.1
1210 %{nvidia_libdir32}/libGLESv1_CM.so.1.2.0
1211 %{nvidia_libdir32}/libGLESv1_CM_nvidia.so.1
1212 %{nvidia_libdir32}/libGLESv1_CM_nvidia.so.%{version}
1213 %{nvidia_libdir32}/libGLESv2.so.2
1214 %{nvidia_libdir32}/libGLESv2.so.2.1.0
1215 %{nvidia_libdir32}/libGLESv2_nvidia.so.2
1216 %{nvidia_libdir32}/libGLESv2_nvidia.so.%{version}
1217 %{nvidia_libdir32}/libGLX_indirect.so.0
1218 %{nvidia_libdir32}/libGLX_nvidia.so.0
1219 %{nvidia_libdir32}/libGLX_nvidia.so.%{version}
1220 %{nvidia_libdir32}/libOpenGL.so.0
1221 %{nvidia_libdir32}/libnvidia-eglcore.so.%{version}
1222 %{nvidia_libdir32}/libnvidia-fatbinaryloader.so.%{version}
1223 %{nvidia_libdir32}/libnvidia-fbc.so.1
1224 %{nvidia_libdir32}/libnvidia-fbc.so.%{version}
1225 %{nvidia_libdir32}/libnvidia-glcore.so.%{version}
1226 %{nvidia_libdir32}/libnvidia-glsi.so.%{version}
1227 %{nvidia_libdir32}/libnvidia-glvkspirv.so.%{version}
1228 %{nvidia_libdir32}/libnvidia-ifr.so.1
1229 %{nvidia_libdir32}/libnvidia-ifr.so.%{version}
1230 %{nvidia_libdir32}/libnvidia-ml.so.1
1231 %{nvidia_libdir32}/libnvidia-ml.so.%{version}
1232 %{nvidia_libdir32}/libnvidia-tls.so.%{version}
1233 %{nvidia_libdir32}/libnvidia-ptxjitcompiler.so.1
1234 %{nvidia_libdir32}/libnvidia-ptxjitcompiler.so.%{version}
1235 %{nvidia_libdir32}/libvdpau_nvidia.so
1236 %{nvidia_libdir32}/tls/libnvidia-tls.so.%{version}
1237 %{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.%{version}
1238 # %simple
1239 %endif
1240
1241 %ghost %{_libdir}/vdpau/libvdpau_nvidia.so.1
1242 # avoid unowned directory
1243 %dir %{_prefix}/lib/vdpau
1244 %ghost %{_prefix}/lib/vdpau/libvdpau_nvidia.so.1
1245
1246 %if !%simple
1247 %dir %{nvidia_modulesdir}
1248 %{nvidia_modulesdir}/libnvidia-wfb.so.1
1249 %endif
1250
1251 %if !%simple
1252 %{nvidia_modulesdir}/libnvidia-wfb.so.%{version}
1253 %endif
1254
1255 %if !%simple
1256 # compat symlinks
1257 %{nvidia_extensionsdir}/libglx.so.%{version}
1258 %{nvidia_extensionsdir}/libglx.so
1259 %{nvidia_extensionsdir}/libglxserver_nvidia.so.%{version}
1260 %{nvidia_extensionsdir}/libglxserver_nvidia.so
1261 %endif
1262
1263 %if !%simple
1264 %{nvidia_driversdir}/nvidia_drv.so
1265 %endif
1266
1267 %if %simple
1268 %files -n %{drivername}-devel -f %pkgname/nvidia-devel.files
1269 %else
1270 %files -n %{drivername}-devel
1271 %defattr(-,root,root)
1272 %{nvidia_libdir}/libEGL.so
1273 %{nvidia_libdir}/libGL.so
1274 %{nvidia_libdir}/libGLESv1_CM.so
1275 %{nvidia_libdir}/libGLESv2.so
1276 %{nvidia_libdir}/libOpenCL.so
1277 %{nvidia_libdir}/libOpenGL.so
1278 %{nvidia_libdir}/libcuda.so
1279 %{nvidia_libdir}/libnvcuvid.so
1280 %{nvidia_libdir}/libnvidia-cfg.so
1281 %{nvidia_libdir}/libnvidia-encode.so
1282 %{nvidia_libdir}/libnvidia-fbc.so
1283 %{nvidia_libdir}/libnvidia-ifr.so
1284 %{nvidia_libdir}/libnvidia-ml.so
1285 %{nvidia_libdir}/libnvidia-ptxjitcompiler.so
1286 %{nvidia_libdir32}/libEGL.so
1287 %{nvidia_libdir32}/libGL.so
1288 %{nvidia_libdir32}/libGLESv1_CM.so
1289 %{nvidia_libdir32}/libGLESv2.so
1290 %{nvidia_libdir32}/libOpenCL.so
1291 %{nvidia_libdir32}/libOpenGL.so
1292 %{nvidia_libdir32}/libcuda.so
1293 %{nvidia_libdir32}/libnvcuvid.so
1294 %{nvidia_libdir32}/libnvidia-encode.so
1295 %{nvidia_libdir32}/libnvidia-fbc.so
1296 %{nvidia_libdir32}/libnvidia-ifr.so
1297 %{nvidia_libdir32}/libnvidia-ml.so
1298 %{nvidia_libdir32}/libnvidia-ptxjitcompiler.so
1299 %endif
1300
1301 %files -n dkms-%{drivername}
1302 %defattr(-,root,root)
1303 %doc %{pkgname}/LICENSE
1304 %{_usrsrc}/%{drivername}-%{version}-%{release}
1305
1306 %files -n %{drivername}-doc-html -f %pkgname/nvidia-html.files
1307 %defattr(-,root,root)
1308
1309 %if %simple
1310 %files -n %{drivername}-cuda-opencl -f %pkgname/nvidia-cuda.files
1311 %else
1312 %files -n %{drivername}-cuda-opencl
1313 %defattr(-,root,root)
1314 # Do not preferably add any alternativeszificated binaries here,
1315 # they cause broken symlinks.
1316 %{nvidia_libdir}/libOpenCL.so.1.0.0
1317 %{nvidia_libdir}/libOpenCL.so.1.0
1318 %{nvidia_libdir}/libOpenCL.so.1
1319 %{nvidia_libdir}/libnvcuvid.so.%{version}
1320 %{nvidia_libdir}/libnvcuvid.so.1
1321 %{nvidia_libdir}/libnvidia-compiler.so.%{version}
1322 %{nvidia_libdir}/libnvidia-encode.so.1
1323 %{nvidia_libdir}/libnvidia-encode.so.%{version}
1324 %{nvidia_libdir}/libnvidia-opencl.so.1
1325 %{nvidia_libdir}/libnvidia-opencl.so.%{version}
1326 %{nvidia_libdir}/libcuda.so.%{version}
1327 %{nvidia_libdir}/libcuda.so.1
1328 %{nvidia_libdir32}/libOpenCL.so.1.0.0
1329 %{nvidia_libdir32}/libOpenCL.so.1.0
1330 %{nvidia_libdir32}/libOpenCL.so.1
1331 %{nvidia_libdir32}/libnvcuvid.so.%{version}
1332 %{nvidia_libdir32}/libnvcuvid.so.1
1333 %{nvidia_libdir32}/libnvidia-compiler.so.%{version}
1334 %{nvidia_libdir32}/libnvidia-encode.so.1
1335 %{nvidia_libdir32}/libnvidia-encode.so.%{version}
1336 %{nvidia_libdir32}/libnvidia-opencl.so.1
1337 %{nvidia_libdir32}/libnvidia-opencl.so.%{version}
1338 %{nvidia_libdir32}/libcuda.so.%{version}
1339 %{nvidia_libdir32}/libcuda.so.1
1340 %endif

  ViewVC Help
Powered by ViewVC 1.1.30