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