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