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