]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia.git/blob - xorg-driver-video-nvidia.spec
b20078c551380b234289cbc9b844f22957e19a2c
[packages/xorg-driver-video-nvidia.git] / xorg-driver-video-nvidia.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # without distribution kernel
4 %bcond_without  smp             # without smp packages
5 %bcond_without  kernel          # without kernel packages
6 %bcond_without  incall          # include all tarballs
7 %bcond_without  userspace       # don't build userspace programs
8 %bcond_with     verbose         # verbose build (V=1)
9 #
10 %define         no_install_post_strip 1
11 #
12 %define         _nv_ver         1.0
13 %define         _nv_rel         8774
14 %define         _min_x11        6.7.0
15 %define         _rel            0.1
16 #
17 %define         need_x86        0
18 %define         need_x8664      0
19 %if %{with incall}
20 %define         need_x86        1
21 %define         need_x8664      1
22 %else
23 %ifarch %{ix86}
24 %define         need_x86        1
25 %endif
26 %ifarch %{x8664}
27 %define         need_x8664      1
28 %endif
29 %endif
30 #
31 Summary:        Linux Drivers for nVidia TNT/TNT2/GeForce/Quadro Chips
32 Summary(pl):    Sterowniki do kart graficznych nVidia TNT/TNT2/GeForce/Quadro
33 Name:           xorg-driver-video-nvidia
34 Version:        %{_nv_ver}.%{_nv_rel}
35 Release:        %{_rel}
36 License:        nVidia Binary
37 Group:          X11
38 %if %{need_x86}
39 Source0:        http://download.nvidia.com/XFree86/Linux-x86/%{_nv_ver}-%{_nv_rel}/NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-pkg1.run
40 # Source0-md5:  eb01a4372096ee7799e6560cf568c1c2
41 %endif
42 %if %{need_x8664}
43 Source1:        http://download.nvidia.com/XFree86/Linux-x86_64/%{_nv_ver}-%{_nv_rel}/NVIDIA-Linux-x86_64-%{_nv_ver}-%{_nv_rel}-pkg2.run
44 # Source1-md5:  1f569a860caf1c4314444536c7e659dd
45 %endif
46 Patch0:         X11-driver-nvidia-GL.patch
47 Patch1:         X11-driver-nvidia-desktop.patch
48 URL:            http://www.nvidia.com/object/linux.html
49 %if %{with kernel}
50 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
51 %endif
52 BuildRequires:  %{kgcc_package}
53 BuildRequires:  rpmbuild(macros) >= 1.213
54 BuildRequires:  sed >= 4.0
55 BuildConflicts: XFree86-nvidia
56 Requires:       xorg-xserver-server
57 Provides:       OpenGL = 1.5
58 Provides:       OpenGL-GLX
59 Provides:       X11-OpenGL-core
60 Provides:       X11-OpenGL-libGL
61 Provides:       XFree86-OpenGL-core
62 Provides:       XFree86-OpenGL-libGL
63 Provides:       xorg-xserver-modules-libglx
64 Obsoletes:      Mesa
65 Obsoletes:      X11-OpenGL-core
66 Obsoletes:      X11-OpenGL-libGL
67 Obsoletes:      XFree86-OpenGL-core
68 Obsoletes:      XFree86-OpenGL-libGL
69 Obsoletes:      XFree86-driver-nvidia
70 Obsoletes:      XFree86-nvidia
71 Conflicts:      XFree86-OpenGL-devel <= 4.2.0-3
72 ExclusiveArch:  %{ix86} %{x8664}
73 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
75 %define         _noautoreqdep   libGL.so.1 libGLcore.so.1
76
77 %description
78 This driver set adds improved 2D functionality to the Xorg/XFree86 X
79 server as well as high performance OpenGL acceleration, AGP support,
80 support for most flat panels, and 2D multiple monitor support.
81
82 Hardware: nVidia TNT, TNT2, GeForce, or Quadro based graphics
83 accelerator. The nVidia NV1 and RIVA 128/128ZX chips are supported in
84 the base Xorg/XFree86 install and are not supported by this driver
85 set.
86
87 %description -l pl
88 Usprawnione sterowniki dla kart graficznych nVidia do serwera
89 Xorg/XFree86, daj±ce wysokowydajn± akceleracjê OpenGL, obs³ugê AGP i
90 wielu monitorów 2D.
91
92 Obs³uguj± karty nVidia TNT/TNT2/GeForce/Quadro do serwera
93 Xorg/XFree86; Karty nVidia NV1 i Riva 128/128ZX s± obs³ugiwane przez
94 sterownik nv z pakietów Xorg/XFree8 - NIE s± obs³ugiwane przez ten
95 pakiet.
96
97 %package devel
98 Summary:        OpenGL for X11R6 development (only gl?.h)
99 Summary(pl):    Pliki nag³ówkowe OpenGL dla systemu X11R6 (tylko gl?.h)
100 Group:          X11/Development/Libraries
101 Requires:       %{name} = %{version}-%{release}
102 Provides:       OpenGL-GLX-devel
103 Provides:       OpenGL-devel = 1.5
104 Provides:       OpenGL-devel-base
105 Obsoletes:      OpenGL-devel-base
106 Obsoletes:      XFree86-driver-nvidia-devel
107 Conflicts:      XFree86-OpenGL-devel < 4.3.99.902-0.3
108
109 %description devel
110 Base headers (only gl?.h) for OpenGL for X11R6 for nvidia drivers.
111
112 %description devel -l pl
113 Podstawowe pliki nag³ówkowe (tylko gl?.h) OpenGL dla systemu X11R6 dla
114 sterowników nvidii.
115
116 %package progs
117 Summary:        Tools for advanced control of nVidia graphic cards
118 Summary(pl):    Narzêdzia do zarz±dzania kartami graficznymi nVidia
119 Group:          Applications/System
120 Requires:       %{name} = %{version}-%{release}
121 Obsoletes:      XFree86-driver-nvidia-progs
122
123 %description progs
124 Tools for advanced control of nVidia graphic cards.
125
126 %description progs -l pl
127 Narzêdzia do zarz±dzania kartami graficznymi nVidia.
128
129 %package -n kernel%{_alt_kernel}-video-nvidia
130 Summary:        nVidia kernel module for nVidia Architecture support
131 Summary(de):    Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung
132 Summary(pl):    Modu³ j±dra dla obs³ugi kart graficznych nVidia
133 Version:        %{_nv_ver}.%{_nv_rel}
134 Release:        %{_rel}@%{_kernel_ver_str}
135 Group:          Base/Kernel
136 Requires(post,postun):  /sbin/depmod
137 Requires:       dev >= 2.7.7-10
138 %{?with_dist_kernel:%requires_releq_kernel_up}
139 Provides:       X11-driver-nvidia(kernel)
140 Obsoletes:      XFree86-nvidia-kernel
141
142 %description -n kernel%{_alt_kernel}-video-nvidia
143 nVidia Architecture support for Linux kernel.
144
145 %description -n kernel%{_alt_kernel}-video-nvidia -l de
146 Die nVidia-Architektur-Unterstützung für den Linux-Kern.
147
148 %description -n kernel%{_alt_kernel}-video-nvidia -l pl
149 Obs³uga architektury nVidia dla j±dra Linuksa. Pakiet wymagany przez
150 sterownik nVidii dla Xorg/XFree86.
151
152 %package -n kernel%{_alt_kernel}-smp-video-nvidia
153 Summary:        nVidia kernel module for nVidia Architecture support
154 Summary(de):    Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung
155 Summary(pl):    Modu³ j±dra dla obs³ugi kart graficznych nVidia
156 Release:        %{_rel}@%{_kernel_ver_str}
157 Group:          Base/Kernel
158 Requires(post,postun):  /sbin/depmod
159 Requires:       dev >= 2.7.7-10
160 %{?with_dist_kernel:%requires_releq_kernel_smp}
161 Provides:       X11-driver-nvidia(kernel)
162 Obsoletes:      XFree86-nvidia-kernel
163
164 %description -n kernel%{_alt_kernel}-smp-video-nvidia
165 nVidia Architecture support for Linux kernel SMP.
166
167 %description -n kernel%{_alt_kernel}-smp-video-nvidia -l de
168 Die nVidia-Architektur-Unterstützung für den Linux-Kern SMP.
169
170 %description -n kernel%{_alt_kernel}-smp-video-nvidia -l pl
171 Obs³uga architektury nVidia dla j±dra Linuksa SMP. Pakiet wymagany
172 przez sterownik nVidii dla Xorg/XFree86.
173
174 %prep
175 cd %{_builddir}
176 rm -rf NVIDIA-Linux-x86*-%{_nv_ver}-%{_nv_rel}-pkg*
177 %ifarch %{ix86}
178 /bin/sh %{SOURCE0} --extract-only
179 %setup -qDT -n NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-pkg1
180 %else
181 /bin/sh %{SOURCE1} --extract-only
182 %setup -qDT -n NVIDIA-Linux-x86_64-%{_nv_ver}-%{_nv_rel}-pkg2
183 %endif
184 %patch0 -p1
185 %patch1 -p1
186 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> usr/src/nv/Makefile.kbuild
187
188 %build
189 %if %{with kernel}
190 cd usr/src/nv/
191 ln -sf Makefile.kbuild Makefile
192 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
193         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
194                 exit 1
195         fi
196         install -d o/include/linux
197         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
198         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
199         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
200 %if %{with dist_kernel}
201         %{__make} -C %{_kernelsrcdir} O=$PWD/o prepare scripts
202 %else
203         install -d o/include/config
204         touch o/include/config/MARKER
205         ln -sf %{_kernelsrcdir}/scripts o/scripts
206 %endif
207         %{__make} -C %{_kernelsrcdir} clean \
208                 RCS_FIND_IGNORE="-name '*.ko' -o -name nv-kernel.o -o" \
209                 SYSSRC=%{_kernelsrcdir} \
210                 SYSOUT=$PWD/o \
211                 M=$PWD O=$PWD/o \
212                 %{?with_verbose:V=1}
213         %{__make} -C %{_kernelsrcdir} modules \
214                 CC="%{__cc}" CPP="%{__cpp}" \
215                 SYSSRC=%{_kernelsrcdir} \
216                 SYSOUT=$PWD/o \
217                 M=$PWD O=$PWD/o \
218                 %{?with_verbose:V=1}
219         mv nvidia.ko nvidia-$cfg.ko
220 done
221 %endif
222
223 %install
224 rm -rf $RPM_BUILD_ROOT
225
226 %if %{with userspace}
227 install -d $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,extensions} \
228         $RPM_BUILD_ROOT{%{_includedir}/GL,%{_libdir},%{_bindir},%{_mandir}/man1} \
229         $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
230
231 install usr/bin/nvidia-{settings,xconfig,bug-report.sh} $RPM_BUILD_ROOT%{_bindir}
232 install usr/share/man/man1/nvidia-{settings,xconfig}.* $RPM_BUILD_ROOT%{_mandir}/man1
233 install usr/share/applications/nvidia-settings.desktop $RPM_BUILD_ROOT%{_desktopdir}
234 install usr/share/pixmaps/nvidia-settings.png $RPM_BUILD_ROOT%{_pixmapsdir}
235
236 for f in \
237         usr/lib/tls/libnvidia-tls.so.%{version}         \
238         usr/lib/libGL{,core}.so.%{version}              \
239         usr/X11R6/lib/libXvMCNVIDIA.so.%{version}       \
240         usr/X11R6/lib/libXvMCNVIDIA.a                   \
241 ; do
242         install $f $RPM_BUILD_ROOT%{_libdir}
243 done
244
245 install usr/X11R6/lib/modules/extensions/libglx.so.%{version} \
246         $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions
247 install usr/X11R6/lib/modules/drivers/nvidia_drv.o \
248         $RPM_BUILD_ROOT%{_libdir}/xorg/modules/drivers
249
250 install usr/include/GL/*.h $RPM_BUILD_ROOT%{_includedir}/GL
251
252 ln -sf libglx.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/libglx.so
253 ln -sf libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libXvMCNVIDIA.so
254 ln -sf libXvMCNVIDIA.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libXvMCNVIDIA_dynamic.so.1
255
256 # OpenGL ABI for Linux compatibility
257 ln -sf libGL.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libGL.so.1
258 ln -sf libGL.so.1 $RPM_BUILD_ROOT%{_libdir}/libGL.so
259 %endif
260
261 %if %{with kernel}
262 cd usr/src/nv/
263 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
264 install nvidia-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
265         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/nvidia.ko
266 %if %{with smp} && %{with dist_kernel}
267 install nvidia-smp.ko \
268         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/nvidia.ko
269 %endif
270 %endif
271
272 %clean
273 rm -rf $RPM_BUILD_ROOT
274
275 %post
276 /sbin/ldconfig
277 cat << EOF
278
279  *******************************************************
280  *                                                     *
281  *  NOTE:                                              *
282  *  You must install:                                  *
283  *  kernel(24)(-smp)-video-nvidia-%{version}             *
284  *  for this driver to work                            *
285  *                                                     *
286  *******************************************************
287
288 EOF
289
290 %postun -p /sbin/ldconfig
291
292 %post   -n kernel%{_alt_kernel}-video-nvidia
293 %depmod %{_kernel_ver}
294
295 %postun -n kernel%{_alt_kernel}-video-nvidia
296 %depmod %{_kernel_ver}
297
298 %post   -n kernel%{_alt_kernel}-smp-video-nvidia
299 %depmod %{_kernel_ver}smp
300
301 %postun -n kernel%{_alt_kernel}-smp-video-nvidia
302 %depmod %{_kernel_ver}smp
303
304 %if %{with userspace}
305 %files
306 %defattr(644,root,root,755)
307 %doc LICENSE
308 %doc usr/share/doc/{README.txt,NVIDIA_Changelog,XF86Config.sample,html}
309 # OpenGL ABI for Linux compatibility
310 %attr(755,root,root) %{_libdir}/libGL.so
311 %attr(755,root,root) %{_libdir}/libGL.so.1
312 #
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-tls.so.*.*.*
318 %attr(755,root,root) %{_libdir}/xorg/modules/extensions/libglx.so*
319 %attr(755,root,root) %{_libdir}/xorg/modules/drivers/nvidia_drv.o
320 %endif
321
322 %if %{with kernel}
323 %files -n kernel%{_alt_kernel}-video-nvidia
324 %defattr(644,root,root,755)
325 /lib/modules/%{_kernel_ver}/misc/*.ko*
326
327 %if %{with smp} && %{with dist_kernel}
328 %files -n kernel%{_alt_kernel}-smp-video-nvidia
329 %defattr(644,root,root,755)
330 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
331 %endif
332 %endif
333
334 %if %{with userspace}
335 %files devel
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_libdir}/libXvMCNVIDIA.so
338 %{_includedir}/GL/*.h
339 # -static
340 %{_libdir}/libXvMCNVIDIA.a
341
342 %files progs
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{_bindir}/nvidia-settings
345 %attr(755,root,root) %{_bindir}/nvidia-xconfig
346 %attr(755,root,root) %{_bindir}/nvidia-bug-report.sh
347 %{_desktopdir}/nvidia-settings.desktop
348 %{_mandir}/man1/nvidia-*
349 %{_pixmapsdir}/nvidia-settings.png
350 %endif
This page took 0.050841 seconds and 3 git commands to generate.