- release 4
[packages/xorg-driver-video-nvidia.git] / xorg-driver-video-nvidia.spec
CommitLineData
2b14e59b 1# TODO
ff89f094 2# - solve this (shouldn't there be some obsoletes?):
2b14e59b
ER
3# error: xorg-driver-video-nvidia-169.12-3.i686 (cnfl Mesa-libGL) conflicts with installed Mesa-libGL-7.0.3-2.i686
4# error: xorg-driver-video-nvidia-169.12-3.i686 (cnfl Mesa-libGL) conflicts with installed Mesa-libGL-7.0.3-2.i686
28142503
PS
5#
6# Conditional build:
7%bcond_without dist_kernel # without distribution kernel
bf683e7a 8%bcond_without kernel # without kernel packages
1820d34b 9%bcond_without userspace # don't build userspace programs
ffec07c8 10%bcond_with multigl # package libGL and libglx.so in a way allowing concurrent install with nvidia/fglrx drivers
a14b5013 11%bcond_with verbose # verbose build (V=1)
12
a14b5013 13%if "%{_alt_kernel}" != "%{nil}"
14%undefine with_userspace
22d6cc34 15%endif
c543fa7c
ER
16%if %{without userspace}
17# nothing to be placed to debuginfo package
18%define _enable_debug_packages 0
19%endif
c5bb5957 20
a14b5013 21%define pname xorg-driver-video-nvidia
5d85b970 22%define rel 4
a14b5013 23
974295b8
JB
24Summary: Linux Drivers for nVidia GeForce/Quadro Chips
25Summary(pl.UTF-8): Sterowniki do kart graficznych nVidia GeForce/Quadro
a14b5013 26Name: %{pname}%{_alt_kernel}
9be432a2 27Version: 180.22
c5bb5957 28Release: %{rel}%{?with_multigl:.mgl}
28142503 29License: nVidia Binary
4a185d32 30Group: X11
13d95184 31Source0: http://us.download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}-pkg1.run
9be432a2 32# Source0-md5: bf6c44f82123a315244e04a5aede11ab
13d95184 33Source1: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run
9be432a2 34# Source1-md5: 6839441e92c2605327073d586c3077d9
a14b5013 35Source2: %{pname}-xinitrc.sh
bcf69910
JB
36Patch0: X11-driver-nvidia-GL.patch
37Patch1: X11-driver-nvidia-desktop.patch
f517f625 38URL: http://www.nvidia.com/object/unix.html
82268c76 39%if %{with kernel}
0e15e33b 40%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
82268c76 41%endif
28142503 42BuildRequires: %{kgcc_package}
d68f27fd 43BuildRequires: rpmbuild(macros) >= 1.379
039c7221 44BuildRequires: sed >= 4.0
0ed6aeef 45BuildConflicts: XFree86-nvidia
8343d24d 46Requires: xorg-xserver-server
53f1c2ec
PZ
47Requires: xorg-xserver-server(videodrv-abi) >= 2.0
48Requires: xorg-xserver-server(videodrv-abi) <= 4.1
1b8b7646 49Provides: OpenGL = 2.1
63c6d4b1 50Provides: OpenGL-GLX = 1.4
4e3e8de1 51Provides: xorg-xserver-module(glx)
2b14e59b 52%if %{without multigl}
28142503 53Obsoletes: Mesa
ffec07c8 54%endif
fff74aa2
AM
55Obsoletes: X11-OpenGL-core < 1:7.0.0
56Obsoletes: X11-OpenGL-libGL < 1:7.0.0
57Obsoletes: XFree86-OpenGL-core < 1:7.0.0
58Obsoletes: XFree86-OpenGL-libGL < 1:7.0.0
2d490dca 59Obsoletes: XFree86-driver-nvidia
28142503 60Obsoletes: XFree86-nvidia
2b14e59b 61%if %{without multigl}
4a61f89d
PZ
62Conflicts: Mesa-libGL
63%endif
28142503 64Conflicts: XFree86-OpenGL-devel <= 4.2.0-3
1b927e61 65ExclusiveArch: %{ix86} %{x8664}
28142503
PS
66BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
03da6314 68%define _noautoreqdep libGL.so.1 libGLcore.so.1
28142503
PS
69
70%description
974295b8
JB
71This driver set adds improved 2D functionality to the Xorg X server as
72well as high performance OpenGL acceleration, AGP support, support for
73most flat panels, and 2D multiple monitor support. Supported hardware:
74modern NVIDIA GeForce (from GeForce2 MX) and Quadro (Quadro4 and up)
75based graphics accelerators.
28142503 76
974295b8
JB
77The older graphics chips are unsupported:
78- NV1 and RIVA 128/128ZX chips are supported in the base Xorg install
79 (nv driver)
80- TNT/TNT2/GeForce 256/GeForce2 Ultra/Quadro2 are suported by -legacy
81 drivers.
28142503 82
c311612f 83%description -l pl.UTF-8
974295b8
JB
84Usprawnione sterowniki dla kart graficznych nVidia do serwera Xorg,
85dające wysokowydajną akcelerację OpenGL, obsługę AGP i wielu monitorów
862D. Obsługują w miarę nowe karty NVIDIA GeForce (od wersji GeForce2
87MX) oraz Quadro (od wersji Quadro4).
28142503 88
974295b8
JB
89Starsze układy graficzne nie są obsługiwane przez ten pakiet:
90- NV1 i RIVA 128/128ZX są obsługiwane przez sterownik nv z Xorg
91- TNT/TNT2/GeForce 256/GeForce 2 Ultra/Quadro 2 są obsługiwane przez
92 sterowniki -legacy
28142503
PS
93
94%package devel
63c6d4b1
JB
95Summary: OpenGL (GL and GLX) header files
96Summary(pl.UTF-8): Pliki nagłówkowe OpenGL (GL i GLX)
28142503 97Group: X11/Development/Libraries
2d490dca 98Requires: %{name} = %{version}-%{release}
63c6d4b1 99Provides: OpenGL-GLX-devel = 1.4
1b8b7646 100Provides: OpenGL-devel = 2.1
63c6d4b1
JB
101Obsoletes: X11-OpenGL-devel-base
102Obsoletes: XFree86-OpenGL-devel-base
2d490dca 103Obsoletes: XFree86-driver-nvidia-devel
28142503
PS
104Conflicts: XFree86-OpenGL-devel < 4.3.99.902-0.3
105
106%description devel
63c6d4b1
JB
107OpenGL header files (GL and GLX only) for NVIDIA OpenGL
108implementation.
28142503 109
c311612f 110%description devel -l pl.UTF-8
63c6d4b1
JB
111Pliki nagłówkowe OpenGL (tylko GL i GLX) dla implementacji OpenGL
112firmy NVIDIA.
113
114%package static
115Summary: Static XvMCNVIDIA library
116Summary(pl.UTF-8): Statyczna biblioteka XvMCNVIDIA
117Group: X11/Development/Libraries
118Requires: %{name}-devel = %{version}-%{release}
119
120%description static
121Static XvMCNVIDIA library.
122
123%description static -l pl.UTF-8
124Statyczna biblioteka XvMCNVIDIA.
28142503
PS
125
126%package progs
127Summary: Tools for advanced control of nVidia graphic cards
b37addd9 128Summary(pl.UTF-8): Narzędzia do zarządzania kartami graficznymi nVidia
f12e8b24 129Group: Applications/System
2d490dca 130Requires: %{name} = %{version}-%{release}
c29343e3 131Suggests: pkgconfig
c064a147 132Obsoletes: XFree86-driver-nvidia-progs
28142503
PS
133
134%description progs
135Tools for advanced control of nVidia graphic cards.
136
c311612f
JR
137%description progs -l pl.UTF-8
138Narzędzia do zarządzania kartami graficznymi nVidia.
28142503 139
00aee69a 140%package -n kernel%{_alt_kernel}-video-nvidia
28142503 141Summary: nVidia kernel module for nVidia Architecture support
b37addd9
ER
142Summary(de.UTF-8): Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung
143Summary(pl.UTF-8): Moduł jądra dla obsługi kart graficznych nVidia
c5bb5957 144Release: %{rel}@%{_kernel_ver_str}
28142503 145Group: Base/Kernel
28142503
PS
146Requires(post,postun): /sbin/depmod
147Requires: dev >= 2.7.7-10
d68f27fd 148%{?with_dist_kernel:%requires_releq_kernel}
ffdea5a6 149Requires: %{pname} = %{version}-%{rel}
2d490dca 150Provides: X11-driver-nvidia(kernel)
28142503
PS
151Obsoletes: XFree86-nvidia-kernel
152
00aee69a 153%description -n kernel%{_alt_kernel}-video-nvidia
28142503
PS
154nVidia Architecture support for Linux kernel.
155
c311612f
JR
156%description -n kernel%{_alt_kernel}-video-nvidia -l de.UTF-8
157Die nVidia-Architektur-Unterstützung für den Linux-Kern.
28142503 158
c311612f
JR
159%description -n kernel%{_alt_kernel}-video-nvidia -l pl.UTF-8
160Obsługa architektury nVidia dla jądra Linuksa. Pakiet wymagany przez
0ed6aeef 161sterownik nVidii dla Xorg/XFree86.
28142503 162
28142503
PS
163%prep
164cd %{_builddir}
a14b5013 165rm -rf NVIDIA-Linux-x86*-%{version}-pkg*
039c7221 166%ifarch %{ix86}
28142503 167/bin/sh %{SOURCE0} --extract-only
a14b5013 168%setup -qDT -n NVIDIA-Linux-x86-%{version}-pkg1
039c7221
PS
169%else
170/bin/sh %{SOURCE1} --extract-only
a14b5013 171%setup -qDT -n NVIDIA-Linux-x86_64-%{version}-pkg2
039c7221 172%endif
bcf69910 173%patch0 -p1
0029e8cc 174%patch1 -p1
eb6ba6c9 175echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> usr/src/nv/Makefile.kbuild
28142503
PS
176
177%build
2317af94 178%if %{with kernel}
19777214 179cd usr/src/nv
d4a34ce2 180ln -sf Makefile.kbuild Makefile
94ef5e53 181cat >> Makefile <<'EOF'
182
183$(obj)/nv-kernel.o: $(src)/nv-kernel.o.bin
184 cp $< $@
185EOF
186mv nv-kernel.o{,.bin}
12a94e85 187%build_kernel_modules -m nvidia
2317af94 188%endif
28142503
PS
189
190%install
191rm -rf $RPM_BUILD_ROOT
1820d34b
ER
192
193%if %{with userspace}
eb6ba6c9 194install -d $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,extensions} \
c2fc5475 195 $RPM_BUILD_ROOT{%{_includedir}/{GL,cuda,vdpau},%{_libdir},%{_bindir},%{_mandir}/man1} \
2a45f872 196 $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/etc/X11/xinit/xinitrc.d}
ffec07c8
JR
197%if %{with multigl}
198install -d $RPM_BUILD_ROOT{%{_libdir}/nvidia,%{_sysconfdir}/ld.so.conf.d}
199%endif
28142503 200
7a2ced2a 201install usr/bin/nvidia-{settings,xconfig,bug-report.sh} $RPM_BUILD_ROOT%{_bindir}
225cc701 202install usr/share/man/man1/nvidia-{settings,xconfig}.* $RPM_BUILD_ROOT%{_mandir}/man1
203install usr/share/applications/nvidia-settings.desktop $RPM_BUILD_ROOT%{_desktopdir}
7a2ced2a 204install usr/share/pixmaps/nvidia-settings.png $RPM_BUILD_ROOT%{_pixmapsdir}
2a45f872 205install %{SOURCE2} $RPM_BUILD_ROOT/etc/X11/xinit/xinitrc.d/nvidia-settings.sh
eb6ba6c9
PS
206
207for f in \
208 usr/lib/tls/libnvidia-tls.so.%{version} \
069d2a12 209 usr/lib/libnvidia-cfg.so.%{version} \
eb6ba6c9 210 usr/lib/libGL{,core}.so.%{version} \
c2fc5475
SP
211 usr/lib/libcuda.so.%{version} \
212 usr/lib/libvdpau{,_nvidia,_trace}.so.%{version} \
eb6ba6c9 213 usr/X11R6/lib/libXvMCNVIDIA.so.%{version} \
2b14e59b 214%if %{without multigl}
eb6ba6c9
PS
215 usr/X11R6/lib/libXvMCNVIDIA.a \
216; do
217 install $f $RPM_BUILD_ROOT%{_libdir}
218done
ffec07c8
JR
219%else
220; do
221 install $f $RPM_BUILD_ROOT%{_libdir}/nvidia
222done
223install usr/X11R6/lib/libXvMCNVIDIA.a $RPM_BUILD_ROOT%{_libdir}
224%endif
eb6ba6c9 225
d4a34ce2 226install usr/X11R6/lib/modules/extensions/libglx.so.%{version} \
eb6ba6c9 227 $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions
23ae74e1 228install usr/X11R6/lib/modules/drivers/nvidia_drv.so \
229 $RPM_BUILD_ROOT%{_libdir}/xorg/modules/drivers
069d2a12 230install usr/X11R6/lib/modules/libnvidia-wfb.so.%{version} \
231 $RPM_BUILD_ROOT%{_libdir}/xorg/modules
28142503 232
eb6ba6c9 233install usr/include/GL/*.h $RPM_BUILD_ROOT%{_includedir}/GL
c2fc5475
SP
234install usr/include/cuda/*.h $RPM_BUILD_ROOT%{_includedir}/cuda
235install usr/include/vdpau/*.h $RPM_BUILD_ROOT%{_includedir}/vdpau
28142503 236
eb6ba6c9 237ln -sf libglx.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/libglx.so
28142503 238
ffec07c8
JR
239%if %{with multigl}
240echo %{_libdir}/nvidia >$RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/nvidia.conf
241
242# OpenGL ABI for Linux compatibility
243ln -sf libGL.so.%{version} $RPM_BUILD_ROOT%{_libdir}/nvidia/libGL.so.1
244ln -sf nvidia/libGL.so.1 $RPM_BUILD_ROOT%{_libdir}/libGL.so
245
246ln -sf nvidia/libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libXvMCNVIDIA.so
247ln -sf libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/nvidia/libXvMCNVIDIA_dynamic.so.1
c2fc5475
SP
248
249ln -sf nvidia/libvdpau.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libvdpau.so
250ln -sf nvidia/libcuda.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libcuda.so
ffec07c8 251%else
28142503 252# OpenGL ABI for Linux compatibility
eb6ba6c9
PS
253ln -sf libGL.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libGL.so.1
254ln -sf libGL.so.1 $RPM_BUILD_ROOT%{_libdir}/libGL.so
ffec07c8
JR
255
256ln -sf libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libXvMCNVIDIA.so
257ln -sf libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libXvMCNVIDIA_dynamic.so.1
c2fc5475
SP
258
259ln -sf libvdpau.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libvdpau.so
260ln -sf libcuda.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libcuda.so
ffec07c8 261%endif
1820d34b 262%endif
28142503 263
1fdf7dcc 264%if %{with kernel}
12a94e85 265%install_kernel_modules -m usr/src/nv/nvidia -d misc
1fdf7dcc 266%endif
28142503
PS
267
268%clean
269rm -rf $RPM_BUILD_ROOT
270
a641155e 271%post
ffbb3439 272/sbin/ldconfig
2b14e59b
ER
273cat << 'EOF'
274NOTE: You must also install kernel module for this driver to work
275 kernel-video-nvidia-%{version}
2b14e59b 276 kernel-desktop-video-nvidia-%{version}
b25e7843
ER
277 kernel-laptop-video-nvidia-%{version}
278 kernel-vanilla-video-nvidia-%{version}
2b14e59b
ER
279
280Depending on which kernel brand you use.
281
25b520ff 282EOF
504709c0
JR
283%if %{with multigl}
284if [ ! -e %{_libdir}/xorg/modules/extensions/libglx.so ]; then
285 ln -sf libglx.so.%{version} %{_libdir}/xorg/modules/extensions/libglx.so
286fi
287%endif
25b520ff 288
ffbb3439 289%postun -p /sbin/ldconfig
25b520ff 290
00aee69a 291%post -n kernel%{_alt_kernel}-video-nvidia
28142503
PS
292%depmod %{_kernel_ver}
293
00aee69a 294%postun -n kernel%{_alt_kernel}-video-nvidia
28142503
PS
295%depmod %{_kernel_ver}
296
1820d34b 297%if %{with userspace}
28142503
PS
298%files
299%defattr(644,root,root,755)
300%doc LICENSE
225cc701 301%doc usr/share/doc/{README.txt,NVIDIA_Changelog,XF86Config.sample,html}
ffec07c8
JR
302%if %{with multigl}
303%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ld.so.conf.d/nvidia.conf
304%dir %{_libdir}/nvidia
305%attr(755,root,root) %{_libdir}/nvidia/libGL.so.*.*
306%attr(755,root,root) %ghost %{_libdir}/nvidia/libGL.so.1
307%attr(755,root,root) %{_libdir}/nvidia/libGLcore.so.*.*
308%attr(755,root,root) %{_libdir}/nvidia/libXvMCNVIDIA.so.*.*
309%attr(755,root,root) %{_libdir}/nvidia/libXvMCNVIDIA_dynamic.so.1
c2fc5475 310%attr(755,root,root) %{_libdir}/nvidia/libcuda.so.*.*
c75f043c 311%attr(755,root,root) %{_libdir}/nvidia/libnvidia-cfg.so.*.*
312%attr(755,root,root) %{_libdir}/nvidia/libnvidia-tls.so.*.*
c2fc5475
SP
313%attr(755,root,root) %{_libdir}/nvidia/libvdpau.so.*.*
314%attr(755,root,root) %{_libdir}/nvidia/libvdpau_nvidia.so.*.*
315%attr(755,root,root) %{_libdir}/nvidia/libvdpau_trace.so.*.*
ffec07c8
JR
316%attr(755,root,root) %{_libdir}/xorg/modules/extensions/libglx.so.*
317%ghost %{_libdir}/xorg/modules/extensions/libglx.so
318%else
eb6ba6c9 319%attr(755,root,root) %{_libdir}/libGL.so.*.*
63c6d4b1
JB
320%attr(755,root,root) %ghost %{_libdir}/libGL.so.1
321# symlink for binary apps which fail to conform Linux OpenGL ABI
322# (and dlopen libGL.so instead of libGL.so.1)
323%attr(755,root,root) %{_libdir}/libGL.so
28142503
PS
324%attr(755,root,root) %{_libdir}/libGLcore.so.*.*
325%attr(755,root,root) %{_libdir}/libXvMCNVIDIA.so.*.*
eb6ba6c9 326%attr(755,root,root) %{_libdir}/libXvMCNVIDIA_dynamic.so.1
c2fc5475 327%attr(755,root,root) %{_libdir}/libcuda.so.*.*
032cc98f 328%attr(755,root,root) %{_libdir}/libnvidia-cfg.so.*.*
329%attr(755,root,root) %{_libdir}/libnvidia-tls.so.*.*
c2fc5475
SP
330%attr(755,root,root) %{_libdir}/libvdpau.so.*.*
331%attr(755,root,root) %{_libdir}/libvdpau_nvidia.so.*.*
332%attr(755,root,root) %{_libdir}/libvdpau_trace.so.*.*
ffec07c8
JR
333%attr(755,root,root) %{_libdir}/xorg/modules/extensions/libglx.so*
334%endif
032cc98f 335%attr(755,root,root) %{_libdir}/xorg/modules/libnvidia-wfb.so.*.*
23ae74e1 336%attr(755,root,root) %{_libdir}/xorg/modules/drivers/nvidia_drv.so
28142503 337
28142503
PS
338%files devel
339%defattr(644,root,root,755)
340%attr(755,root,root) %{_libdir}/libXvMCNVIDIA.so
c2fc5475
SP
341%attr(755,root,root) %{_libdir}/libcuda.so
342%attr(755,root,root) %{_libdir}/libvdpau.so
73eb73e1 343%dir %{_includedir}/GL
63c6d4b1
JB
344%{_includedir}/GL/gl.h
345%{_includedir}/GL/glext.h
346%{_includedir}/GL/glx.h
347%{_includedir}/GL/glxext.h
c2fc5475
SP
348%{_includedir}/cuda
349%{_includedir}/vdpau
ffec07c8
JR
350%if %{with multigl}
351%attr(755,root,root) %{_libdir}/libGL.so
352%endif
63c6d4b1
JB
353
354%files static
355%defattr(644,root,root,755)
28142503
PS
356%{_libdir}/libXvMCNVIDIA.a
357
d4a34ce2 358%files progs
01766b04 359%defattr(644,root,root,755)
360%attr(755,root,root) %{_bindir}/nvidia-settings
225cc701 361%attr(755,root,root) %{_bindir}/nvidia-xconfig
7a2ced2a 362%attr(755,root,root) %{_bindir}/nvidia-bug-report.sh
2a45f872 363%attr(755,root,root) /etc/X11/xinit/xinitrc.d/*.sh
225cc701 364%{_desktopdir}/nvidia-settings.desktop
365%{_mandir}/man1/nvidia-*
366%{_pixmapsdir}/nvidia-settings.png
1820d34b 367%endif
63c6d4b1
JB
368
369%if %{with kernel}
370%files -n kernel%{_alt_kernel}-video-nvidia
371%defattr(644,root,root,755)
372/lib/modules/%{_kernel_ver}/misc/*.ko*
373%endif
This page took 0.211326 seconds and 4 git commands to generate.