# Tweak to have debuginfo - part 1/2 %if 0%{?fedora} >= 7 %define __debug_install_post %{_builddir}/%{?buildsubdir}/find-debuginfo.sh %{_builddir}/%{?buildsubdir}\ %{nil} %endif Summary: NVIDIA CUDA Toolkit libraries Name: cudatoolkit Version: 2.1 Release: 3%{?dist} License: Redistributable, no modification permitted Group: Development/Languages URL: http://www.nvidia.com/cuda Source0: http://developer.download.nvidia.com/compute/cuda/2_1/toolkit/%{name}_%{version}_linux32_fedora9.run Source1: http://developer.download.nvidia.com/compute/cuda/2_1/toolkit/%{name}_%{version}_linux64_fedora9.run BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %if 0%{?fedora} > 10 ExclusiveArch: i586 x86_64 %else ExclusiveArch: i386 x86_64 %endif Requires: %{name}-libs = %{version}-%{release} Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives Provides: cuda = %{version}-%{release} %description NVIDIA(R)CUDA(TM) is a general purpose parallel computing architecture that leverages the parallel compute engine in NVIDIA graphics processing units (GPUs) to solve many complex computational problems in a fraction of the time required on a CPU. It includes the CUDA Instruction Set Architecture (ISA) and the parallel compute engine in the GPU. To program to the CUDATM architecture, developers can, today, use C, one of the most widely used high-level programming languages, which can then be run at great performance on a CUDATM enabled processor. Other languages will be supported in the future, including FORTRAN and C++. This package contains the libraries and attendant files needed to run programs that make use of CUDA. %package libs Summary: Libraries for %{name} Group: Development/Libraries %description libs This package contains libraries needed for running CUDA based applications. %prep %setup -q -T -c %{name}-%{version} %ifarch %{ix86} bash %{SOURCE0} --tar xf %else bash %{SOURCE1} --tar xf %endif # fix libraries location sed -i 's/lib/%{_lib}-%{name}/g' bin/nvcc.profile # fix utf8 iconv -f ISO88591 -t UTF8 < doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt > doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt.utf8 touch -r doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt.utf8 mv -f doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt.utf8 doc/NVIDIA_CUDA_Programming_Guide_Revision_History.txt # add shebang (although this will be mostly just sourced) echo "#!/bin/bash" > bin/nvcc.profile.new cat bin/nvcc.profile >> bin/nvcc.profile.new touch -r bin/nvcc.profile bin/nvcc.profile.new mv -f bin/nvcc.profile.new bin/nvcc.profile # Tweak to have debuginfo - part 2/2 %if 0%{?fedora} >= 7 cp -p %{_prefix}/lib/rpm/find-debuginfo.sh . sed -i -e 's|strict=true|strict=false|' find-debuginfo.sh %endif %build # Nothing to build echo "Nothing to build" %install rm -rf $RPM_BUILD_ROOT # move to proper locations mkdir -p $RPM_BUILD_ROOT%{_includedir}/cudart mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_libdir} mkdir -p $RPM_BUILD_ROOT%{_mandir} cp -rp include/* $RPM_BUILD_ROOT%{_includedir}/cudart cp -rp lib $RPM_BUILD_ROOT%{_libdir}-%{name}-%{version}-%{_target_cpu} touch $RPM_BUILD_ROOT%{_libdir}-%{name} cp -rp open64/bin/* $RPM_BUILD_ROOT%{_bindir} cp -rp open64/lib/* $RPM_BUILD_ROOT%{_bindir} install -p -d -m 755 $RPM_BUILD_ROOT%{_datadir} cp -rp man/* $RPM_BUILD_ROOT%{_mandir} # fix permissions to enable stripping chmod -R u+w,a+r $RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %post libs %{_sbindir}/update-alternatives --install %{_libdir}-%{name} %{name} %{_libdir}-%{name}-%{version}-%{_target_cpu} 1 /sbin/ldconfig %postun libs if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove %{name} %{_libdir}-%{name}-%{version}-%{_target_cpu} fi /sbin/ldconfig %files %defattr(-,root,root,-) %attr(755,root,root) %{_bindir}/* %doc doc/* man/* %{_includedir}/cudart %{_mandir}/man1/* %{_mandir}/man3/* %files libs %defattr(-,root,root,-) %{_libdir}-%{name}-%{version}-%{_target_cpu}/ %ghost %{_libdir}-%{name}/ %changelog * Fri Apr 17 2009 Milos Jakubicek - 2.1-3 - Added ExclusiveArch for i386/i586 and x86_64 - Full source URL - Versioned provides: cuda - Proper ldconfig call for -libs subpackage - Headers moved into cudart subdirectory - Removed initscript which seems to be not necessary - Using alternatives to enable coexistence of multiple versions due to a versioned dependency on nvidia driver * Sun Apr 13 2009 Milos Jakubicek - 2.1-2 - Added %%{dist} tag - Removed -devel subpackage - Enable multilib by splitting the libraries into a -libs subpackage - Added R: -libs subpackage - Fixed installation on 32bit archs, safe usage of mv/rm/rmmod commands (|| :) - Fixed init script in order to enable uninstallation even if the module is not loaded - Changed RPM group - Proper macro usage - Preserving all timestamps - Enable debuginfo by making it not so strict (not requiring build id) * Sat Mar 21 2009 Milos Jakubicek - 2.1-1 - Initial package based on Mandriva package made by Lev Givon.