nvidia-cg-toolkit/nvidia-cg-toolkit.spec

152 lines
5.4 KiB
RPMSpec
Raw Normal View History

%define majver %(echo %{version} | cut -d_ -f 1)
#%define minversion %(echo %{version} | cut -d. -f 3-)
Name: nvidia-cg-toolkit
Version: 3.1_April2012
Release: 1mamba
Summary: NVIDIA Cg Toolkit
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://developer.nvidia.com/object/cg_toolkit.html
Source0: http://developer.download.nvidia.com/cg/Cg_%{majver}/Cg-%{version}_x86.tgz
Source1: http://developer.download.nvidia.com/cg/Cg_%{majver}/Cg-%{version}_x86_64.tgz
License: Redistributable, no modification permitted
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libGL-devel
BuildRequires: libGLU-devel
BuildRequires: libGLUT-devel
BuildRequires: libX11-devel
BuildRequires: libXi-devel
BuildRequires: libXmu-devel
#ld-linux.so.2: .so link not found
## AUTOBUILDREQ-END
#BuildRequires: libfreeglut-devel
BuildRequires: fdupes
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The NVIDIA Cg Toolkit provides a compiler for the Cg language, runtime libraries for use with both leading graphics APIs, runtime libraries for CgFX, example applications, and extensive documentation. Supporting over 20 different OpenGL and DirectX profile targets, Cg will allow you to incorporate stunning interactive effects into your 3D applications.
The runtime package contains the compiler and runtime libraries only.
%package devel
Group: Development/Libraries
Summary: Development documentation and examples for the Cg graphics language
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: libCg-devel
Provides: libCg-devel
Obsoletes: libCg-docs
Obsoletes: libCg-docs
%description devel
The NVIDIA Cg Toolkit provides a compiler for the Cg language, runtime libraries for use with both leading graphics APIs, runtime libraries for CgFX, example applications, and extensive documentation. Supporting over 20 different OpenGL and DirectX profile targets, Cg will allow you to incorporate stunning interactive effects into your 3D applications.
The development package contains the complete documentation and example files. The Cg compiler is part of the runtime package, as some external application may need it.
%prep
%setup -q -c %{name}-%{version} -D -T
%ifarch x86_64
tar -xf %{SOURCE1}
%else
tar -xf %{SOURCE0}
%endif
%build
#cp -a usr/local/Cg/examples/Tools/cgfxcat cgfxcat
#cd cgfxcat
#make CFLAGS="$RPM_OPT_FLAGS -I..%{_includedir} -I../usr/local/Cg/examples/OpenGL/glew/include -L..%{_libdir}"
#cd -
cp cgfxcat/cgfxcat .%{_bindir}
#cp -a usr/local/Cg/examples/Tools/cginfo cginfo
#cd cginfo
#ake CFLAGS="$RPM_OPT_FLAGS -I..%{_includedir} -I../usr/local/Cg/examples/OpenGL/glew/include -L..%{_libdir}"
#cd -
#cp cgfxcat/cgfxcat usr/local/Cg/examples/Tools/cginfo
#cp cginfo/cginfo .%{_bindir}
#cp -a usr/local/Cg/examples/Tools/trace trace
#cd trace
#rm -rf libglut.so
#rm -rf libCgGL.so
#rm -rf trace/libCg.so
#rm -rf libtrace.so
#ln -sf %{_libdir}/libglut.so .
#ake CFLAGS="$RPM_OPT_FLAGS -I..%{_includedir} -I../usr/local/Cg/examples/OpenGL/glew/include -L..%{_libdir}"
#cd -
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_prefix}
mkdir -p %{buildroot}%{_defaultdocdir}/cg/docs
cp -a .%{_bindir} .%{_libdir} .%{_includedir} %{buildroot}%{_prefix}
cp -a usr/local/Cg/. %{buildroot}%{_defaultdocdir}/cg/
mkdir -p %{buildroot}%{_libdir}/cg
# Commented as a workaround for ELF files linked against libGLU.so, without versioning. Remove once nvidia fixes it
# mv %{buildroot}%{_defaultdocdir}/cg/examples %{buildroot}%{_libdir}/cg/
rm -R %{buildroot}%{_defaultdocdir}/cg/examples
rm -rf %{buildroot}%{_defaultdocdir}/cg/include/GL/glext.h
rm %{buildroot}%{_defaultdocdir}/cg/docs/CgReferenceManual.chm
rm -rf %{buildroot}%{_defaultdocdir}/cg/include/GL %{buildroot}%{_defaultdocdir}/cg/include
sed -i "s@/usr/local/Cg@%{_defaultdocdir}/cg@g" %{buildroot}%{_defaultdocdir}/cg/README
sed -i "s@/usr/local/Cg@%{_defaultdocdir}/cg@g" %{buildroot}%{_defaultdocdir}/cg/MANIFEST
%fdupes %{buildroot}%{_libdir}/cg/examples
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/cgc
%{_bindir}/cgfxcat
%{_bindir}/cginfo
%{_libdir}/libCg.so
%{_libdir}/libCgGL.so
%dir %{_defaultdocdir}/cg/docs
%{_defaultdocdir}/cg/docs/license.*
#%{_mandir}/man1/cg*.1.gz
%files devel
%defattr(-,root,root)
%dir %{_includedir}/Cg
%{_includedir}/Cg/*.h
%{_libdir}/cg
#%dir %{_mandir}/manCg
#%{_mandir}/manCg/*.Cg.gz
#%dir %{_mandir}/manCgFX
#%{_mandir}/manCgFX/*.CgFX.gz
#%{_mandir}/man3/*.3.gz
%{_defaultdocdir}/cg/docs/CgFX_bumpdemo_Tutorial.pdf
%{_defaultdocdir}/cg/docs/CgReferenceManual.pdf
%{_defaultdocdir}/cg/docs/CgReleaseNotes.pdf
%{_defaultdocdir}/cg/docs/Cg_bumpdemo_Tutorial.pdf
%{_defaultdocdir}/cg/docs/html
%{_defaultdocdir}/cg/README
%{_defaultdocdir}/cg/MANIFEST
%{_defaultdocdir}/cg/docs/Cg-?.?.pdf
%{_defaultdocdir}/cg/docs/CgUsersManual.pdf
%dir %{_defaultdocdir}/cg
%changelog
* Tue May 21 2013 Automatic Build System <autodist@mambasoft.it> 3.1_April2012-1mamba
- update to 3.1_April2012
* Mon Jan 03 2011 gil <puntogil@libero.it> 3.0-2mamba
- rebuilt devel
* Thu Sep 02 2010 gil <puntogil@libero.it> 3.0-1mamba
- update to 3.0
- renamed nvidia-cg-toolkit
* Sun Sep 21 2008 gil <puntogil@libero.it> 2.0.0015-1mamba
- package created by autospec