]>
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 8 | |
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: 173.14.09 | |
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: 02bc9536ad2800855c66684f4c981a74 | |
33 | Source1: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run | |
34 | # Source1-md5: 5f174d4fa50d774df8667c1c063adfb2 | |
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 | Provides: OpenGL = 2.1 | |
49 | Provides: OpenGL-GLX = 1.4 | |
50 | Provides: xorg-xserver-libglx | |
51 | %if %{without multigl} | |
52 | Obsoletes: Mesa | |
53 | %endif | |
54 | Obsoletes: X11-OpenGL-core < 1:7.0.0 | |
55 | Obsoletes: X11-OpenGL-libGL < 1:7.0.0 | |
56 | Obsoletes: XFree86-OpenGL-core < 1:7.0.0 | |
57 | Obsoletes: XFree86-OpenGL-libGL < 1:7.0.0 | |
58 | Obsoletes: XFree86-driver-nvidia | |
59 | Obsoletes: XFree86-nvidia | |
60 | %if %{without multigl} | |
61 | Conflicts: Mesa-libGL | |
62 | %endif | |
63 | Conflicts: XFree86-OpenGL-devel <= 4.2.0-3 | |
64 | ExclusiveArch: %{ix86} %{x8664} | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %define _noautoreqdep libGL.so.1 libGLcore.so.1 | |
68 | ||
69 | %description | |
70 | This driver set adds improved 2D functionality to the Xorg X server as | |
71 | well as high performance OpenGL acceleration, AGP support, support for | |
72 | most flat panels, and 2D multiple monitor support. Supported hardware: | |
73 | modern NVIDIA GeForce (from GeForce2 MX) and Quadro (Quadro4 and up) | |
74 | based graphics accelerators. | |
75 | ||
76 | The older graphics chips are unsupported: | |
77 | - NV1 and RIVA 128/128ZX chips are supported in the base Xorg install | |
78 | (nv driver) | |
79 | - TNT/TNT2/GeForce 256/GeForce2 Ultra/Quadro2 are suported by -legacy | |
80 | drivers. | |
81 | ||
82 | %description -l pl.UTF-8 | |
83 | Usprawnione sterowniki dla kart graficznych nVidia do serwera Xorg, | |
84 | dające wysokowydajną akcelerację OpenGL, obsługę AGP i wielu monitorów | |
85 | 2D. Obsługują w miarę nowe karty NVIDIA GeForce (od wersji GeForce2 | |
86 | MX) oraz Quadro (od wersji Quadro4). | |
87 | ||
88 | Starsze układy graficzne nie są obsługiwane przez ten pakiet: | |
89 | - NV1 i RIVA 128/128ZX są obsługiwane przez sterownik nv z Xorg | |
90 | - TNT/TNT2/GeForce 256/GeForce 2 Ultra/Quadro 2 są obsługiwane przez | |
91 | sterowniki -legacy | |
92 | ||
93 | %package devel | |
94 | Summary: OpenGL (GL and GLX) header files | |
95 | Summary(pl.UTF-8): Pliki nagłówkowe OpenGL (GL i GLX) | |
96 | Group: X11/Development/Libraries | |
97 | Requires: %{name} = %{version}-%{release} | |
98 | Provides: OpenGL-GLX-devel = 1.4 | |
99 | Provides: OpenGL-devel = 2.1 | |
100 | Obsoletes: X11-OpenGL-devel-base | |
101 | Obsoletes: XFree86-OpenGL-devel-base | |
102 | Obsoletes: XFree86-driver-nvidia-devel | |
103 | Conflicts: XFree86-OpenGL-devel < 4.3.99.902-0.3 | |
104 | ||
105 | %description devel | |
106 | OpenGL header files (GL and GLX only) for NVIDIA OpenGL | |
107 | implementation. | |
108 | ||
109 | %description devel -l pl.UTF-8 | |
110 | Pliki nagłówkowe OpenGL (tylko GL i GLX) dla implementacji OpenGL | |
111 | firmy NVIDIA. | |
112 | ||
113 | %package static | |
114 | Summary: Static XvMCNVIDIA library | |
115 | Summary(pl.UTF-8): Statyczna biblioteka XvMCNVIDIA | |
116 | Group: X11/Development/Libraries | |
117 | Requires: %{name}-devel = %{version}-%{release} | |
118 | ||
119 | %description static | |
120 | Static XvMCNVIDIA library. | |
121 | ||
122 | %description static -l pl.UTF-8 | |
123 | Statyczna biblioteka XvMCNVIDIA. | |
124 | ||
125 | %package progs | |
126 | Summary: Tools for advanced control of nVidia graphic cards | |
127 | Summary(pl.UTF-8): Narzędzia do zarządzania kartami graficznymi nVidia | |
128 | Group: Applications/System | |
129 | Requires: %{name} = %{version}-%{release} | |
130 | Suggests: pkgconfig | |
131 | Obsoletes: XFree86-driver-nvidia-progs | |
132 | ||
133 | %description progs | |
134 | Tools for advanced control of nVidia graphic cards. | |
135 | ||
136 | %description progs -l pl.UTF-8 | |
137 | Narzędzia do zarządzania kartami graficznymi nVidia. | |
138 | ||
139 | %package -n kernel%{_alt_kernel}-video-nvidia | |
140 | Summary: nVidia kernel module for nVidia Architecture support | |
141 | Summary(de.UTF-8): Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung | |
142 | Summary(pl.UTF-8): Moduł jądra dla obsługi kart graficznych nVidia | |
143 | Version: %{version} | |
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 | Provides: X11-driver-nvidia(kernel) | |
150 | Obsoletes: XFree86-nvidia-kernel | |
151 | ||
152 | %description -n kernel%{_alt_kernel}-video-nvidia | |
153 | nVidia Architecture support for Linux kernel. | |
154 | ||
155 | %description -n kernel%{_alt_kernel}-video-nvidia -l de.UTF-8 | |
156 | Die nVidia-Architektur-Unterstützung für den Linux-Kern. | |
157 | ||
158 | %description -n kernel%{_alt_kernel}-video-nvidia -l pl.UTF-8 | |
159 | Obsługa architektury nVidia dla jądra Linuksa. Pakiet wymagany przez | |
160 | sterownik nVidii dla Xorg/XFree86. | |
161 | ||
162 | %prep | |
163 | cd %{_builddir} | |
164 | rm -rf NVIDIA-Linux-x86*-%{version}-pkg* | |
165 | %ifarch %{ix86} | |
166 | /bin/sh %{SOURCE0} --extract-only | |
167 | %setup -qDT -n NVIDIA-Linux-x86-%{version}-pkg1 | |
168 | %else | |
169 | /bin/sh %{SOURCE1} --extract-only | |
170 | %setup -qDT -n NVIDIA-Linux-x86_64-%{version}-pkg2 | |
171 | %endif | |
172 | %patch0 -p1 | |
173 | %patch1 -p1 | |
174 | echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> usr/src/nv/Makefile.kbuild | |
175 | ||
176 | %build | |
177 | %if %{with kernel} | |
178 | cd usr/src/nv/ | |
179 | ln -sf Makefile.kbuild Makefile | |
180 | cat >> Makefile <<'EOF' | |
181 | ||
182 | $(obj)/nv-kernel.o: $(src)/nv-kernel.o.bin | |
183 | cp $< $@ | |
184 | EOF | |
185 | mv nv-kernel.o{,.bin} | |
186 | %build_kernel_modules -m nvidia | |
187 | %endif | |
188 | ||
189 | %install | |
190 | rm -rf $RPM_BUILD_ROOT | |
191 | ||
192 | %if %{with userspace} | |
193 | install -d $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,extensions} \ | |
194 | $RPM_BUILD_ROOT{%{_includedir}/GL,%{_libdir},%{_bindir},%{_mandir}/man1} \ | |
195 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/etc/X11/xinit/xinitrc.d} | |
196 | %if %{with multigl} | |
197 | install -d $RPM_BUILD_ROOT{%{_libdir}/nvidia,%{_sysconfdir}/ld.so.conf.d} | |
198 | %endif | |
199 | ||
200 | install usr/bin/nvidia-{settings,xconfig,bug-report.sh} $RPM_BUILD_ROOT%{_bindir} | |
201 | install usr/share/man/man1/nvidia-{settings,xconfig}.* $RPM_BUILD_ROOT%{_mandir}/man1 | |
202 | install usr/share/applications/nvidia-settings.desktop $RPM_BUILD_ROOT%{_desktopdir} | |
203 | install usr/share/pixmaps/nvidia-settings.png $RPM_BUILD_ROOT%{_pixmapsdir} | |
204 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/X11/xinit/xinitrc.d/nvidia-settings.sh | |
205 | ||
206 | for f in \ | |
207 | usr/lib/tls/libnvidia-tls.so.%{version} \ | |
208 | usr/lib/libnvidia-cfg.so.%{version} \ | |
209 | usr/lib/libGL{,core}.so.%{version} \ | |
210 | usr/X11R6/lib/libXvMCNVIDIA.so.%{version} \ | |
211 | %if %{without multigl} | |
212 | usr/X11R6/lib/libXvMCNVIDIA.a \ | |
213 | ; do | |
214 | install $f $RPM_BUILD_ROOT%{_libdir} | |
215 | done | |
216 | %else | |
217 | ; do | |
218 | install $f $RPM_BUILD_ROOT%{_libdir}/nvidia | |
219 | done | |
220 | install usr/X11R6/lib/libXvMCNVIDIA.a $RPM_BUILD_ROOT%{_libdir} | |
221 | %endif | |
222 | ||
223 | install usr/X11R6/lib/modules/extensions/libglx.so.%{version} \ | |
224 | $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions | |
225 | install usr/X11R6/lib/modules/drivers/nvidia_drv.so \ | |
226 | $RPM_BUILD_ROOT%{_libdir}/xorg/modules/drivers | |
227 | install usr/X11R6/lib/modules/libnvidia-wfb.so.%{version} \ | |
228 | $RPM_BUILD_ROOT%{_libdir}/xorg/modules | |
229 | ||
230 | install usr/include/GL/*.h $RPM_BUILD_ROOT%{_includedir}/GL | |
231 | ||
232 | ln -sf libglx.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/libglx.so | |
233 | ln -sf libnvidia-wfb.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/wfb.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-laptop-video-nvidia-%{version} | |
267 | kernel-desktop-video-nvidia-%{version} | |
268 | ||
269 | Depending on which kernel brand you use. | |
270 | ||
271 | EOF | |
272 | %if %{with multigl} | |
273 | if [ ! -e %{_libdir}/xorg/modules/extensions/libglx.so ]; then | |
274 | ln -sf libglx.so.%{version} %{_libdir}/xorg/modules/extensions/libglx.so | |
275 | fi | |
276 | %endif | |
277 | ||
278 | %postun -p /sbin/ldconfig | |
279 | ||
280 | %post -n kernel%{_alt_kernel}-video-nvidia | |
281 | %depmod %{_kernel_ver} | |
282 | ||
283 | %postun -n kernel%{_alt_kernel}-video-nvidia | |
284 | %depmod %{_kernel_ver} | |
285 | ||
286 | %if %{with userspace} | |
287 | %files | |
288 | %defattr(644,root,root,755) | |
289 | %doc LICENSE | |
290 | %doc usr/share/doc/{README.txt,NVIDIA_Changelog,XF86Config.sample,html} | |
291 | %if %{with multigl} | |
292 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ld.so.conf.d/nvidia.conf | |
293 | %dir %{_libdir}/nvidia | |
294 | %attr(755,root,root) %{_libdir}/nvidia/libGL.so.*.* | |
295 | %attr(755,root,root) %ghost %{_libdir}/nvidia/libGL.so.1 | |
296 | %attr(755,root,root) %{_libdir}/nvidia/libGLcore.so.*.* | |
297 | %attr(755,root,root) %{_libdir}/nvidia/libXvMCNVIDIA.so.*.* | |
298 | %attr(755,root,root) %{_libdir}/nvidia/libXvMCNVIDIA_dynamic.so.1 | |
299 | %attr(755,root,root) %{_libdir}/nvidia/libnvidia-cfg.so.*.* | |
300 | %attr(755,root,root) %{_libdir}/nvidia/libnvidia-tls.so.*.* | |
301 | %attr(755,root,root) %{_libdir}/xorg/modules/extensions/libglx.so.* | |
302 | %ghost %{_libdir}/xorg/modules/extensions/libglx.so | |
303 | %else | |
304 | %attr(755,root,root) %{_libdir}/libGL.so.*.* | |
305 | %attr(755,root,root) %ghost %{_libdir}/libGL.so.1 | |
306 | # symlink for binary apps which fail to conform Linux OpenGL ABI | |
307 | # (and dlopen libGL.so instead of libGL.so.1) | |
308 | %attr(755,root,root) %{_libdir}/libGL.so | |
309 | %attr(755,root,root) %{_libdir}/libGLcore.so.*.* | |
310 | %attr(755,root,root) %{_libdir}/libXvMCNVIDIA.so.*.* | |
311 | %attr(755,root,root) %{_libdir}/libXvMCNVIDIA_dynamic.so.1 | |
312 | %attr(755,root,root) %{_libdir}/libnvidia-cfg.so.*.* | |
313 | %attr(755,root,root) %{_libdir}/libnvidia-tls.so.*.* | |
314 | %attr(755,root,root) %{_libdir}/xorg/modules/extensions/libglx.so* | |
315 | %endif | |
316 | %attr(755,root,root) %{_libdir}/xorg/modules/libnvidia-wfb.so.*.* | |
317 | %attr(755,root,root) %{_libdir}/xorg/modules/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 |