Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

nvidia: Initial commit of all nvidia packages

Signed-off-by: Philip J Perry <phil@elrepo.org>
  • Loading branch information...
commit 5d8a5c70af8ec0b872cc2ed15841f83049f2c1fe 1 parent 60b211a
@pjperry pjperry authored
Showing with 5,665 additions and 0 deletions.
  1. +270 −0 nvidia-173xx-kmod/el5/kmodtool-el5-nvidia-173xx.sh
  2. +138 −0 nvidia-173xx-kmod/el5/nvidia-173xx-kmod.spec
  3. +283 −0 nvidia-173xx-kmod/el6/kmodtool-nvidia-173xx-el6.sh
  4. +124 −0 nvidia-173xx-kmod/el6/nvidia-173xx-kmod.spec
  5. +269 −0 nvidia-96xx-kmod/el5/kmodtool-el5-nvidia-96xx.sh
  6. +130 −0 nvidia-96xx-kmod/el5/nvidia-96xx-kmod.spec
  7. +283 −0 nvidia-96xx-kmod/el6/kmodtool-nvidia-96xx-el6.sh
  8. +86 −0 nvidia-96xx-kmod/el6/nvidia-96xx-kmod.spec
  9. +270 −0 nvidia-kmod/el5/kmodtool-nvidia-el5.sh
  10. +187 −0 nvidia-kmod/el5/nvidia-kmod.spec
  11. +283 −0 nvidia-kmod/el6/kmodtool-nvidia-el6.sh
  12. +115 −0 nvidia-kmod/el6/nvidia-kmod.spec
  13. +154 −0 nvidia-x11-drv-173xx/el5/nvidia-config-display
  14. +359 −0 nvidia-x11-drv-173xx/el5/nvidia-x11-drv-173xx.spec
  15. +20 −0 nvidia-x11-drv-173xx/el5/nvidia.csh
  16. +2 −0  nvidia-x11-drv-173xx/el5/nvidia.modprobe
  17. +11 −0 nvidia-x11-drv-173xx/el5/nvidia.nodes
  18. +19 −0 nvidia-x11-drv-173xx/el5/nvidia.sh
  19. +6 −0 nvidia-x11-drv-173xx/el6/blacklist-nouveau.conf
  20. +154 −0 nvidia-x11-drv-173xx/el6/nvidia-config-display
  21. +302 −0 nvidia-x11-drv-173xx/el6/nvidia-x11-drv-173xx.spec
  22. +11 −0 nvidia-x11-drv-173xx/el6/nvidia.nodes
  23. +154 −0 nvidia-x11-drv-96xx/el5/nvidia-config-display
  24. +341 −0 nvidia-x11-drv-96xx/el5/nvidia-x11-drv-96xx.spec
  25. +20 −0 nvidia-x11-drv-96xx/el5/nvidia.csh
  26. +2 −0  nvidia-x11-drv-96xx/el5/nvidia.modprobe
  27. +11 −0 nvidia-x11-drv-96xx/el5/nvidia.nodes
  28. +19 −0 nvidia-x11-drv-96xx/el5/nvidia.sh
  29. +6 −0 nvidia-x11-drv-96xx/el6/blacklist-nouveau.conf
  30. +154 −0 nvidia-x11-drv-96xx/el6/nvidia-config-display
  31. +301 −0 nvidia-x11-drv-96xx/el6/nvidia-x11-drv-96xx.spec
  32. +11 −0 nvidia-x11-drv-96xx/el6/nvidia.nodes
  33. +154 −0 nvidia-x11-drv/el5/nvidia-config-display
  34. +427 −0 nvidia-x11-drv/el5/nvidia-x11-drv.spec
  35. +20 −0 nvidia-x11-drv/el5/nvidia.csh
  36. +2 −0  nvidia-x11-drv/el5/nvidia.modprobe
  37. +11 −0 nvidia-x11-drv/el5/nvidia.nodes
  38. +19 −0 nvidia-x11-drv/el5/nvidia.sh
  39. +6 −0 nvidia-x11-drv/el6/blacklist-nouveau.conf
  40. +154 −0 nvidia-x11-drv/el6/nvidia-config-display
  41. +366 −0 nvidia-x11-drv/el6/nvidia-x11-drv.spec
  42. +11 −0 nvidia-x11-drv/el6/nvidia.nodes
View
270 nvidia-173xx-kmod/el5/kmodtool-el5-nvidia-173xx.sh
@@ -0,0 +1,270 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# Copyright (c) 2003-2008 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="0.10.10_kmp3"
+knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen[0U]?(-PAE)|xen)
+kmod_name=
+kver=
+verrel=
+variant=
+kmp=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ case "$verrel" in
+ *.el*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;;
+ esac
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmp_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmp_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmp_version" ]; then
+ echo "Version: %{kmp_version}"
+ fi
+
+ if [ ! -z "$kmp_release" ]; then
+ echo "Release: %{kmp_release}"
+ fi
+
+ if [ ! -z "$kmp" ]; then
+ echo "%global _use_internal_dependency_generator 0"
+ fi
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${variant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Conflicts: module-init-tools = 3.3-0.pre3.1.60.el5
+EOF
+
+ if [ -z "$kmp" ]; then
+ echo "Requires: ${kdep}"
+ fi
+
+ cat <<EOF
+Requires: kernel${dashvariant} >= 2.6.18-128.el5
+Requires: nvidia-x11-drv-173xx = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+if [ "no" != "$kmp_nobuildreqs" ]
+then
+ echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
+fi
+
+if [ "" != "$kmp_override_preamble" ]
+then
+ cat "$kmp_override_preamble"
+fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the proprietary NVIDIA OpenGL kernel driver module
+built for the Linux kernel using the %{_target_cpu} family of processors.
+
+%post -n kmod-${kmod_name}${dashvariant}
+if [ -e "/boot/System.map-${verrel}${variant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${variant}" "${verrel}${variant}" > /dev/null || :
+fi
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(find /lib/modules/${verrel}${variant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant} | grep '\.ko$' \
+ > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+ fi
+
+ cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+/sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+ fi
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$kmp_override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${variant}/"
+ echo "%config /etc/depmod.d/${kmod_name}.conf"
+ #BZ252188 - I've commented this out for the moment since RHEL5 doesn't
+ # really support external firmware e.g. at install time. If
+ # you really want it, use an override filelist solution.
+ #echo "/lib/firmware/"
+else
+ cat "$kmp_override_filelist"
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ rpmtemplate_kmp <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM with KMP dependencies
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ rpmtemplate_kmp)
+ shift
+ kmp=1
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
138 nvidia-173xx-kmod/el5/nvidia-173xx-kmod.spec
@@ -0,0 +1,138 @@
+# Define the kmod package name here.
+%define kmod_name nvidia-173xx
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+%{!?kversion: %define kversion 2.6.18-164.el5}
+
+Name: %{kmod_name}-kmod
+Version: 173.14.27
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA 173.14.xx OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: rpm-build, redhat-rpm-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: %{kmod_name}-%{version}.tar.bz2
+Source10: kmodtool-el5-%{kmod_name}.sh
+
+NoSource: 0
+
+# Define the variants for each architecture.
+%define basevar ""
+%ifarch i686
+%define paevar PAE
+%endif
+
+# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture.
+%{!?kvariants: %define kvariants %{?basevar} %{?paevar}}
+
+# Magic hidden here.
+%define kmodtool sh %{SOURCE10}
+%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)}
+
+# Disable the building of the debug package(s).
+%define debug_package %{nil}
+
+# Define the filter.
+%define __find_requires sh %{_builddir}/%{buildsubdir}/filter-requires.sh
+
+%description
+This package provides the proprietary NVIDIA 173.14.xx OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T -a 0
+echo "/usr/lib/rpm/redhat/find-requires | %{__sed} -e '/^ksym.*/d'" > filter-requires.sh
+
+%ifarch i686
+./%{kmod_name}-%{version}/NVIDIA-Linux-x86-%{version}-pkg0.run --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+./%{kmod_name}-%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run --extract-only --target nvidiapkg
+%endif
+
+for kvariant in %{kvariants} ; do
+ %{__cp} -a nvidiapkg _kmod_build_$kvariant
+ %{__cat} <<-EOF > _kmod_build_$kvariant/usr/src/nv/%{kmod_name}.conf
+ override nvidia * weak-updates/%{kmod_name}
+ EOF
+done
+
+%build
+for kvariant in %{kvariants} ; do
+ export SYSSRC=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ pushd _kmod_build_$kvariant/usr/src/nv
+ %{__make} module
+ popd
+done
+
+%install
+export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+for kvariant in %{kvariants} ; do
+ pushd _kmod_build_$kvariant/usr/src/nv
+ ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ %{__make} -C "${ksrc}" modules_install M=$PWD
+ %{__mkdir_p} ${INSTALL_MOD_PATH}/etc/depmod.d
+ %{__install} -p -m 0644 %{kmod_name}.conf ${INSTALL_MOD_PATH}/etc/depmod.d/
+ popd
+done
+
+%clean
+%{__rm} -rf $RPM_BUILD_ROOT
+
+%changelog
+* Sat Aug 21 2010 Philip J Perry <phil@elrepo.org> - 173.14.27-1.el5.elrepo
+- Update to version 173.14.27.
+
+* Thu Feb 04 2010 Philip J Perry <phil@elrepo.org> - 173.14.25-2.el5.elrepo
+- Rebuilt to match nvidia-x11-drv-173xx.
+- Requires kernel >= 2.6.18-128.el5
+
+* Wed Feb 03 2010 Philip J Perry <phil@elrepo.org> - 173.14.25-1.el5.elrepo
+- Forked to create kmod-nvidia-173xx legacy release.
+
+* Sun Nov 01 2009 Philip J Perry <phil@elrepo.org> - 190.42-1.el5.elrepo
+- Updated to version 190.42.
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-2.el5.elrepo
+- kernel-modules in kmodtool changed to kabi-modules
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-1.el5.elrepo
+- Update to version 185.18.36.
+
+* Mon Aug 17 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-2.el5.elrepo
+- Added Provides: kabi-modules as kABI looks stable for RHEL5.4.
+
+* Mon Aug 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-1.el5.elrepo
+- Update to version 185.18.31.
+- Drop bundling the source here too, it's included in nvidia-x11-drv.
+
+* Fri Jul 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.14-1.el5.elrepo
+- Rebuilt against kernel-2.6.18-128.el5 for release.
+- Updated kmodtool to latest specification.
+- Create nvidia.conf in spec file.
+
+* Tue Jul 07 2009 Philip J Perry <phil@elrepo.org>
+- Updated sources to match nvidia-x11-drv.
+- Fixed paths to extract sources.
+- Don't strip the module (NVIDIA doesn't).
+
+* Wed Jun 10 2009 Alan Bartlett <ajb@elrepo.org>
+- Updated the package to 185.18.14 version.
+
+* Thu May 21 2009 Dag Wieers <dag@wieers.com>
+- Adjusted the package name.
+
+* Tue May 19 2009 Alan Bartlett <ajb@elrepo.org>
+- Total revision and re-build of the kmod packages.
+
+* Thu May 14 2009 Alan Bartlett <ajb@elrepo.org>
+- Initial build of the kmod packages.
View
283 nvidia-173xx-kmod/el6/kmodtool-nvidia-173xx-el6.sh
@@ -0,0 +1,283 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# An original version appeared in Fedora. This version is
+# generally called only by the %kernel_module_package RPM macro
+# during the process of building Driver Update Packages (which
+# are also known as "kmods" in the Fedora community).
+#
+# Copyright (c) 2003-2010 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# Changelog:
+#
+# 2010/07/28 - Add fixes for filelists in line with LF standard
+# - Remove now defunct "framepointer" kernel variant
+# - Change version to "rhel6-rh2" as a consequence.
+#
+# 2010/01/10 - Simplified for RHEL6. We are working on upstream
+# moving to a newer format and in any case do not
+# need to retain support for really old systems.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="rhel6-rh2"
+knownvariants=@(debug|kdump)
+kmod_name=
+kver=
+verrel=
+variant=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_filelist() {
+ local IFS=$'\n'
+ filelist=($(cat))
+
+ if [ ${#filelist[@]} -gt 0 ];
+ then
+ for ((n = 0; n < ${#filelist[@]}; n++));
+ do
+ line="${filelist[n]}"
+ line=$(echo "$line" \
+ | sed -e "s/%verrel/$verrel/g" \
+ | sed -e "s/%variant/$variant/g" \
+ | sed -e "s/%dashvariant/$dashvariant/g" \
+ | sed -e "s/%dotvariant/$dotvariant/g" \
+ | sed -e "s/\.%1/$dotvariant/g" \
+ | sed -e "s/\-%1/$dotvariant/g" \
+ | sed -e "s/%2/$verrel/g")
+ echo "$line"
+ done
+ else
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}"
+ fi
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ local dotvariant="${variant:+.${variant}}"
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmod_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmod_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmod_version" ]; then
+ echo "Version: %{kmod_version}"
+ fi
+
+ if [ ! -z "$kmod_release" ]; then
+ echo "Release: %{kmod_release}"
+ fi
+
+ # Turn off the internal dep generator so we will use the kmod scripts.
+ echo "%global _use_internal_dependency_generator 0"
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${dotvariant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: nvidia-x11-drv-173xx = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+ if [ "no" != "$nobuildreqs" ]
+ then
+ echo "BuildRequires: kernel${dashvariant}-devel"
+ fi
+
+ if [ "" != "$override_preamble" ]
+ then
+ cat "$override_preamble"
+ fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the ${kmod_name} kernel module(s) built
+for the Linux kernel using the %{_target_cpu} family of processors.
+EOF
+
+##############################################################################
+## The following are not part of this script directly, they are scripts ##
+## that will be executed by RPM during various stages of package processing ##
+##############################################################################
+
+cat <<EOF
+%post -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+EOF
+
+cat <<EOF
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant}-%{version}-%{release}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+
+cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}/"
+ echo "%config /etc/depmod.d/kmod-${kmod_name}.conf"
+else
+ cat "$override_filelist" | get_filelist
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
124 nvidia-173xx-kmod/el6/nvidia-173xx-kmod.spec
@@ -0,0 +1,124 @@
+# Define the kmod package name here.
+%define kmod_name nvidia-173xx
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+%{!?kversion: %define kversion 2.6.32-71.el6.%{_target_cpu}}
+
+Name: %{kmod_name}-kmod
+Version: 173.14.28
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA 173.14.xx OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: redhat-rpm-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: ftp://download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}-pkg0.run
+Source1: ftp://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run
+Source10: kmodtool-%{kmod_name}-el6.sh
+
+NoSource: 0
+NoSource: 1
+
+# Magic hidden here.
+%{expand:%(sh %{SOURCE10} rpmtemplate %{kmod_name} %{kversion} "")}
+
+# Disable the building of the debug package(s).
+%define debug_package %{nil}
+
+%description
+This package provides the proprietary NVIDIA 173.14.xx OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T
+echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
+
+%ifarch i686
+sh %{SOURCE0} --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+sh %{SOURCE1} --extract-only --target nvidiapkg
+%endif
+
+%{__cp} -a nvidiapkg _kmod_build_
+
+%build
+export SYSSRC=%{_usrsrc}/kernels/%{kversion}
+pushd _kmod_build_/usr/src/nv
+%{__make} module
+popd
+
+%install
+export INSTALL_MOD_PATH=%{buildroot}
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+pushd _kmod_build_/usr/src/nv
+ksrc=%{_usrsrc}/kernels/%{kversion}
+%{__make} -C "${ksrc}" modules_install M=$PWD
+popd
+%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
+%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+# Remove the unrequired files.
+%{__rm} -f %{buildroot}/lib/modules/%{kversion}/modules.*
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%changelog
+* Fri Feb 04 2011 Philip J Perry <phil@elrepo.org> - 173.14.28-1.el6.elrepo
+- Fork to el6.
+- Update to version 173.14.28.
+
+* Sat Aug 21 2010 Philip J Perry <phil@elrepo.org> - 173.14.27-1.el5.elrepo
+- Update to version 173.14.27.
+
+* Thu Feb 04 2010 Philip J Perry <phil@elrepo.org> - 173.14.25-2.el5.elrepo
+- Rebuilt to match nvidia-x11-drv-173xx.
+- Requires kernel >= 2.6.18-128.el5
+
+* Wed Feb 03 2010 Philip J Perry <phil@elrepo.org> - 173.14.25-1.el5.elrepo
+- Forked to create kmod-nvidia-173xx legacy release.
+
+* Sun Nov 01 2009 Philip J Perry <phil@elrepo.org> - 190.42-1.el5.elrepo
+- Updated to version 190.42.
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-2.el5.elrepo
+- kernel-modules in kmodtool changed to kabi-modules
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-1.el5.elrepo
+- Update to version 185.18.36.
+
+* Mon Aug 17 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-2.el5.elrepo
+- Added Provides: kabi-modules as kABI looks stable for RHEL5.4.
+
+* Mon Aug 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-1.el5.elrepo
+- Update to version 185.18.31.
+- Drop bundling the source here too, it's included in nvidia-x11-drv.
+
+* Fri Jul 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.14-1.el5.elrepo
+- Rebuilt against kernel-2.6.18-128.el5 for release.
+- Updated kmodtool to latest specification.
+- Create nvidia.conf in spec file.
+
+* Tue Jul 07 2009 Philip J Perry <phil@elrepo.org>
+- Updated sources to match nvidia-x11-drv.
+- Fixed paths to extract sources.
+- Don't strip the module (NVIDIA doesn't).
+
+* Wed Jun 10 2009 Alan Bartlett <ajb@elrepo.org>
+- Updated the package to 185.18.14 version.
+
+* Thu May 21 2009 Dag Wieers <dag@wieers.com>
+- Adjusted the package name.
+
+* Tue May 19 2009 Alan Bartlett <ajb@elrepo.org>
+- Total revision and re-build of the kmod packages.
+
+* Thu May 14 2009 Alan Bartlett <ajb@elrepo.org>
+- Initial build of the kmod packages.
View
269 nvidia-96xx-kmod/el5/kmodtool-el5-nvidia-96xx.sh
@@ -0,0 +1,269 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# Copyright (c) 2003-2008 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="0.10.10_kmp3"
+knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen[0U]?(-PAE)|xen)
+kmod_name=
+kver=
+verrel=
+variant=
+kmp=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ case "$verrel" in
+ *.el*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;;
+ esac
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmp_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmp_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmp_version" ]; then
+ echo "Version: %{kmp_version}"
+ fi
+
+ if [ ! -z "$kmp_release" ]; then
+ echo "Release: %{kmp_release}"
+ fi
+
+ if [ ! -z "$kmp" ]; then
+ echo "%global _use_internal_dependency_generator 0"
+ fi
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${variant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Conflicts: module-init-tools = 3.3-0.pre3.1.60.el5
+EOF
+
+ if [ -z "$kmp" ]; then
+ echo "Requires: ${kdep}"
+ fi
+
+ cat <<EOF
+Requires: nvidia-x11-drv-96xx = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+if [ "no" != "$kmp_nobuildreqs" ]
+then
+ echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
+fi
+
+if [ "" != "$kmp_override_preamble" ]
+then
+ cat "$kmp_override_preamble"
+fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the proprietary NVIDIA OpenGL kernel driver module
+built for the Linux kernel using the %{_target_cpu} family of processors.
+
+%post -n kmod-${kmod_name}${dashvariant}
+if [ -e "/boot/System.map-${verrel}${variant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${variant}" "${verrel}${variant}" > /dev/null || :
+fi
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(find /lib/modules/${verrel}${variant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant} | grep '\.ko$' \
+ > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+ fi
+
+ cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+/sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+ fi
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$kmp_override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${variant}/"
+ echo "%config /etc/depmod.d/${kmod_name}.conf"
+ #BZ252188 - I've commented this out for the moment since RHEL5 doesn't
+ # really support external firmware e.g. at install time. If
+ # you really want it, use an override filelist solution.
+ #echo "/lib/firmware/"
+else
+ cat "$kmp_override_filelist"
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ rpmtemplate_kmp <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM with KMP dependencies
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ rpmtemplate_kmp)
+ shift
+ kmp=1
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
130 nvidia-96xx-kmod/el5/nvidia-96xx-kmod.spec
@@ -0,0 +1,130 @@
+# Define the kmod package name here.
+%define kmod_name nvidia-96xx
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+%{!?kversion: %define kversion 2.6.18-164.el5}
+
+Name: %{kmod_name}-kmod
+Version: 96.43.18
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA 96xx OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: rpm-build, redhat-rpm-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: %{kmod_name}-%{version}.tar.bz2
+Source10: kmodtool-el5-%{kmod_name}.sh
+
+NoSource: 0
+
+# Define the variants for each architecture.
+%define basevar ""
+%ifarch i686
+%define paevar PAE
+%endif
+
+# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture.
+%{!?kvariants: %define kvariants %{?basevar} %{?paevar}}
+
+# Magic hidden here.
+%define kmodtool sh %{SOURCE10}
+%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)}
+
+# Disable the building of the debug package(s).
+%define debug_package %{nil}
+
+# Define the filter.
+%define __find_requires sh %{_builddir}/%{buildsubdir}/filter-requires.sh
+
+%description
+This package provides the proprietary NVIDIA 96xx OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T -a 0
+echo "/usr/lib/rpm/redhat/find-requires | %{__sed} -e '/^ksym.*/d'" > filter-requires.sh
+
+%ifarch i686
+./%{kmod_name}-%{version}/NVIDIA-Linux-x86-%{version}-pkg0.run --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+./%{kmod_name}-%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run --extract-only --target nvidiapkg
+%endif
+
+for kvariant in %{kvariants} ; do
+ %{__cp} -a nvidiapkg _kmod_build_$kvariant
+ %{__cat} <<-EOF > _kmod_build_$kvariant/usr/src/nv/%{kmod_name}.conf
+ override nvidia * weak-updates/%{kmod_name}
+ EOF
+done
+
+%build
+for kvariant in %{kvariants} ; do
+ export SYSSRC=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ pushd _kmod_build_$kvariant/usr/src/nv
+ %{__make} module
+ popd
+done
+
+%install
+export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+for kvariant in %{kvariants} ; do
+ pushd _kmod_build_$kvariant/usr/src/nv
+ ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ %{__make} -C "${ksrc}" modules_install M=$PWD
+ %{__mkdir_p} ${INSTALL_MOD_PATH}/etc/depmod.d
+ %{__install} -p -m 0644 %{kmod_name}.conf ${INSTALL_MOD_PATH}/etc/depmod.d/
+ popd
+done
+
+%clean
+%{__rm} -rf $RPM_BUILD_ROOT
+
+%changelog
+* Sat Aug 21 2010 Philip J Perry <phil@elrepo.org> - 96.43.18-1.el5.elrepo
+- Update to version 96.43.18.
+
+* Thu Feb 04 2010 Philip J Perry <phil@elrepo.org> - 96.43.16-1.el5.elrepo
+- Update to version 96.43.16.
+- Removed Requires kernel > 2.6.18-128.el5 [BugID 33]
+
+* Tue Dec 15 2009 Akemi Yagi <toracat@elrepo.org> - 96.43.14-1.el5.elrepo
+- Update to version 96.43.14.
+- Nvidia legacy 96xx driver rebuilt for ELRepo, based on package contributed by Marco Giunta.
+
+* Thu Sep 01 2009 Marco Giunta <giunta AT sissa.it>
+- Downgraded and adapted to version 96.43.13.
+
+* Mon Aug 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-1.el5.elrepo
+- Update to version 185.18.31.
+- Drop bundling the source here too, it's included in nvidia-x11-drv.
+
+* Fri Jul 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.14-1.el5.elrepo
+- Rebuilt against kernel-2.6.18-128.el5 for release.
+- Updated kmodtool to latest specification.
+- Create nvidia.conf in spec file.
+
+* Tue Jul 07 2009 Philip J Perry <phil@elrepo.org>
+- Updated sources to match nvidia-x11-drv.
+- Fixed paths to extract sources.
+- Don't strip the module (NVIDIA doesn't).
+
+* Wed Jun 10 2009 Alan Bartlett <ajb@elrepo.org>
+- Updated the package to 185.18.14 version.
+
+* Thu May 21 2009 Dag Wieers <dag@wieers.com>
+- Adjusted the package name.
+
+* Tue May 19 2009 Alan Bartlett <ajb@elrepo.org>
+- Total revision and re-build of the kmod packages.
+
+* Thu May 14 2009 Alan Bartlett <ajb@elrepo.org>
+- Initial build of the kmod packages.
View
283 nvidia-96xx-kmod/el6/kmodtool-nvidia-96xx-el6.sh
@@ -0,0 +1,283 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# An original version appeared in Fedora. This version is
+# generally called only by the %kernel_module_package RPM macro
+# during the process of building Driver Update Packages (which
+# are also known as "kmods" in the Fedora community).
+#
+# Copyright (c) 2003-2010 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# Changelog:
+#
+# 2010/07/28 - Add fixes for filelists in line with LF standard
+# - Remove now defunct "framepointer" kernel variant
+# - Change version to "rhel6-rh2" as a consequence.
+#
+# 2010/01/10 - Simplified for RHEL6. We are working on upstream
+# moving to a newer format and in any case do not
+# need to retain support for really old systems.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="rhel6-rh2"
+knownvariants=@(debug|kdump)
+kmod_name=
+kver=
+verrel=
+variant=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_filelist() {
+ local IFS=$'\n'
+ filelist=($(cat))
+
+ if [ ${#filelist[@]} -gt 0 ];
+ then
+ for ((n = 0; n < ${#filelist[@]}; n++));
+ do
+ line="${filelist[n]}"
+ line=$(echo "$line" \
+ | sed -e "s/%verrel/$verrel/g" \
+ | sed -e "s/%variant/$variant/g" \
+ | sed -e "s/%dashvariant/$dashvariant/g" \
+ | sed -e "s/%dotvariant/$dotvariant/g" \
+ | sed -e "s/\.%1/$dotvariant/g" \
+ | sed -e "s/\-%1/$dotvariant/g" \
+ | sed -e "s/%2/$verrel/g")
+ echo "$line"
+ done
+ else
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}"
+ fi
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ local dotvariant="${variant:+.${variant}}"
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmod_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmod_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmod_version" ]; then
+ echo "Version: %{kmod_version}"
+ fi
+
+ if [ ! -z "$kmod_release" ]; then
+ echo "Release: %{kmod_release}"
+ fi
+
+ # Turn off the internal dep generator so we will use the kmod scripts.
+ echo "%global _use_internal_dependency_generator 0"
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${dotvariant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: nvidia-x11-drv-96xx = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+ if [ "no" != "$nobuildreqs" ]
+ then
+ echo "BuildRequires: kernel${dashvariant}-devel"
+ fi
+
+ if [ "" != "$override_preamble" ]
+ then
+ cat "$override_preamble"
+ fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the ${kmod_name} kernel module(s) built
+for the Linux kernel using the %{_target_cpu} family of processors.
+EOF
+
+##############################################################################
+## The following are not part of this script directly, they are scripts ##
+## that will be executed by RPM during various stages of package processing ##
+##############################################################################
+
+cat <<EOF
+%post -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+EOF
+
+cat <<EOF
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant}-%{version}-%{release}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+
+cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}/"
+ echo "%config /etc/depmod.d/kmod-${kmod_name}.conf"
+else
+ cat "$override_filelist" | get_filelist
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
86 nvidia-96xx-kmod/el6/nvidia-96xx-kmod.spec
@@ -0,0 +1,86 @@
+# Define the kmod package name here.
+%define kmod_name nvidia-96xx
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+%{!?kversion: %define kversion 2.6.32-71.el6.%{_target_cpu}}
+
+Name: %{kmod_name}-kmod
+Version: 96.43.19
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA 96xx OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: redhat-rpm-config
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: ftp://download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}-pkg0.run
+Source1: ftp://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}-pkg2.run
+Source10: kmodtool-%{kmod_name}-el6.sh
+
+NoSource: 0
+NoSource: 1
+
+# Magic hidden here.
+%{expand:%(sh %{SOURCE10} rpmtemplate %{kmod_name} %{kversion} "")}
+
+# Disable the building of the debug package(s).
+%define debug_package %{nil}
+
+%description
+This package provides the proprietary NVIDIA 96xx OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T
+echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
+
+%ifarch i686
+sh %{SOURCE0} --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+sh %{SOURCE1} --extract-only --target nvidiapkg
+%endif
+
+%{__cp} -a nvidiapkg _kmod_build_
+
+%build
+export SYSSRC=%{_usrsrc}/kernels/%{kversion}
+pushd _kmod_build_/usr/src/nv
+%{__make} module
+popd
+
+%install
+export INSTALL_MOD_PATH=%{buildroot}
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+pushd _kmod_build_/usr/src/nv
+ksrc=%{_usrsrc}/kernels/%{kversion}
+%{__make} -C "${ksrc}" modules_install M=$PWD
+popd
+%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
+%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+# Remove the unrequired files.
+%{__rm} -f %{buildroot}/lib/modules/%{kversion}/modules.*
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%changelog
+* Fri Feb 04 2011 Philip J Perry <phil@elrepo.org> - 96.43.19-1.el6.elrepo
+- Fork to el6
+- Update to version 96.43.19.
+
+* Sat Aug 21 2010 Philip J Perry <phil@elrepo.org> - 96.43.18-1.el5.elrepo
+- Update to version 96.43.18.
+
+* Thu Feb 04 2010 Philip J Perry <phil@elrepo.org> - 96.43.16-1.el5.elrepo
+- Update to version 96.43.16.
+- Removed Requires kernel > 2.6.18-128.el5 [BugID 33]
+
+* Tue Dec 15 2009 Akemi Yagi <toracat@elrepo.org> - 96.43.14-1.el5.elrepo
+- Update to version 96.43.14.
+- Nvidia legacy 96xx driver rebuilt for ELRepo, based on package contributed by Marco Giunta.
View
270 nvidia-kmod/el5/kmodtool-nvidia-el5.sh
@@ -0,0 +1,270 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# Copyright (c) 2003-2008 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="0.10.10_kmp3"
+knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen[0U]?(-PAE)|xen)
+kmod_name=
+kver=
+verrel=
+variant=
+kmp=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ case "$verrel" in
+ *.el*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+ *) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;;
+ esac
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmp_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmp_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmp_version" ]; then
+ echo "Version: %{kmp_version}"
+ fi
+
+ if [ ! -z "$kmp_release" ]; then
+ echo "Release: %{kmp_release}"
+ fi
+
+ if [ ! -z "$kmp" ]; then
+ echo "%global _use_internal_dependency_generator 0"
+ fi
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${variant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Conflicts: module-init-tools = 3.3-0.pre3.1.60.el5
+EOF
+
+ if [ -z "$kmp" ]; then
+ echo "Requires: ${kdep}"
+ fi
+
+ cat <<EOF
+Requires: kernel${dashvariant} >= 2.6.18-128.el5
+Requires: ${kmod_name}-x11-drv = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+if [ "no" != "$kmp_nobuildreqs" ]
+then
+ echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
+fi
+
+if [ "" != "$kmp_override_preamble" ]
+then
+ cat "$kmp_override_preamble"
+fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the proprietary NVIDIA OpenGL kernel driver module
+built for the Linux kernel using the %{_target_cpu} family of processors.
+
+%post -n kmod-${kmod_name}${dashvariant}
+if [ -e "/boot/System.map-${verrel}${variant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${variant}" "${verrel}${variant}" > /dev/null || :
+fi
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(find /lib/modules/${verrel}${variant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant} | grep '\.ko$' \
+ > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+ fi
+
+ cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+/sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+EOF
+
+ if [ ! -z "$kmp" ]; then
+ cat <<EOF
+echo "Working. This may take some time ..."
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+ fi
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$kmp_override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${variant}/"
+ echo "%config /etc/depmod.d/kmod-${kmod_name}.conf"
+ #BZ252188 - I've commented this out for the moment since RHEL5 doesn't
+ # really support external firmware e.g. at install time. If
+ # you really want it, use an override filelist solution.
+ #echo "/lib/firmware/"
+else
+ cat "$kmp_override_filelist"
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ rpmtemplate_kmp <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM with KMP dependencies
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ rpmtemplate_kmp)
+ shift
+ kmp=1
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
187 nvidia-kmod/el5/nvidia-kmod.spec
@@ -0,0 +1,187 @@
+# Define the kmod package name here.
+%define kmod_name nvidia
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+# kABI compatible with kernel 2.6.18-128.el5 upwards
+%{!?kversion: %define kversion 2.6.18-164.el5}
+
+Name: %{kmod_name}-kmod
+Version: 275.21
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: redhat-rpm-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: ftp://download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}.run
+Source1: ftp://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run
+Source10: kmodtool-%{kmod_name}-el5.sh
+
+NoSource: 0
+NoSource: 1
+
+# Define the variants for each architecture.
+%define basevar ""
+%ifarch i686
+%define paevar PAE
+%endif
+
+# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture.
+%{!?kvariants: %define kvariants %{?basevar} %{?paevar}}
+
+# Magic hidden here.
+%{expand:%(sh %{SOURCE10} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants})}
+
+# Disable the building of the debug package(s).
+%define debug_package %{nil}
+
+# Define the filter.
+%define __find_requires sh %{_builddir}/%{buildsubdir}/filter-requires.sh
+
+%description
+This package provides the proprietary NVIDIA OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T
+echo "/usr/lib/rpm/redhat/find-requires | %{__sed} -e '/^ksym.*/d'" > filter-requires.sh
+echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
+
+%ifarch i686
+sh %{SOURCE0} --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+sh %{SOURCE1} --extract-only --target nvidiapkg
+%endif
+
+for kvariant in %{kvariants} ; do
+ %{__cp} -a nvidiapkg _kmod_build_$kvariant
+done
+
+%build
+for kvariant in %{kvariants} ; do
+ export SYSSRC=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ pushd _kmod_build_$kvariant/kernel
+ %{__make} module
+ popd
+done
+
+%install
+%{__rm} -rf %{buildroot}
+export INSTALL_MOD_PATH=%{buildroot}
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+for kvariant in %{kvariants} ; do
+ pushd _kmod_build_$kvariant/kernel
+ ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu}
+ %{__make} -C "${ksrc}" modules_install M=$PWD
+ popd
+done
+%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
+%{__install} -p -m 0644 kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%changelog
+* Fri Jul 22 2011 Philip J Perry <phil@elrepo.org> - 275.21-1.el5.elrepo
+- Updated to version 275.21
+
+* Fri Jul 15 2011 Philip J Perry <phil@elrepo.org> - 275.19-1.el5.elrepo
+- Updated to version 275.19
+
+* Fri Jun 17 2011 Philip J Perry <phil@elrepo.org> - 275.09.07-1.el5.elrepo
+- Updated to version 275.09.07
+
+* Sat Apr 16 2011 Philip J Perry <phil@elrepo.org> - 270.41.03-1.el5.elrepo
+- Updated to version 270.41.03
+
+* Fri Mar 25 2011 Philip J Perry <phil@elrepo.org>
+- Updated to version 270.30 beta
+
+* Fri Jan 21 2011 Philip J Perry <phil@elrepo.org> - 260.19.36-1.el5.elrepo
+- Updated to version 260.19.36
+
+* Thu Dec 16 2010 Philip J Perry <phil@elrepo.org> - 260.19.29-1.el5.elrepo
+- Updated to version 260.19.29
+
+* Wed Nov 10 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-1.el5.elrepo
+- Updated to version 260.19.21
+
+* Fri Oct 15 2010 Philip J Perry <phil@elrepo.org> - 260.19.12-1.el5.elrepo
+- Updated to version 260.19.12
+
+* Fri Sep 10 2010 Philip J Perry <phil@elrepo.org> - 260.19.04-1.el5.elrepo
+- Updated to version 260.19.04
+
+* Tue Aug 31 2010 Philip J Perry <phil@elrepo.org> - 256.53-1.el5.elrepo
+- Updated to version 256.53
+
+* Sat Jul 30 2010 Philip J Perry <phil@elrepo.org> - 256.44-1.el5.elrepo
+- Updated to version 256.44
+- Added Conflicts for module-init-tools-3.3-0.pre3.1.60.el5 [BugID 0000064]
+- Reverted earlier patch to kmodtool for update bug [BugID 0000064]
+
+* Sat Jun 19 2010 Philip J Perry <phil@elrepo.org> - 256.35-1.el5.elrepo
+- Updated to version 256.35
+
+* Sat Jun 12 2010 Philip J Perry <phil@elrepo.org> - 195.36.31-1.el5.elrepo
+- Updated to version 195.36.31.
+- Patch kmodtool for update bug [BugID 0000064]
+- Please see: http://elrepo.org/tiki/Update
+
+* Fri Apr 23 2010 Philip J Perry <phil@elrepo.org> - 195.36.24-1.el5.elrepo
+- Updated to version 195.36.24.
+- Hard code kversion = 2.6.18-164.el5.
+- Update kmodtool to latest version.
+
+* Sat Mar 20 2010 Philip J Perry <phil@elrepo.org> - 195.36.15-1.el5.elrepo
+- Updated to version 195.36.15.
+
+* Sun Feb 21 2010 Philip J Perry <phil@elrepo.org> - 190.53-1.el5.elrepo
+- Updated to version 190.53.
+- Updated kmodtool to latest version.
+
+* Sun Nov 01 2009 Philip J Perry <phil@elrepo.org> - 190.42-1.el5.elrepo
+- Updated to version 190.42.
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-2.el5.elrepo
+- kernel-modules in kmodtool changed to kabi-modules
+
+* Sat Sep 12 2009 Akemi Yagi <toracat@elrepo.org> - 185.18.36-1.el5.elrepo
+- Update to version 185.18.36.
+
+* Mon Aug 17 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-2.el5.elrepo
+- Added Provides: kabi-modules as kABI looks stable for RHEL5.4.
+
+* Mon Aug 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.31-1.el5.elrepo
+- Update to version 185.18.31.
+- Drop bundling the source here too, it's included in nvidia-x11-drv.
+
+* Fri Jul 10 2009 Philip J Perry <phil@elrepo.org> - 185.18.14-1.el5.elrepo
+- Rebuilt against kernel-2.6.18-128.el5 for release.
+- Updated kmodtool to latest specification.
+- Create nvidia.conf in spec file.
+
+* Tue Jul 07 2009 Philip J Perry <phil@elrepo.org>
+- Updated sources to match nvidia-x11-drv.
+- Fixed paths to extract sources.
+- Don't strip the module (NVIDIA doesn't).
+
+* Wed Jun 10 2009 Alan Bartlett <ajb@elrepo.org>
+- Updated the package to 185.18.14 version.
+
+* Thu May 21 2009 Dag Wieers <dag@wieers.com>
+- Adjusted the package name.
+
+* Tue May 19 2009 Alan Bartlett <ajb@elrepo.org>
+- Total revision and re-build of the kmod packages.
+
+* Thu May 14 2009 Alan Bartlett <ajb@elrepo.org>
+- Initial build of the kmod packages.
View
283 nvidia-kmod/el6/kmodtool-nvidia-el6.sh
@@ -0,0 +1,283 @@
+#!/bin/bash
+
+# kmodtool - Helper script for building kernel module RPMs
+# An original version appeared in Fedora. This version is
+# generally called only by the %kernel_module_package RPM macro
+# during the process of building Driver Update Packages (which
+# are also known as "kmods" in the Fedora community).
+#
+# Copyright (c) 2003-2010 Ville Skyttä <ville.skytta@iki.fi>,
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# Changelog:
+#
+# 2010/07/28 - Add fixes for filelists in line with LF standard
+# - Remove now defunct "framepointer" kernel variant
+# - Change version to "rhel6-rh2" as a consequence.
+#
+# 2010/01/10 - Simplified for RHEL6. We are working on upstream
+# moving to a newer format and in any case do not
+# need to retain support for really old systems.
+
+shopt -s extglob
+
+myprog="kmodtool"
+myver="rhel6-rh2"
+knownvariants=@(debug|kdump)
+kmod_name=
+kver=
+verrel=
+variant=
+
+get_verrel ()
+{
+ verrel=${1:-$(uname -r)}
+ verrel=${verrel%%$knownvariants}
+}
+
+print_verrel ()
+{
+ get_verrel $@
+ echo "${verrel}"
+}
+
+get_variant ()
+{
+ get_verrel $@
+ variant=${1:-$(uname -r)}
+ variant=${variant##$verrel}
+ variant=${variant:-'""'}
+}
+
+print_variant ()
+{
+ get_variant $@
+ echo "${variant}"
+}
+
+get_filelist() {
+ local IFS=$'\n'
+ filelist=($(cat))
+
+ if [ ${#filelist[@]} -gt 0 ];
+ then
+ for ((n = 0; n < ${#filelist[@]}; n++));
+ do
+ line="${filelist[n]}"
+ line=$(echo "$line" \
+ | sed -e "s/%verrel/$verrel/g" \
+ | sed -e "s/%variant/$variant/g" \
+ | sed -e "s/%dashvariant/$dashvariant/g" \
+ | sed -e "s/%dotvariant/$dotvariant/g" \
+ | sed -e "s/\.%1/$dotvariant/g" \
+ | sed -e "s/\-%1/$dotvariant/g" \
+ | sed -e "s/%2/$verrel/g")
+ echo "$line"
+ done
+ else
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}"
+ fi
+}
+
+get_rpmtemplate ()
+{
+ local variant="${1}"
+ local dashvariant="${variant:+-${variant}}"
+ local dotvariant="${variant:+.${variant}}"
+
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
+
+ if [ -z "$kmod_provides_summary" ]; then
+ echo "Summary: ${kmod_name} kernel module(s)"
+ fi
+
+ if [ -z "$kmod_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
+ fi
+
+ if [ ! -z "$kmod_version" ]; then
+ echo "Version: %{kmod_version}"
+ fi
+
+ if [ ! -z "$kmod_release" ]; then
+ echo "Release: %{kmod_release}"
+ fi
+
+ # Turn off the internal dep generator so we will use the kmod scripts.
+ echo "%global _use_internal_dependency_generator 0"
+
+ cat <<EOF
+Provides: kabi-modules = ${verrel}${dotvariant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: ${kmod_name}-x11-drv = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
+Requires(postun): /sbin/depmod
+EOF
+
+ if [ "no" != "$nobuildreqs" ]
+ then
+ echo "BuildRequires: kernel${dashvariant}-devel"
+ fi
+
+ if [ "" != "$override_preamble" ]
+ then
+ cat "$override_preamble"
+ fi
+
+cat <<EOF
+%description -n kmod-${kmod_name}${dashvariant}
+This package provides the ${kmod_name} kernel module(s) built
+for the Linux kernel using the %{_target_cpu} family of processors.
+EOF
+
+##############################################################################
+## The following are not part of this script directly, they are scripts ##
+## that will be executed by RPM during various stages of package processing ##
+##############################################################################
+
+cat <<EOF
+%post -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') )
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+fi
+echo "Done."
+EOF
+
+cat <<EOF
+%preun -n kmod-${kmod_name}${dashvariant}
+rpm -ql kmod-${kmod_name}${dashvariant}-%{version}-%{release}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+EOF
+
+cat <<EOF
+%postun -n kmod-${kmod_name}${dashvariant}
+echo "Working. This may take some time ..."
+if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+fi
+modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
+rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
+if [ -x "/sbin/weak-modules" ]; then
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+fi
+echo "Done."
+EOF
+
+echo "%files -n kmod-${kmod_name}${dashvariant}"
+if [ "" == "$override_filelist" ];
+then
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}/"
+ echo "%config /etc/depmod.d/kmod-${kmod_name}.conf"
+else
+ cat "$override_filelist" | get_filelist
+fi
+}
+
+print_rpmtemplate ()
+{
+ kmod_name="${1}"
+ shift
+ kver="${1}"
+ get_verrel "${1}"
+ shift
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
+ exit 2
+ elif [ -z "${kver}" ] ; then
+ echo "Please provide the kver as second parameter." >&2
+ exit 2
+ elif [ -z "${verrel}" ] ; then
+ echo "Couldn't find out the verrel." >&2
+ exit 2
+ fi
+
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
+ then
+ get_rpmtemplate ""
+ else
+ get_rpmtemplate "${variant}"
+ fi
+ done
+}
+
+usage ()
+{
+ cat <<EOF
+You called: ${invocation}
+
+Usage: ${myprog} <command> <option>+
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ version
+ - Output version number and exit.
+EOF
+}
+
+invocation="$(basename ${0}) $@"
+while [ "${1}" ] ; do
+ case "${1}" in
+ verrel)
+ shift
+ print_verrel $@
+ exit $?
+ ;;
+ variant)
+ shift
+ print_variant $@
+ exit $?
+ ;;
+ rpmtemplate)
+ shift
+ print_rpmtemplate "$@"
+ exit $?
+ ;;
+ version)
+ echo "${myprog} ${myver}"
+ exit 0
+ ;;
+ *)
+ echo "Error: Unknown option '${1}'." >&2
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+
+# Local variables:
+# mode: sh
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# End:
+# ex: ts=2 sw=2 et
View
115 nvidia-kmod/el6/nvidia-kmod.spec
@@ -0,0 +1,115 @@
+# Define the kmod package name here.
+%define kmod_name nvidia
+
+# If kversion isn't defined on the rpmbuild line, define it here.
+%{!?kversion: %define kversion 2.6.32-71.el6.%{_target_cpu}}
+
+Name: %{kmod_name}-kmod
+Version: 275.21
+Release: 1%{?dist}
+Group: System Environment/Kernel
+License: Proprietary
+Summary: NVIDIA OpenGL kernel driver module
+URL: http://www.nvidia.com/
+
+BuildRequires: redhat-rpm-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
+ExclusiveArch: i686 x86_64
+
+# Sources.
+Source0: ftp://download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}.run
+Source1: ftp://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run
+Source10: kmodtool-%{kmod_name}-el6.sh
+
+NoSource: 0
+NoSource: 1
+
+# Magic hidden here.
+%define kmodtool sh %{SOURCE10}
+%{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kversion} "" 2>/dev/null)}
+
+# Disable building of the debug package(s).
+%define debug_package %{nil}
+
+%description
+This package provides the proprietary NVIDIA OpenGL kernel driver module.
+It is built to depend upon the specific ABI provided by a range of releases
+of the same variant of the Linux kernel and not on any one specific build.
+
+%prep
+%setup -q -c -T
+echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
+
+%ifarch i686
+sh %{SOURCE0} --extract-only --target nvidiapkg
+%endif
+
+%ifarch x86_64
+sh %{SOURCE1} --extract-only --target nvidiapkg
+%endif
+
+%{__cp} -a nvidiapkg _kmod_build_
+
+%build
+export SYSSRC=%{_usrsrc}/kernels/%{kversion}
+pushd _kmod_build_/kernel
+%{__make} module
+popd
+
+%install
+export INSTALL_MOD_PATH=%{buildroot}
+export INSTALL_MOD_DIR=extra/%{kmod_name}
+pushd _kmod_build_/kernel
+ksrc=%{_usrsrc}/kernels/%{kversion}
+%{__make} -C "${ksrc}" modules_install M=$PWD
+popd
+%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
+%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+# Remove the unrequired files.
+%{__rm} -f %{buildroot}/lib/modules/%{kversion}/modules.*
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%changelog
+* Fri Jul 22 2011 Philip J Perry <phil@elrepo.org> - 275.21-1.el6.elrepo
+- Updated to version 275.21
+
+* Fri Jul 15 2011 Philip J Perry <phil@elrepo.org> - 275.19-1.el6.elrepo
+- Updated to version 275.19
+
+* Fri Jun 17 2011 Philip J Perry <phil@elrepo.org> - 275.09.07-1.el6.elrepo
+- Updated to version 275.09.07
+
+* Sat Apr 16 2011 Philip J Perry <phil@elrepo.org> - 270.41.03-1.el6.elrepo
+- Updated to version 270.41.03 for release
+
+* Fri Mar 25 2011 Philip J Perry <phil@elrepo.org>
+- Updated to version 270.30 beta
+
+* Wed Mar 09 2011 Philip J Perry <phil@elrepo.org> - 260.19.44-1.el6.elrepo
+- Updated to version 260.19.44
+
+* Fri Jan 21 2011 Philip J Perry <phil@elrepo.org> - 260.19.36-1.el6.elrepo
+- Updated to version 260.19.36
+
+* Fri Dec 17 2010 Philip J Perry <phil@elrepo.org> - 260.19.29-1.el6.elrepo
+- Updated to version 260.19.29
+
+* Sun Nov 28 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-1.el6.elrepo
+- Rebuilt for release.
+
+* Sun Nov 28 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-0.4.el6.elrepo
+- Rebuilt for testing release.
+
+* Sun Nov 21 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-0.3.el6.elrepo
+- Rebuilt for testing release.
+
+* Sun Nov 21 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-0.2.el6.elrepo
+- Fix udev device creation.
+
+* Sat Nov 20 2010 Philip J Perry <phil@elrepo.org> - 260.19.21-0.1.el6.elrepo
+- Initial build of the kmod package for RHEL6 GA release.
+
+* Fri Apr 30 2010 Philip J Perry <phil@elrepo.org> - - 195.36.24-0.1.el6.elrepo
+- Initial build for RHEL6beta1
View
154 nvidia-x11-drv-173xx/el5/nvidia-config-display
@@ -0,0 +1,154 @@
+#!/usr/bin/python
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright 2003, 2004 Peter Backlund
+
+import ixf86config
+import string
+import os
+import sys
+
+if os.uname()[4] == "x86_64" :
+ TOP_MOD_DIR = "/usr/lib64/xorg/modules"
+else:
+ TOP_MOD_DIR = "/usr/lib/xorg/modules"
+
+# This will add an entry to ModulePath section,
+# with previous entries untouched.
+def addModulePath(files, newPathEntry):
+ prevModPath = []
+ # Check for existing ModulePath
+ if (files.module != None):
+ prevModPath = string.split(files.module, ",")
+ # First, add the default module dirs. We add the dirs in <