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