Name : nvidia Relocations: (not relocatable)
Version : 7676 Vendor: Penguin Liberation Front
Release : 4plf Build Date: Sun 30 Oct 2005
08:41:18 PM CET
Install Date: (not installed) Build Host: ryu.zarb.org
Group : System/Kernel and hardware Source RPM: (none)
Size : 20182270 License: Freeware
Signature : (none)
Packager : Anssi Hannula <[EMAIL PROTECTED]>
URL : http://www.nvidia.com/object/unix.html
Summary : NVIDIA dkms module for Kernel, Xorg Server and OpenGL libraries
Description :
Source package to build GLX and Kernel drivers for NVIDIA cards
This is in PLF for it's non-free license.
---------------
Anssi Hannula <[EMAIL PROTECTED]> 7676-4plf
- spec cleanups
- ExclusiveArch %ix86 x86_64
- split nvidia_GLX to libnvidia-opengl and nvidia-xorg
- %pre and %post pretty much rewritten
- same URL on all packages
- no conflicting files with libxorg-x11, use ld.so.conf.d
- XFdrake compatible
- summary and description fixes
- remove forced V_BUILD_NV_PAT_SUPPORT=1
---------------
---------------
Index: nvidia.spec
===================================================================
RCS file: /home/projects/plf/cvs/SPECS/non-free/nvidia/nvidia.spec,v
retrieving revision 1.3
diff -u -r1.3 nvidia.spec
--- nvidia.spec 30 Oct 2005 17:46:44 -0000 1.3
+++ nvidia.spec 30 Oct 2005 19:43:12 -0000
@@ -1,45 +1,43 @@
-%define nameorig nvidia
-%define nversion 1_0
+%define name nvidia
+%define nvversion 1.0
%define nrelease 7676
-%ifarch x86_64
-%define pkg_rel pkg2
-%define arch x86_64
-%else
-%define pkg_rel pkg1
-%define arch x86
-%endif
+%define version %nrelease
+%define x86pkg_rel pkg1
+%define x86_64pkg_rel pkg2
%define distsuffix plf
-%define num_release 3
+%define num_release 4
%define release %mkrel %num_release
-%define module_name nvidia
-
-%define major %(echo %nversion|sed 's/_.*$//')
-%define minor %(echo %nversion|sed 's/^.*_//')
-%define nvversion %{major}.%{minor}
+%define libraryname %{name}-opengl
+%define lib_name_orig lib%{libraryname}
+%define major %(echo %nvversion | perl -pi -e "s/\\..*//")
+%define lib_name %mklibname %libraryname %major
-%define source_path usr/src
+%define module_name nvidia
-%define currentkernel %(echo `uname -r`)
+%ifarch %ix86
+%define packagedir NVIDIA-Linux-x86-%{nvversion}-%{nrelease}-%{x86pkg_rel}
+%endif
+%ifarch x86_64
+%define packagedir
NVIDIA-Linux-x86_64-%{nvversion}-%{nrelease}-%{x86_64pkg_rel}
+%endif
-Name: %{nameorig}
-Version: %{nrelease}
+Name: %{name}
+Version: %{version}
Release: %{release}
Summary: NVIDIA dkms module for Kernel, Xorg Server and OpenGL libraries
License: Freeware
-Source0:
http://download.nvidia.com/XFree86/Linux-%{arch}/1.0-%{nrelease}/NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}.run
-Source1: nvidia.png
+Source0:
http://download.nvidia.com/XFree86/Linux-x86/1.0-%{nrelease}/NVIDIA-Linux-x86-%{nvversion}-%{nrelease}-%{x86pkg_rel}.run
+Source1:
http://download.nvidia.com/XFree86/Linux-x86_64/1.0-%{nrelease}/NVIDIA-Linux-x86_64-%{nvversion}-%{nrelease}-%{x86_64pkg_rel}.run
Source10: nvidia-16.png
Source11: nvidia-32.png
Source12: nvidia-48.png
-Source91:
http://download.nvidia.com/XFree86/Linux-x86/1.0-%{nrelease}/NVIDIA-Linux-x86-%{nvversion}-%{nrelease}-pkg1.run
-Source92:
http://download.nvidia.com/XFree86/Linux-x86_64/1.0-%{nrelease}/NVIDIA-Linux-x86_64-%{nvversion}-%{nrelease}-pkg2.run
-Url:
http://download.nvidia.com/XFree86/Linux-x86/%{version}-%{nrelease}
+URL: http://www.nvidia.com/object/unix.html
Group: System/Kernel and hardware
-BuildRequires: kernel-source-2.6
+ExclusiveArch: %ix86 x86_64
Buildroot: %{_tmppath}/%{name}-%{version}-root
@@ -52,11 +50,10 @@
Summary: DKMS-ready kernel-source for the nVidia kernel driver
License: Freeware
Group: System/Kernel and hardware
-URL: http://www.nvidia.com/drivers
-Requires: drakxtools >= 1.1.7-26mdk
-Requires(pre): dkms
-Requires(post): dkms
-Provides: %{nameorig}_kernel = %{nrelease}
+URL: http://www.nvidia.com/object/unix.html
+Requires: dkms
+Provides: NVIDIA_kernel = %{version}
+Provides: nvidia-kernel = %{version}-%{release}
%description -n dkms-%{module_name}
This RPM install the NVIDIA driver for all NVIDIA video cards. It uses
@@ -65,401 +62,250 @@
This is in PLF for it's non-free license.
-%package -n %{nameorig}_GLX
-Summary: NVIDIA module for Xorg X server and OpenGL libraries
+%package -n %{lib_name}
+Summary: NVIDIA OpenGL libraries
License: Freeware
Group: System/Kernel and hardware
URL: http://www.nvidia.com/object/unix.html
-Requires: drakxtools >= 1.1.7-26mdk
-Requires: %{nameorig}_kernel = %{nrelease}
+Requires: NVIDIA_kernel = %{version}
+Provides: %{libraryname} = %{version}-%{release}
Provides: devel(libnvidia-tls)
-%description -n %{nameorig}_GLX
-NVIDIA Xorg X server module and OpenGL 1.2 libraries for RIVA TNT/TNT2
+%description -n %{lib_name}
+NVIDIA OpenGL 1.2 libraries for RIVA TNT/TNT2 and GeForce/Quadro based
+video cards. Older RIVA 128 based video cards are supported by the server
+module shipping with XFree86 4.0, nv_drv.o. You should install this package
+if you have one of the newer cards.
+
+You must also install the NVIDIA_kernel module if you want to utilize these
+drivers.
+
+This is in PLF for it's non-free license.
+
+%package xorg
+Summary: NVIDIA module for Xorg X server and XvMC library
+License: Freeware
+Group: System/Kernel and hardware
+URL: http://www.nvidia.com/object/unix.html
+Requires: NVIDIA_kernel = %{version}
+Provides: nvidia = %{version}-%{release}
+Provides: NVIDIA_GLX
+Provides: nvidia_GLX
+Obsoletes: nvidia_GLX
+
+%description xorg
+NVIDIA Xorg X server module and XvMC library for RIVA TNT/TNT2
and GeForce/Quadro based video cards. Older RIVA 128 based video cards are
supported by the server module shipping with XFree86 4.0, nv_drv.o. You
should install this package if you have one of the newer cards.
You must also install the NVIDIA_kernel module if you want to utilize these
-drivers.
+drivers.
This is in PLF for it's non-free license.
-%package -n %{nameorig}-devel
-Summary: NVIDIA module for Xorg X server and OpenGL libraries
+%package devel
+Summary: NVIDIA XvMC development library and OpenGL headers
License: Freeware
Group: System/Kernel and hardware
-URL: http://www.nvidia.com/drivers
-Requires: %{nameorig}_GLX
+URL: http://www.nvidia.com/object/unix.html
+Requires: %{name}-xorg = %{version}
-%description -n %{nameorig}-devel
-NVIDIA XFree86 4.x OpenGL 1.2 development libraries for RIVA TNT/TNT2
-and GeForce/Quadro based video cards.
-NVIDIA-Linux-%{arch} This is in PLF for it's non-free license.
+%description devel
+NVIDIA XvMC static development library and OpenGL 1.2 headers for RIVA
+TNT/TNT2 and GeForce/Quadro based video cards.
+
+This is in PLF for it's non-free license.
%prep
%setup -T -c
+%ifarch %ix86
sh %{SOURCE0} --extract-only
-pushd NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}
-pushd %{source_path}/nv
-rm -rf precompiled
-make clean
-popd
-popd
+%endif
+%ifarch x86_64
+sh %{SOURCE1} --extract-only
+%endif
+rm -rf %{packagedir}/usr/src/nv/precompiled
+make -C %{packagedir}/usr/src/nv clean
%build
-
%install
rm -rf %{buildroot}
+# OpenGL headers
+install -d -m755 %{buildroot}%{_includedir}/nvidia
+cp -a %{packagedir}/usr/include/* %{buildroot}%{_includedir}/nvidia
+
+# binaries
+install -d -m755 %{buildroot}%{_bindir}
+install -m755 %{packagedir}/usr/bin/nvidia-settings %{buildroot}/%{_bindir}
+install -m755 %{packagedir}/usr/bin/nvidia-bug-report.sh
%{buildroot}/%{_bindir}
+
+# dkms
+install -d -m755 %{buildroot}/usr/src/%{module_name}-%{version}.%{release}
+install -m644 %{packagedir}/LICENSE
%{buildroot}/usr/src/%{module_name}-%{version}.%{release}
+cp -a %{packagedir}/usr/src/nv/*
%{buildroot}/usr/src/%{module_name}-%{version}.%{release}
+# Fix bad perm
+chmod 755 %{buildroot}/usr/src/%{module_name}-%{version}.%{release}/conftest.sh
-mkdir -p
%{buildroot}/%{source_path}/%{module_name}-%{nrelease}.%{release}/patches
-mkdir -p %{buildroot}%{_datadir}/applications
-mkdir -p %{buildroot}%{_libdir}/tls
-mkdir -p %{buildroot}%{_prefix}/X11R6/lib/modules/drivers
-mkdir -p %{buildroot}%{_prefix}/X11R6/lib/modules/extensions
-mkdir -p %{buildroot}%{_bindir}
-mkdir -p %{buildroot}%{_includedir}/nvidia
-
-### ###
-# OpenGL headers #
-### ###
-cp -a NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}%{_includedir}/*
%{buildroot}%{_includedir}/nvidia
-
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}%{_bindir}/nvidia-settings
%{buildroot}/%{_bindir}
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}%{_bindir}/nvidia-bug-report.sh
%{buildroot}/%{_bindir}
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/nvidia-installer
%{buildroot}/%{_bindir}
-install -m 644
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_docdir}/NVIDIA_Changelog
.
-install -m 644
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_docdir}/nvidia-settings-user-guide.txt
.
-install -m 644
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_docdir}/README.txt .
-install -m 644
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_docdir}/XF86Config.sample
.
-
-#dkms
-install NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/LICENSE
%{buildroot}/%{source_path}/%{module_name}-%{nrelease}.%{release}
-cp -a
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{source_path}/nv/*
%{buildroot}/%{source_path}/%{module_name}-%{nrelease}.%{release}
-
-# place the libraries
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/usr/lib/libGL.so.%{nvversion}.%{nrelease}
%{buildroot}/%{_libdir}/
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/usr/lib/libGLcore.so.%{nvversion}.%{nrelease}
%{buildroot}/%{_libdir}/
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/usr/lib/libGL.la
%{buildroot}/%{_libdir}/
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_prefix}/X11R6/lib/modules/drivers/nvidia_drv.o
%{buildroot}%{_prefix}/X11R6/lib/modules/drivers
-install
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_prefix}/X11R6/lib/modules/drivers/nvidia_drv.so
%{buildroot}%{_prefix}/X11R6/lib/modules/drivers
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_prefix}/X11R6/lib/modules/extensions/libglx.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/lib/modules/extensions/
-install
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/usr/lib/libnvidia-tls.so.%{nvversion}.%{nrelease}
%{buildroot}/%{_libdir}/
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/usr/lib/tls/libnvidia-tls.so.%{nvversion}.%{nrelease}
%{buildroot}/%{_libdir}/tls/
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_prefix}/X11R6/lib/libXvMCNVIDIA.a
%{buildroot}%{_prefix}/X11R6/lib/libXvMCNVIDIA.a;
-install -m 755
NVIDIA-Linux-%{arch}-%{nvversion}-%{nrelease}-%{pkg_rel}/%{_prefix}/X11R6/lib/libXvMCNVIDIA.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/lib/
-
-
-### ###
-# nvidia glx #
-### ###
-
-#remove some stuff
-rm -rf %buildroot%{_libdir}/nvidia/*.so
-rm -rf %buildroot%{_prefix}/X11R6/lib/modules/extensions/*.so
-rm -rf %buildroot%{_prefix}/src/nv/precompiled
-
-
-#menus
-install -d %buildroot/%{_menudir}
-cat <<EOF >%buildroot/%{_menudir}/nvidia
+# XvMC libraries
+install -d -m755 %{buildroot}%{_prefix}/X11R6/%{_lib}
+install -m755 %{packagedir}/usr/X11R6/lib/libXvMCNVIDIA.a
%{buildroot}%{_prefix}/X11R6/%{_lib}
+install -m755
%{packagedir}/usr/X11R6/lib/libXvMCNVIDIA.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/%{_lib}
+ln -s libXvMCNVIDIA.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/%{_lib}/libXvMCNVIDIA_dynamic.so.%{major}
+
+# nvidia_drv
+install -d -m755 %{buildroot}%{_prefix}/X11R6/%{_lib}/modules/drivers
+install -m755 %{packagedir}/usr/X11R6/lib/modules/drivers/nvidia_drv.o
%{buildroot}%{_prefix}/X11R6/%{_lib}/modules/drivers
+install -m755 %{packagedir}/usr/X11R6/lib/modules/drivers/nvidia_drv.so
%{buildroot}%{_prefix}/X11R6/%{_lib}/modules/drivers
+
+# libglx.so
+install -d -m755 %{buildroot}%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia
+install -m755
%{packagedir}/usr/X11R6/lib/modules/extensions/libglx.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia
+ln -s libglx.so.%{nvversion}.%{nrelease}
%{buildroot}%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia/libglx.so
+
+# GL libraries
+install -d -m755 %{buildroot}%{_libdir}/nvidia/tls
+install -m755 %{packagedir}/usr/lib/libGL.so.%{nvversion}.%{nrelease}
%{buildroot}%{_libdir}/nvidia
+install -m755 %{packagedir}/usr/lib/libnvidia-tls.so.%{nvversion}.%{nrelease}
%{buildroot}%{_libdir}/nvidia
+install -m755 %{packagedir}/usr/lib/libGLcore.so.%{nvversion}.%{nrelease}
%{buildroot}%{_libdir}/nvidia
+ln -s libGL.so.%{nvversion}.%{nrelease} %{buildroot}%{_libdir}/nvidia/libGL.so
+install -m755
%{packagedir}/usr/lib/tls/libnvidia-tls.so.%{nvversion}.%{nrelease}
%{buildroot}%{_libdir}/nvidia/tls
+
+# ld.so.conf.d
+install -d -m755 %{buildroot}%{_sysconfdir}/ld.so.conf.d
+echo "%{_libdir}/nvidia" >
%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{lib_name}.conf
+
+# menus
+install -d -m755 %buildroot/%{_menudir}
+cat <<EOF >%buildroot/%{_menudir}/%name
?package(%{name}):command="%{_bindir}/nvidia-settings" \
icon=%{name}.png \
needs="x11" \
section="System/Configuration/Hardware" \
- title="Nvidia-settings"\
- longtitle="%{summary}"
+ title="NVIDIA Settings"\
+ longtitle="Configure NVIDIA X driver"
EOF
install -m644 %{SOURCE10} -D %buildroot/%{_miconsdir}/%{name}.png
install -m644 %{SOURCE11} -D %buildroot/%{_iconsdir}/%{name}.png
install -m644 %{SOURCE12} -D %buildroot/%{_liconsdir}/%{name}.png
-
#dkms
+cat > %{buildroot}/usr/src/%{module_name}-%{version}.%{release}/dkms.conf <<EOF
-mkdir -p %buildroot%{_prefix}/src/%{module_name}-%{nrelease}.%{release}
-cat > %buildroot%{_prefix}/src/%{module_name}-%{nrelease}.%{release}/dkms.conf
<<EOF
-
-PACKAGE_VERSION="%{nvversion}-%{nrelease}"
+PACKAGE_VERSION="%{version}.%{release}"
# Items below here should not have to change with each driver version
PACKAGE_NAME="%{module_name}"
DEST_MODULE_LOCATION[0]="/kernel/drivers/video/"
BUILT_MODULE_NAME[0]="\$PACKAGE_NAME"
-MAKE[0]="make -f makefile KERNEL_SOURCES=\${kernel_source_dir}; make -f
Makefile SYSSRC=\${kernel_source_dir} NV_BUILD_NV_PAT_SUPPORT=1 module"
-CLEAN="cd \${dkms_tree}/\${PACKAGE_NAME}/\${nrelease}.\${release}/build ; make
KERNEL_PATH=\${kernel_source_dir} clean"
+MAKE[0]="make -f makefile KERNEL_SOURCES=\${kernel_source_dir}; make -f
Makefile SYSSRC=\${kernel_source_dir} module"
AUTOINSTALL="YES"
EOF
-# Fix bad perm
-chmod 755 %buildroot/%_prefix/src/nvidia-%{nrelease}.%{release}/conftest.sh
%clean
rm -rf %{buildroot}
-%pre -n %{name}_GLX
-
-# if /usr/lib/libGL.so is pointing to libGL.so.1, we are upgrading.
-# This is good. We just delete libGL.so. We'll set it up later.
-# If not, leave it alone, we'lx86l complain later
-if [ -e %{_libdir}/libGL.so ]; then
- LIBGL=`ls -l %{_libdir}/libGL.so | sed 's/.*->[ ]*\(.*\)$/\1/'`
- if [ X$LIBGL = X"libGL.so.1" ]; then
- rm -f %{_libdir}/libGL.so
- fi
-fi
-
-problem=0
-first_time=0
-
-check_file() {
- if [ -f $1 ]; then
- # remove symlinks, and append .RPMSAVE to real files
- if [ -h $1 ]; then
- rm -f $1
- else
- problem=1
- if [ $first_time -eq 0 ]; then
- echo " --- WARNING!!"
- first_time=1
- fi
- mv $1 xxx.$1.RPMSAVE
- echo " $1"
- fi
- fi
-}
-
-final_check() {
- if [ $problem -eq 1 ]; then
- echo " --- The above file(s) possibly belong to a conflicting MESA rpm,"
- echo " --- or to a previous stale NVIDIA distribution."
- echo " --- They have been renamed to xxx.<originalFile>.RPMSAVE to"
- echo " --- avoid conflicting with the files contained within this"
- echo " --- package."
- echo " --- Please see the FREQUENTLY ASKED QUESTIONS section of"
- echo " --- /usr/share/doc/NVIDIA_GLX-1.0/README for more details."
- fi
-}
-
-#
-# Warn people that we have problems with those.
-#
-
-# Gaurd against the posibility that this directory doesn't exist
-if [ -d %{_prefix}/X11R6/lib/modules/extensions ]; then
- cd %{_prefix}/X11R6/lib/modules/extensions
- check_file libglx.a
- check_file libGLcore.a
+%pre xorg
+if [[ -x /usr/bin/nvidia-installer ]]; then
+ /usr/bin/nvidia-installer --uninstall -s
fi
-# shouldn't need to change directories here, but just in case..
-# We do, RedHat's Mesa packages install to /usr/lib now
-cd %{_libdir}
-check_file libGL.a
-for file in libGL.so*
-do
- check_file $file
-done
-
-cd %{_prefix}/X11R6/lib
-check_file libGL.a
-for file in libGL.so*
-do
- check_file $file
-done
-
-for file in libGLcore.so*
-do
- check_file $file
-done
+%post -n %{lib_name} -p /sbin/ldconfig
-final_check
+%postun -n %{lib_name} -p /sbin/ldconfig
-%post -n %{nameorig}_GLX
+%post xorg
%{update_menus}
-/sbin/ldconfig
-/sbin/ldconfig -n %{_prefix}/X11R6/lib/modules/extensions
-/sbin/ldconfig -n %{_prefix}/X11R6/lib
-
-# Create symbolic links
-cd %{_libdir}
-rm -f libGL.so.1
-ln -fs libGL.so.%{nvversion}.%{nrelease} libGL.so.1
-ln -fs libGL.so.%{nvversion}.%{nrelease} libGL.so
-ln -fs libGLcore.so.%{nvversion}.%{nrelease} libGLcore.so.1
-cd %{_prefix}/X11R6/lib/modules/extensions
-ln -fs libglx.so.%{nvversion}.%{nrelease} libglx.so
-cd %{_prefix}/X11R6/lib
-ln -fs libXvMCNVIDIA.so.%{nvversion}.%{nrelease} libXvMCNVIDIA_dynamic.so.1
-
-
-%postun -n %{name}_GLX
-%{clean_menus}
-
-first_time=0
-
-restore_files () {
- # Just get them all, hopefully noone else filled in any
- for i in `ls xxx.*.RPMSAVE 2> /dev/null` ; do
- # In earlier releases we could end up creating xxx.*.RPMSAVE files from
- # our own files. There is no point in restoring those.
- if [ "`grep -a -c -e "NVIDIA Corporation" $1`" -eq 0 ]; then
- # Rename RPMSAVE files that are not our own
- if [ $first_time -eq 0 ]; then
- echo " --- WARNING!!"
- first_time=1
- fi
- filename=`echo $i | sed -e "s/xxx.//" -e "s/.RPMSAVE//"`
- echo " $i"
- /bin/mv $i $filename
- else
- # remove our own
- rm $i
- fi
- done
-}
-
-final_check() {
- if [ $first_time -ne 0 ]; then
- echo " --- The above files are apparently saved files from a"
- echo " --- non-NVIDIA distribution (possibly MESA) that were"
- echo " --- put aside while the NVIDIA rpm was installed."
- echo " --- They are now being restored."
- fi
-}
-
-
-# $1 contains the number of instances of this package that will be
-# installed after the operation has completed. So [ $1 = 1 ] ==>
-# upgrade and [ $1 = 0 ] ==> uninstall. In the uninstall case we
-# need to clean up.
-if [ $1 = 0 ]; then
- # Restore the Mesa libraries that we saved away at install time
- cd %{_prefix}/X11R6/lib/modules/extensions
- restore_files
-
- cd %{_libdir}
- restore_files
-
- cd %{_prefix}/X11R6/lib
- restore_files
-
- final_check
-
- # Remove any symlinks that would have been created for our shared libraries.
- # Symlinkds required for Mesa will be recreated when ldconfig is run
- # but symlinks specific to our drivers will be left dangling
- # (/usr/lib/libGLcore.so.1 does this). These don't get removed by uninstall
- # because we didn't install them, ldconfig created them
- /bin/rm -f %{_libdir}/libGLcore.so.1
- /bin/rm -f %{_libdir}/libGLcore.so
- /bin/rm -f %{_libdir}/libGL.so.1
- /bin/rm -f %{_libdir}/libGL.so
- /bin/rm -f %{_prefix}/X11R6/lib/modules/extensions/libglx.so
- /bin/rm -f %{_prefix}/X11R6/lib/libXvMCNVIDIA_dynamic.so
- /bin/rm -f %{_prefix}/X11R6/lib/libGL.so
-fi
-
-/sbin/ldconfig
%post -n dkms-%{module_name}
-dkms add -m %{module_name} -v %{nrelease}.%{release} --rpm_safe_upgrade
-dkms build -m %{module_name} -v %{nrelease}.%{release} --rpm_safe_upgrade
-dkms install -m %{module_name} -v %{nrelease}.%{release} --rpm_safe_upgrade
-dkms status -m %{module_name} -v %{nrelease}.%{release}
+dkms add -m %{module_name} -v %{version}.%{release} --rpm_safe_upgrade
+dkms build -m %{module_name} -v %{version}.%{release} --rpm_safe_upgrade
+dkms install -m %{module_name} -v %{version}.%{release} --rpm_safe_upgrade
-if [ \$1 = 0 ] ; then
+# rmmod any old driver if present and not in use (e.g. by X)
+rmmod %{module_name} > /dev/null 2>&1
+
+if [ $1 = 1 ] ; then
# Replace nv driver with nvidia when doing install.
-grep -q "^[[:space:]]*Driver.*nv" /etc/X11/xorg.conf; NVD=$?
-if [ $NVD -eq 1 ]; then
-echo -n "Patching /etc/X11/xorg.conf... "
-%_bindir/perl -pi -e "s|nv|nvidia|" /etc/X11/xorg.conf
-echo "done"
-else
-XFdrake everything &
-fi
+sed -i '/^[[:space:]]*Driver[[:space:]]*"nv"/s/nv/nvidia/'
%{_sysconfdir}/X11/xorg.conf
+sed -i
'/^[[:space:]]*Load[[:space:]]*".*glx.*"/s|".*"|"%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia/libglx.so"|'
%{_sysconfdir}/X11/xorg.conf
+
+# Mandriva does this, but why?
+#grep -q '^[[:space:]]*Option "IgnoreEDID"' || sed -i
'/^[[:space:]]*Driver[[:space:]]*"nvidia".*$/s/$/\n Option "IgnoreEDID" "1"/'
# add nvidia to modprobe.preload
if [[ -f /etc/modprobe.preload ]];then
- grep -q %{module_name} /etc/modprobe.preload || echo %{module_name} >>
/etc/modprobe.preload
-fi
-
-# add nvidia to modprobe.conf
-if [[ -f /etc/modprobe.conf ]];then
- grep -q %{module_name} /etc/modprobe.conf || echo %{module_name} >>
/etc/modprobe.conf
- grep -q char-major-195* /etc/modprobe.conf || echo "char-major-195*
%{module_name}" >> /etc/modprobe.conf
-fi
-
+ grep -q "^%{module_name}$" /etc/modprobe.preload || echo %{module_name}
>> /etc/modprobe.preload
fi
-%pre -n dkms-%{module_name}
-# checks for existing manually installed nvidia driver and if found uninstalls
it
-if [ -f /lib/modules/%{currentkernel}/kernel/drivers/video/nvidia.ko ] && [ -f
%{_bindir}/nvidia-installer ]; then
- echo "Uninstalling existing manually installed nvidia driver"
- nvidia-installer --uninstall -s
fi
%preun -n dkms-%{module_name}
#Remove all nvidia modules for all kernels
-dkms remove -m %{module_name} -v %{nrelease}.%{release} --all
--rpm_safe_upgrade
+dkms remove -m %{module_name} -v %{version}.%{release} --all --rpm_safe_upgrade
-if [ \$1 = 0 ] ; then
+if [ $1 = 0 ] ; then
# Replace nvidia driver with nv when doing uninstall.
-grep -q "^[[:space:]]*Driver.*%{module_name}" /etc/X11/xorg.conf; NVD=$?
-if [ $NVD -eq 1 ]; then
-echo -n "Patching /etc/X11/xorg.conf... "
-%_bindir/perl -pi -e "s|nvidia|nv|" /etc/X11/xorg.conf
-echo "done"
-else
-XFdrake everything &
-fi
+sed -i '/^[[:space:]]*Driver[[:space:]]*"nvidia"/s/nvidia/nv/'
%{_sysconfdir}/X11/xorg.conf
+sed -i
'/^[[:space:]]*Load[[:space:]]*".*libglx.so"/s|"%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia/libglx.so"|"glx"|'
%{_sysconfdir}/X11/xorg.conf
+#perl -pi -e 's/[[:space:]]*Option "IgnoreEDID" "1".*$\n//'
-# remove fglrx from modprobe.preload
+# remove nvidia from modprobe.preload
if [[ -f /etc/modprobe.preload ]];then
-grep -v %{module_name} /etc/modprobe.preload > /tmp/modprobe.preload.tmp.\$\$
&& \\
-/bin/mv /tmp/modprobe.preload.tmp.\$\$ /etc/modprobe.preload
-fi
-
-# remove fglrx from modprobe.conf
-if [[ -f /etc/modprobe.conf ]];then
-grep -v %{module_name} /etc/modprobe.conf > /tmp/modprobe.conf.tmp.\$\$ && \\
-/bin/mv /tmp/modprobe.conf.tmp.\$\$ /etc/modprobe.conf
-grep -v "char-major-195* %{module_name}" /etc/modprobe.conf >
/tmp/modprobe.conf.tmp.\$\$ && \\
-/bin/mv /tmp/modprobe.conf.tmp.\$\$ /etc/modprobe.conf
+perl -pi -e 's/^%{module_name}\n//' /etc/modprobe.preload
fi
fi
+%files -n %{lib_name}
+%defattr(-,root,root)
+%{_sysconfdir}/ld.so.conf.d/%{lib_name}.conf
+%{_libdir}/nvidia
-%files -n %{nameorig}_GLX
+%files xorg
%defattr(-,root,root)
-%doc NVIDIA_Changelog nvidia-settings-user-guide.txt README.txt
XF86Config.sample
-%{_bindir}/*
-%{_libdir}/*.so*
-%{_libdir}/tls/*.so*
-%{_prefix}/X11R6/lib/modules/drivers/*
-%{_prefix}/X11R6/lib/modules/extensions/*.so*
-%{_prefix}/X11R6/lib/libXvMCNVIDIA.so*
-%{_prefix}/X11R6/lib/libXvMCNVIDIA_dynamic.so*
-%{_iconsdir}/%{name}.*
-%_iconsdir/*/nvidia.png
-%{_menudir}/*
+%doc %{packagedir}/usr/share/doc/NVIDIA_Changelog
+%doc %{packagedir}/usr/share/doc/nvidia-settings-user-guide.txt
+%doc %{packagedir}/usr/share/doc/README.txt
+%doc %{packagedir}/usr/share/doc/XF86Config.sample
+%{_bindir}/nvidia-settings
+%{_bindir}/nvidia-bug-report.sh
+%{_prefix}/X11R6/%{_lib}/libXvMCNVIDIA.so*
+%{_prefix}/X11R6/%{_lib}/libXvMCNVIDIA_dynamic.so*
+%{_prefix}/X11R6/%{_lib}/modules/drivers/nvidia_drv.*
+%dir %{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia
+%{_prefix}/X11R6/%{_lib}/modules/extensions/nvidia/libglx.so*
+%{_miconsdir}/%{name}.png
+%{_iconsdir}/%{name}.png
+%{_liconsdir}/%{name}.png
+%{_menudir}/%{name}
-%files -n %{nameorig}-devel
+%files -n %{name}-devel
%defattr(-,root,root)
-%{_includedir}/nvidia/*
-%{_prefix}/X11R6/lib/*.a
-%{_libdir}/*.la
+%{_includedir}/nvidia
+%{_prefix}/X11R6/%{_lib}/libXvMCNVIDIA.a
%files -n dkms-%{module_name}
%defattr(-,root,root)
-%{_prefix}/src/%{module_name}-%{nrelease}.%{release}
+/usr/src/%{module_name}-%{version}.%{release}
%changelog
+* Sun Oct 30 2005 Anssi Hannula <[EMAIL PROTECTED]> 7676-4plf
+- spec cleanups
+- ExclusiveArch %%ix86 x86_64
+- split nvidia_GLX to libnvidia-opengl and nvidia-xorg
+- %%pre and %%post pretty much rewritten
+- same URL on all packages
+- no conflicting files with libxorg-x11, use ld.so.conf.d
+- XFdrake compatible
+- summary and description fixes
+- remove forced V_BUILD_NV_PAT_SUPPORT=1
+
* Sun Oct 30 2005 Sebastien Savarin <[EMAIL PROTECTED]> 7676-3plf
- fix PLF reason
_______________________________________________
PLF-announce mailing list
[email protected]
https://www.zarb.org/mailman/listinfo/plf-announce