# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="Softimage XSI. Commercial 3D Package" HOMEPAGE="http://www.softimage.com/products/xsi/v4/" RESTRICT="fetch" KEYWORDS="~x86 ~amd64" IUSE="foundation X" foundationFile="XSI-4.2-Foundation-linux.tar.gz" xsiFile="XSI-4.2-linux.tar.gz" if use foundation; then At=${foundationFile} Checkfile=xsifnd.md5sum else At=${xsiFile} Checkfile=xsifull.md5sum fi SRC_URI="" DEPEND="sys-apps/sed sys-apps/textutils sys-apps/grep sys-apps/fileutils app-arch/bzip2 app-arch/tar" RDEPEND="sys-libs/glibc app-shells/tcsh media-libs/jpeg sys-libs/ncurses sys-fs/e2fsprogs sys-apps/xinetd app-admin/fam X? ( virtual/opengl x11-base/xorg-x11 ) amd64? ( app-emulation/emul-linux-x86-baselibs app-emulation/emul-linux-x86-glibc app-emulation/emul-linux-x86-xlibs )" pkg_nofetch() { einfo "Please copy ${At} to ${DISTDIR}" einfo "and emerge xsi again" } src_unpack() { if [ -z "${XSI_INSTALL_SRC}" ]; then eerror "No XSI_INSTALL_SRC specified" if use foundation; then eerror "Please re-emerge with XSI_INSTALL_SRC=\"/foobar\" USE=\"foundation\" emerge xsi" else eerror "Please re-emerge with XSI_INSTALL_SRC=\"/foobar\" emerge xsi" fi eerror "with /foobar set to the directory containing ${At}" die "XSI_INSTALL_SRC unspecified" fi if [ ! -d "${XSI_INSTALL_SRC}" ]; then eerror "XSI_INSTALL_SRC is not a valid location" die "XSI_INSTALL_SRC invalid. Please set to directory containing ${At}" fi cd ${XSI_INSTALL_SRC} md5sum -c ${FILESDIR}/${Checkfile} if [ $? -ne 0]; then eend 1 die "XSI Installer md5sum could not be verified. It may be corrupted." fi tar -xvzf ${XSI_INSTALL_SRC}/${At} -C ${WORKDIR} } src_install() { if [ -z "${XSI_INSTALL_LOC}" ]; then XSI_INSTALL_LOC="/usr/Softimage" fi XSI_SANDBOX_INSTALL_LOC="${D}${XSI_INSTALL_LOC}/XSI_4.2" mkdir -p ${XSI_SANDBOX_INSTALL_LOC} cd ${WORKDIR}/XSI-4.2-linux einfo "Installing 1/32 Components" tar -xjpf RayflexCOM.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 2/32 Components" tar -xjpf RayflexDlls.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 3/32 Components" tar -xjpf SicoreCOM.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 4/32 Components" tar -xjpf SicoreDlls.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 5/32 Components" tar -xjpf XSIDoc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 6/32 Components" tar -xjpf addons.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 7/32 Components" tar -xjpf compiler.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 8/32 Components" tar -xjpf fonts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 9/32 Components" tar -xjpf keymaps.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 10/32 Components" tar -xjpf layouts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 11/32 Components" tar -xjpf localization.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 12/32 Components" tar -xjpf mentaldoc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 13/32 Components" tar -xjpf mw.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 14/32 Components" tar -xjpf net.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 15/32 Components" tar -xjpf phenolib.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 16/32 Components" tar -xjpf presets.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 17/32 Components" tar -xjpf python.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 18/32 Components" tar -xjpf queries.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 19/32 Components" tar -xjpf rayrc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 20/32 Components" if ! use foundation; then tar -xjpf rayserv.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} fi einfo "Installing 21/32 Components" tar -xjpf rendhlp.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 22/32 Components" tar -xjpf rsrc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 23/32 Components" tar -xjpf scripts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 24/32 Components" tar -xjpf shaleg.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 25/32 Components" tar -xjpf siccmdmp.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 26/32 Components" tar -xjpf sil.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 27/32 Components" tar -xjpf spdl.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 28/32 Components" tar -xjpf sumbin.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 29/32 Components" if ! use foundation; then tar -xjpf syflex.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} fi einfo "Installing 30/32 Components" tar -xjpf xsi_samples.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 31/32 Components" tar -xjpf xsiplugins.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 32/32 Components" tar -xjpf xsisdk.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Configuring XSI Installation" #create initial .xsi_4.2 config cp ${FILESDIR}/.xsi_4.2 ${XSI_SANDBOX_INSTALL_LOC} dosed "/^setenv SI_HOME/s:.*:setenv SI_HOME \"${XSI_INSTALL_LOC}/XSI_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2 dosed "/^setenv XSI_HOME/s:.*:setenv XSI_HOME \"${XSI_INSTALL_LOC}/XSI_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2 dosed "/^setenv SPM_HOST/s:.*:setenv SPM_HOST \"${XSI_SPM_SERVER}\":" ${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2 #create initial xsi script cp ${FILESDIR}/xsi ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/xsi #create initial xsibatch script cp ${FILESDIR}/xsibatch ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/xsibatch #create initial ray3.sh cp ${FILESDIR}/ray3.sh ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh dosed "/^exec \/usr\/Softimage/s:.*:exec \"${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/\$XSI_CPU_OPT/ray3 \$argv":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh dosed "/^setenv SPM_HOST/s:.*:setenv SPM_HOST \"${XSI_SPM_SERVER}\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh dosed "/^LD_LIBRARY_IF/s:.*:setenv LD_LIBRARY_PATH \"${XSI_INSTALL_LOC}/Application/bin/\$XSI_CPU_OPT\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh dosed "/^LD_LIBRARY_ELSE/s:.*:setenv LD_LIBRARY_PATH \"${XSI_INSTALL_LOC}/Application/bin/\$XSI_CPU_OPT\:\$LD_LIBRARY_PATH\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh #create initial raysat.sh cp ${FILESDIR}/raysat.sh ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2\":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/raysat.sh dosed "/^exec \/usr\/Softimage/s:.*:exec \"${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/\$XSI_CPU_OPT/raysat \$argv":" ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/raysat.sh #create DatabaseSys.rsrc cp ${FILESDIR}/DatabaseSys.rsrc ${XSI_SANDBOX_INSTALL_LOC}/Application/rsrc dosed "/^PATH/s:.*:PATH ${XSI_INSTALL_LOC}/XSI_4.2/Application/phenolib/Shader_Lib:" ${XSI_INSTALL_LOC}/XSI_4.2/Application/rsrc/DatabaseSys.rsrc #create /etc/services entry mkdir ${D}/etc cp /etc/services ${D}/etc if grep -q "mi-raysatxsi4_2" ${D}/etc/services; then dosed "/^mi-raysatxsi4_2/s:.*:mi-raysatxsi4_2 7010/tcp:" /etc/services else echo "mi-raysatxsi4_2 7010/tcp" > ${D}/etc/services fi if grep -q "mi-ray3xsi4_2" ${D}/etc/services; then dosed "/^mi-ray3xsi4_2/s:.*:mi-ray3xsi4_2 7011/tcp:" /etc/services else echo "mi-ray3xsi4_2 7011/tcp" > ${D}/etc/services fi if grep -q "mi-spm" ${D}/etc/services; then dosed "/^mi-spm/s:.*:mi-spm 7050/tcp:" /etc/services else echo "mi-spm 7050/tcp" > ${D}/etc/services fi #create /etc/xinetd.d/mi-ray* files mkdir ${D}/etc/xinetd.d cp ${FILESDIR}/mi-ray* ${D}/etc/xinetd.d dosed "/^SERVERLINE/s:.*: server = ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh:" /etc/xinetd.d/mi-ray3xsi4_2 dosed "/^SERVERARGS/s:.*: server_args = ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh -server:" /etc/xinetd.d/mi-ray3xsi4_2 dosed "/^SERVERLINE/s:.*: server = ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh:" /etc/xinetd.d/mi-raysatxsi4_2 dosed "/^SERVERARGS/s:.*: server_args = ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh -server:" /etc/xinetd.d/mi-raysatxsi4_2 } pkg_postinst() { ebegin "Precompiling python modules" tcsh -c "source ${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2 && ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/mwpython ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/lib/python2.3/compileall.py ${XSI_INSTALL_LOC}/XSI_4.2/Application" eend 0 if ( ! rc-update -s | grep portmap.*boot ); then rc-update add portmap boot fi if ( ! rc-update -s | grep famd.*default ); then rc-update add famd default fi einfo "Portmap" if ( ! /etc/init.d/portmap status | grep started ); then /etc/init.d/portmap start fi einfo "Famd" if ( ! /etc/init.d/famd status | grep started ); then /etc/init.d/famd start fi ln -sf ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/xsi /usr/bin ln -sf ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/xsibatch /usr/bin ln -sf ${XSI_INSTALL_LOC}/XSI_4.2/Application/bin/flip /usr/bin einfo "---------------------------" einfo "Type xsi, xsibatch or flip" einfo "to run those apps" einfo "---------------------------" if use foundation; then einfo "XSI Foundation Installed" if [ ! -z "${XSI_SPM_SERVER}" ]; then einfo "XSI Foundation doesn't require an" einfo "spm server - setting ignored" fi else #add SPM code here einfo "Softimage XSI Installed" if [ -z "${XSI_SPM_SERVER}" ]; then einfo "No SPM Server specified - either edit ${XSI_INSTALL_LOC}/XSI_4.2/.xsi_4.2" einfo "and {$XSI_INSTALL_LOC}/XSI_4.2/Application/bin/ray3.sh" einfo "or emerge again with XSI_SPM_SERVER=\"servername\"" fi fi }