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