# # Spec file for NVIDIA X server module and OpenGL libraries. # # /usr/X11R6 is relocatable. # # $Header: //sw/main/drivers/NVIDIA_GLX.spec#24 $ # %define RELEASE 4363 %define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE} %define ver 1.0 Summary: NVIDIA module for XFree86 4.0 X server and OpenGL libraries Name: NVIDIA_GLX Version: %ver Release: %rel Copyright: NVIDIA Corp. 2000 Group: User Interface/X Hardware Support Source: ftp://ftp1.detonator.nvidia.com/pub/drivers/english/XFree86_40/NVIDIA_GLX-%{ver}-%{RELEASE}.tar.gz URL: http://www.nvidia.com Vendor: NVIDIA Corp. Packager: Buildmeister Prefix: /usr/X11R6 Requires: XFree86 >= 4.0.1 Requires: NVIDIA_kernel Requires: kernel > 2.2.0 Conflicts: Mesa, XFree86-Mesa-libGL BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION} # disable build root strip policy # XFree86 drivers may NOT be stripped... %define __spec_install_post /usr/lib/rpm/brp-compress %description NVIDIA Architecture support for Common X and OpenGL for all Linux systems. NVIDIA XFree86 4.0 server module and 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. %prep %setup -q -n ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE} %build %install DSOMAJOR=1 DSOMINOR=0 DSOPATCH=%{RELEASE} DSOREV=$DSOMAJOR.$DSOMINOR.$DSOPATCH [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT find -type d -print | while read dir do mkdir $RPM_BUILD_ROOT/"$dir" || true done make install ROOT=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT/usr/include mv $RPM_BUILD_ROOT/usr/share/doc/*/include $RPM_BUILD_ROOT/usr find $RPM_BUILD_ROOT -type f | grep -v '/usr/share/doc' \ | sed "s,^$RPM_BUILD_ROOT,," > /tmp/files.list echo '%doc' $RPM_BUILD_ROOT/usr/share/doc/* | sed "s,$RPM_BUILD_ROOT,," \ >> /tmp/files.list %pre # 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'll complain later if [ -e /usr/lib/libGL.so ]; then LIBGL=`ls -l /usr/lib/libGL.so | sed 's/.*->[ ]*\(.*\)$/\1/'` if [ X$LIBGL = X"libGL.so.1" ]; then rm -f /usr/lib/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..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 /usr/X11R6/lib/modules/extensions ]; then cd /usr/X11R6/lib/modules/extensions check_file libglx.a check_file libGLcore.a fi # shouldn't need to change directories here, but just in case.. # We do, RedHat's Mesa packages install to /usr/lib now cd /usr/lib check_file libGL.a for file in libGL.so* do check_file $file done cd /usr/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 final_check %post DSOMAJOR=1 DSOMINOR=0 DSOPATCH=%{rel} DSOREV=$DSOMAJOR.$DSOMINOR.$DSOPATCH /sbin/ldconfig /sbin/ldconfig -n /usr/X11R6/lib/modules/extensions /sbin/ldconfig -n /usr/X11R6/lib # create compile-time links cd /usr/lib ln -sf libGL.so.$DSOMAJOR libGL.so %postun 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" 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 /usr/X11R6/lib/modules/extensions restore_files cd /usr/lib restore_files cd /usr/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 rm -f /usr/lib/libGLcore.so.1 rm -f /usr/lib/libGLcore.so rm -f /usr/lib/libGL.so.1 rm -f /usr/lib/libGL.so rm -f /usr/X11R6/lib/modules/extensions/libglx.so fi /sbin/ldconfig %clean [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT %files -f /tmp/files.list %defattr (-, root, root) %changelog * Mon Jul 14 2003 darkness - Updated for 4363 - Replaced hard-coded references to the release version with %{rel} - Changed .RPMSAVE to .rpmsave - Fixed error in definition of %rel - Changed the way file installation happens - Added Conflicts for Mesa * Mon May 13 2002 George Kyriazis - Install libXvMCNVIDIA.so, too. * Mon Mar 4 2002 Joseph Kain - Install README.DE * Tue Feb 26 2002 Joseph Kain - libXvMCNVIDIA.so is now libXvMCNVIDIA.a * Thu Feb 21 2002 George Kyriazis - Added libXvMCNVIDIA.so * Sat Feb 16 2002 Joseph Kain - Protect against missing directories, specifically /usr/X11R6/lib/modules/extensions * Mon Nov 26 2001 Joseph Kain - Install license file * Mon Nov 26 2001 Joseph Kain - Use %{_tmppath} instead of hardcoding /var/tmp * Wed Mar 28 2001 Joseph Kain - Stop renaming our own old libraries with xxx.*.RPMSAVE - Detect uninstall case to restore saved Mesa libs and remove extra symlinks - added gl.h and glx.h * Mon May 1 2000 George Kyriazis - Fixed installation of revisions of shared libraries. * Thu Apr 27 2000 Gregory McLean - Added BuildRoot definition. - Added some logic to deal with the two most common problems. - Added the FAQ. - Added logic for epoc builds if needed.