- fixes for changes in pci subsystem and power mgt. [2.6.9/2.6.10].
[packages/xorg-driver-video-nvidia.git] / xorg-driver-video-nvidia.spec
index a9aed14b382b8c54fd5cbc3c269b5472b4eacff7..21b8370c3a16a0be0b86f79f6d574c0b2e598e72 100644 (file)
@@ -2,49 +2,67 @@
 # Conditional build:
 %bcond_without dist_kernel     # without distribution kernel
 %bcond_without smp             # without smp packages
+%bcond_without kernel          # without kernel packages
 %bcond_with    verbose         # verbose build (V=1)
 %bcond_with    tls             # install libraries with tls support
 #
 %define                _nv_ver         1.0
-%define                _nv_rel         5336
-%define                _nv_pkg         pkg0
+%define                _nv_rel         6111
+%define                _min_x11        6.7.0
+%define                _rel            5
 #
 Summary:       Linux Drivers for nVidia TNT/TNT2/GeForce/Quadro Chips
 Summary(pl):   Sterowniki do kart graficznych nVidia TNT/TNT2/GeForce/Quadro
-Name:          XFree86-driver-nvidia
+Name:          X11-driver-nvidia
 Version:       %{_nv_ver}.%{_nv_rel}
-%define        _rel    3
 Release:       %{_rel}
 License:       nVidia Binary
 Vendor:                nVidia Corp.
 Group:         X11/XFree86
-Source0:       http://download.nvidia.com/XFree86/Linux-x86/%{_nv_ver}-%{_nv_rel}/NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-%{_nv_pkg}.run
-# Source0-md5: 2ceffa20391d5471b8a483101563eccb
-Patch0:                %{name}-cleanups.patch
-Patch1:                %{name}-api_call.patch
+Source0:       http://download.nvidia.com/XFree86/Linux-x86/%{_nv_ver}-%{_nv_rel}/NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-pkg1.run
+# Source0-md5: 51e83be46f83c52102ccb8995b54f4e2
+# Source0-size:        8167999
+Source1:       http://download.nvidia.com/XFree86/Linux-x86_64/%{_nv_ver}-%{_nv_rel}/NVIDIA-Linux-x86_64-%{_nv_ver}-%{_nv_rel}-pkg2.run
+# Source1-md5: 6c7b0c8b3ce5c34186e0c80042e6d046
+# Source1-size:        7333486
+Patch0:                %{name}-gcc34.patch
+Patch1:                %{name}-GL.patch
+Patch2:                %{name}-pci_x_class.patch
+Patch3:                %{name}-enable-pci.patch 
+Patch4:                %{name}-power-suspend.patch
 URL:           http://www.nvidia.com/object/linux.html
 BuildConflicts:        XFree86-nvidia
 BuildRequires: grep
 %{?with_dist_kernel:BuildRequires:     kernel-module-build >= 2.6.7}
 BuildRequires: %{kgcc_package}
 BuildRequires: rpmbuild(macros) >= 1.153
+BuildRequires: sed >= 4.0
 BuildRequires: textutils
-Requires:      XFree86-Xserver
-Requires:      XFree86-libs >= 4.0.1
-Requires:      XFree86-modules >= 4.0.1
-Requires:      XFree86-nvidia-kernel
+#BuildRequires:        X11-devel >= %{_min_x11}        # disabled for now
+Requires:      X11-Xserver
+Requires:      X11-libs >= %{_min_x11}
+Requires:      X11-modules >= %{_min_x11}
 %{?with_tls:Requires:  glibc(tls)}
+Provides:      X11-OpenGL-core
+Provides:      X11-OpenGL-libGL
 Provides:      XFree86-OpenGL-core
+Provides:      XFree86-OpenGL-libGL
 Obsoletes:     Mesa
+Obsoletes:     X11-OpenGL-core
+Obsoletes:     X11-OpenGL-libGL
 Obsoletes:     XFree86-OpenGL-core
 Obsoletes:     XFree86-OpenGL-libGL
+Obsoletes:     XFree86-driver-nvidia
 Obsoletes:     XFree86-nvidia
 Conflicts:     XFree86-OpenGL-devel <= 4.2.0-3
-ExclusiveArch: %{ix86}
+ExclusiveArch: %{ix86} amd64
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _noautoreqdep   libGL.so.%{_nv_ver}.%{_nv_rel} libGLcore.so.%{_nv_ver}.%{_nv_rel}
+%define                _noautoreqdep   libGL.so.1 libGLcore.so.1
 %define                _prefix         /usr/X11R6
+%ifarch amd64
+%define                _libdir32       %{_prefix}/lib
+%endif
 
 %description
 This driver set adds improved 2D functionality to the XFree86 4.0 X
@@ -70,9 +88,10 @@ pakiet
 Summary:       OpenGL for X11R6 development (only gl?.h)
 Summary(pl):   Pliki nag³ówkowe OpenGL dla systemu X11R6 (tylko gl?.h)
 Group:         X11/Development/Libraries
-Requires:      %{name} = %{version}
+Requires:      %{name} = %{version}-%{release}
 Provides:      OpenGL-devel-base
 Obsoletes:     OpenGL-devel-base
+Obsoletes:     XFree86-driver-nvidia-devel
 Conflicts:     XFree86-OpenGL-devel < 4.3.99.902-0.3
 
 %description devel
@@ -85,8 +104,9 @@ sterownik
 %package progs
 Summary:       Tools for advanced control of nVidia graphic cards
 Summary(pl):   Narzêdzia do zarz±dzania kartami graficznymi nVidia
-Group:         Application/System
-Requires:      %{name} = %{version}
+Group:         Applications/System
+Obsoletes:     XFree86-driver-nvidia-progs
+Requires:      %{name} = %{version}-%{release}
 
 %description progs
 Tools for advanced control of nVidia graphic cards.
@@ -105,7 +125,7 @@ PreReq:             modutils >= 2.3.18-2
 Requires(post,postun): /sbin/depmod
 Requires:      dev >= 2.7.7-10
 %{?with_dist_kernel:%requires_releq_kernel_up}
-Provides:      XFree86-nvidia-kernel
+Provides:      X11-driver-nvidia(kernel)
 Obsoletes:     XFree86-nvidia-kernel
 
 %description -n kernel-video-nvidia
@@ -128,7 +148,7 @@ PreReq:             modutils >= 2.3.18-2
 Requires(post,postun): /sbin/depmod
 Requires:      dev >= 2.7.7-10
 %{?with_dist_kernel:%requires_releq_kernel_smp}
-Provides:      XFree86-nvidia-kernel
+Provides:      X11-driver-nvidia(kernel)
 Obsoletes:     XFree86-nvidia-kernel
 
 %description -n kernel-smp-video-nvidia
@@ -143,15 +163,24 @@ przez sterownik nVidii dla XFree86 4.
 
 %prep
 cd %{_builddir}
-rm -rf NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-%{_nv_pkg}
+rm -rf NVIDIA-Linux-x86*-%{_nv_ver}-%{_nv_rel}-pkg*
+%ifarch %{ix86}
 /bin/sh %{SOURCE0} --extract-only
-%setup -qDT -n NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-%{_nv_pkg}
+%setup -qDT -n NVIDIA-Linux-x86-%{_nv_ver}-%{_nv_rel}-pkg1
+%else
+/bin/sh %{SOURCE1} --extract-only
+%setup -qDT -n NVIDIA-Linux-x86_64-%{_nv_ver}-%{_nv_rel}-pkg2
+%endif
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+sed -i 's:-Wpointer-arith::' usr/src/nv/Makefile.kbuild
 
 %build
 cd usr/src/nv/
-cp Makefile.kbuild Makefile
+ln -sf Makefile.kbuild Makefile
 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
     if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
         exit 1
@@ -162,10 +191,14 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
     ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
     ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
     touch include/config/MARKER
-    %{__make} -C %{_kernelsrcdir} clean modules \
+    %{__make} -C %{_kernelsrcdir} clean \
        RCS_FIND_IGNORE="-name '*.ko' -o -name nv-kernel.o -o" \
         M=$PWD O=$PWD \
         %{?with_verbose:V=1}
+    %{__make} -C %{_kernelsrcdir} modules \
+       CC="%{__cc}" CPP="%{__cpp}" \
+        M=$PWD O=$PWD \
+        %{?with_verbose:V=1}
     mv nvidia.ko nvidia-$cfg.ko
 done
 
@@ -176,10 +209,17 @@ install -d $RPM_BUILD_ROOT%{_libdir}/modules/{drivers,extensions} \
 
 ln -sf $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_prefix}/../lib
 
-install usr/lib%{?with_tls:/tls}/libGL.so.%{version} $RPM_BUILD_ROOT%{_libdir}
-install usr/lib%{?with_tls:/tls}/libGLcore.so.%{version} $RPM_BUILD_ROOT%{_libdir}
-install usr/X11R6/lib/modules/extensions%{?with_tls:/tls}/libglx.so.%{version} \
+install usr/bin/nvidia-settings $RPM_BUILD_ROOT%{_bindir}
+install usr/lib%{?with_tls:/tls}/libnvidia-tls.so.%{version} $RPM_BUILD_ROOT%{_libdir}
+install usr/lib/libGL{,core}.so.%{version} $RPM_BUILD_ROOT%{_libdir}
+install usr/X11R6/lib/modules/extensions/libglx.so.%{version} \
        $RPM_BUILD_ROOT%{_libdir}/modules/extensions
+%ifarch amd64
+# support for running 32-bit OpenGL applications on 64-bit AMD64 Linux installations
+#install -d $RPM_BUILD_ROOT%{_libdir32}
+#install usr/lib32%{?with_tls:/tls}/libnvidia-tls.so.%{version} $RPM_BUILD_ROOT%{_libdir32}
+#install usr/lib32/libGL{,core}.so.%{version} $RPM_BUILD_ROOT%{_libdir32}
+%endif
 
 install usr/X11R6/lib/modules/drivers/nvidia_drv.o $RPM_BUILD_ROOT%{_libdir}/modules/drivers
 install usr/X11R6/lib/libXvMCNVIDIA.* $RPM_BUILD_ROOT%{_libdir}
@@ -206,7 +246,21 @@ install nvidia-smp.ko \
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post  -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+cat << EOF
+
+ *******************************************************
+ *                                                     *
+ *  NOTE:                                              *
+ *  You must install:                                  *
+ *  kernel(24)(-smp)-video-nvidia-%{version}             *
+ *  for this driver to work                            *
+ *                                                     *
+ *******************************************************
+
+EOF
+
 %postun        -p /sbin/ldconfig
 
 %post  -n kernel-video-nvidia
@@ -230,11 +284,21 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libGL.so
 %attr(755,root,root) %{_libdir}/libGLcore.so.*.*
 %attr(755,root,root) %{_libdir}/libXvMCNVIDIA.so.*.*
+%attr(755,root,root) %{_libdir}/libnvidia-tls.so.*.*.*
+%ifarch amd64
+# support for running 32-bit OpenGL applications on 64-bit AMD64 Linux installations
+#dir %{_libdir32}
+#attr(755,root,root) %{_libdir32}/libGL.so.*.*
+#attr(755,root,root) %{_libdir32}/libGLcore.so.*.*
+#attr(755,root,root) %{_libdir32}/libXvMCNVIDIA.so.*.*
+#attr(755,root,root) %{_libdir32}/libnvidia-tls.so.*.*.*
+%endif
 %attr(755,root,root) /usr/%{_lib}/libGL.so.1
 %attr(755,root,root) /usr/%{_lib}/libGL.so
 %attr(755,root,root) %{_libdir}/modules/extensions/libglx.so*
 %attr(755,root,root) %{_libdir}/modules/drivers/nvidia_drv.o
 
+%if %{with kernel}
 %files -n kernel-video-nvidia
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}/misc/*.ko*
@@ -244,6 +308,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
 %endif
+%endif
 
 %files devel
 %defattr(644,root,root,755)
@@ -252,6 +317,6 @@ rm -rf $RPM_BUILD_ROOT
 # -static
 %{_libdir}/libXvMCNVIDIA.a
 
-#%files progs
-#%defattr(755,root,root,755)
-#%{_bindir}/nvidia-settings
+%files progs
+%defattr(755,root,root,755)
+%{_bindir}/nvidia-settings
This page took 0.086454 seconds and 4 git commands to generate.