# 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/v5/" RESTRICT="fetch" KEYWORDS="~x86 ~amd64" IUSE="famd foundation X" foundationFile="XSIFND-5.0-1-linux.tar.gz" xsiFile="XSI-5.0-1-linux.tar.gz" if use foundation; then At=${foundationFile} Checkfile=xsi501fnd.md5sum ExtractSub="XSIFND-5.0-1-linux" else At=${xsiFile} Checkfile=xsi501full.md5sum ExtractSub="XSI-5.0-1-linux" 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 amd64? ( app-admin/fam ) !amd64? (famd? ( app-admin/fam ) !famd? ( app-admin/gamin ) ) virtual/quicktime 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 sys-apps/linux32 )" 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 if [ ! -f "${XSI_INSTALL_SRC}/${At}" ]; then if use foundation; then Checkfile=xsi501fndcd.md5sum else Checkfile=xsi501cd.md5sum fi USING_CD=true 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. Or your XSI_INSTALL_SRC incorrect" fi if [ -z "${USING_CD}" ]; then einfo "extracting from ${At}" tar -xvzf ${XSI_INSTALL_SRC}/${At} -C ${WORKDIR} fi } src_install() { if [ -z "${XSI_INSTALL_LOC}" ]; then XSI_INSTALL_LOC="/opt/Softimage" fi XSI_SANDBOX_INSTALL_LOC="${D}${XSI_INSTALL_LOC}/XSI_5.0" mkdir -p ${XSI_SANDBOX_INSTALL_LOC} if [ -z "${USING_CD}" ]; then cd ${WORKDIR}/${ExtractSub} else cd ${XSI_INSTALL_SRC} fi einfo "Installing 1/39 Components" tar -xjpf Core-devel.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 2/39 Components" tar -xjpf FTK-bin.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 3/39 Components" tar -xjpf FTK-devel-headers.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 4/39 Components" tar -xjpf FTK-devel.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 5/39 Components" tar -xjpf RayflexCOM.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 6/39 Components" tar -xjpf RayflexDlls.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 7/39 Components" tar -xjpf SicoreCOM.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 8/39 Components" tar -xjpf SicoreDlls.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 9/39 Components" tar -xjpf XSIDoc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 10/39 Components" tar -xjpf addons.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 11/39 Components" tar -xjpf compiler.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 12/39 Components" tar -xjpf fonts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 13/39 Components" tar -xjpf keymaps.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 14/39 Components" tar -xjpf layouts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 15/39 Components" tar -xjpf localization.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 16/39 Components" tar -xjpf mentaldoc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 17/39 Components" tar -xjpf mw.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 18/39 Components" tar -xjpf net.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 19/39 Components" tar -xjpf outfmt.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 20/39 Components" tar -xjpf phenolib.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 21/39 Components" tar -xjpf presets.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 22/39 Components" tar -xjpf python.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 23/39 Components" tar -xjpf queries.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 24/39 Components" tar -xjpf rayrc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 25/39 Components" tar -xjpf rayserv.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 26/39 Components" tar -xjpf rendhlp.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 27/39 Components" tar -xjpf rsrc.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 28/39 Components" tar -xjpf scripts.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 29/39 Components" tar -xjpf shaleg.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 30/39 Components" tar -xjpf siccmdmp.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 31/39 Components" tar -xjpf sil.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 32/39 Components" tar -xjpf spdl.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 33/39 Components" tar -xjpf sumbin.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 34/39 Components" if ! use foundation; then tar -xjpf syflex.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} fi einfo "Installing 35/39 Components" tar -xjpf xsi_samples.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 36/39 Components" tar -xjpf xsiguides.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 37/39 Components" tar -xjpf xsiplugins.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 38/39 Components" tar -xjpf xsisdk.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Installing 39/39 Components" tar -xjpf xsisdkex.tar.bz2 -C ${XSI_SANDBOX_INSTALL_LOC} einfo "Setting Permissions" chmod -R o-w ${XSI_SANDBOX_INSTALL_LOC}/Application/Help chmod o-w ${XSI_SANDBOX_INSTALL_LOC}/Doc/XSISDK/xsisdk.chw chown -R :users ${XSI_SANDBOX_INSTALL_LOC} einfo "Configuring XSI Installation" #create initial .xsi_5.0 config cp ${FILESDIR}/.xsi_5.0 ${XSI_SANDBOX_INSTALL_LOC} dosed "/^setenv SI_HOME/s:.*:setenv SI_HOME \"${XSI_INSTALL_LOC}/XSI_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0 dosed "/^setenv XSI_HOME/s:.*:setenv XSI_HOME \"${XSI_INSTALL_LOC}/XSI_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0 dosed "/^setenv SPM_HOST/s:.*:setenv SPM_HOST \"${XSI_SPM_SERVER}\":" ${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0 #fix the .mwenv script for head -n 1 compatibility dosed "/head -1/s:head -1:head -n 1:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/mainwin/mw/scripts/.mwenv #create initial xsi script cp ${FILESDIR}/xsi ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsi if use amd64 ; then dosed "/^Amd64 Path/s:.*:setenv LD_LIBRARY_PATH \"/usr/lib32\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsi dosed "/^exec/s:exec:linux32:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsi else dosed "/^Amd64 Path/s:.*::" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsi fi #create flip32 file for amd64 architecture if use amd64 ; then cp ${XSI_SANDBOX_INSTALL_LOC}/Application/bin/xsi ${XSI_SANDBOX_INSTALL_LOC}/Application/bin/flip32 dosed "/linux32/s:.*:linux32 \$SI_HOME/Application/bin/flip \$argv:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/flip32 fi #create initial xsibatch script - for essentials/advanced if ! use foundation ; then cp ${FILESDIR}/xsibatch ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsibatch if use amd64 ; then dosed "/^Amd64 Path/s:.*:setenv LD_LIBRARY_PATH \"/usr/lib32\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsibatch dosed "/^exec/s:exec:linux32:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsibatch else dosed "/^Amd64 Path/s:.*::" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsibatch fi fi #create initial ray3.sh cp ${FILESDIR}/ray3.sh ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh dosed "/^exec \/usr\/Softimage/s:.*:exec \"${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/\$XSI_CPU_OPT/ray3 \$argv":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh if use amd64 ; then dosed "/^Amd64 Path/s:.*:setenv LD_LIBRARY_PATH \"/usr/lib32\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh dosed "/^exec/s:exec:linux32:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh else dosed "/^Amd64 Path/s:.*::" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh fi #create initial raysat.sh cp ${FILESDIR}/raysat.sh ${XSI_SANDBOX_INSTALL_LOC}/Application/bin dosed "/^Default Source/s:.*:source \"${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/raysat.sh dosed "/^exec \/usr\/Softimage/s:.*:exec \"${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/\$XSI_CPU_OPT/raysat \$argv":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/raysat.sh if use amd64 ; then dosed "/^exec/s:exec:linux32:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/raysat.sh dosed "/^Amd64 Path/s:.*:setenv LD_LIBRARY_PATH \"/usr/lib32\":" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/raysat.sh else dosed "/^Amd64 Path/s:.*::" ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/raysat.sh fi #create DatabaseSys.rsrc cp ${FILESDIR}/DatabaseSys.rsrc ${XSI_SANDBOX_INSTALL_LOC}/Application/rsrc dosed "/^PATH/s:.*:PATH ${XSI_INSTALL_LOC}/XSI_5.0/Application/phenolib/Shader_Lib:" ${XSI_INSTALL_LOC}/XSI_5.0/Application/rsrc/DatabaseSys.rsrc #create /etc/services entry mkdir ${D}/etc cp /etc/services ${D}/etc if grep -q "mi-raysatxsi5_0" ${D}/etc/services; then dosed "/^mi-raysatxsi5_0/s:.*:mi-raysatxsi5_0 7010/tcp:" /etc/services else echo "mi-raysatxsi5_0 7010/tcp" > ${D}/etc/services fi if grep -q "mi-ray3xsi5_0" ${D}/etc/services; then dosed "/^mi-ray3xsi5_0/s:.*:mi-ray3xsi5_0 7011/tcp:" /etc/services else echo "mi-ray3xsi5_0 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_5.0/Application/bin/ray3.sh:" /etc/xinetd.d/mi-ray3xsi5_0 dosed "/^SERVERARGS/s:.*: server_args = ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh -server:" /etc/xinetd.d/mi-ray3xsi5_0 dosed "/^SERVERLINE/s:.*: server = ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh:" /etc/xinetd.d/mi-raysatxsi5_0 dosed "/^SERVERARGS/s:.*: server_args = ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/ray3.sh -server:" /etc/xinetd.d/mi-raysatxsi5_0 } pkg_postinst() { ebegin "Precompiling python modules" tcsh -c "source ${XSI_INSTALL_LOC}/XSI_5.0/.xsi_5.0 && ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/mwpython ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/lib/python2.3/compileall.py ${XSI_INSTALL_LOC}/XSI_5.0/Application" eend 0 if use famd; then 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 fi ln -sf ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsi /usr/bin if ! use foundation ; then ln -sf ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/xsibatch /usr/bin fi if use amd64; then ln -sf ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/flip32 /usr/bin/flip else ln -sf ${XSI_INSTALL_LOC}/XSI_5.0/Application/bin/flip /usr/bin fi einfo "---------------------------" if ! use foundation ; then einfo "Type xsi, xsibatch or flip" else einfo "Type xsi or flip" fi 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_5.0/Application/bin/ray3.sh" einfo "or emerge again with XSI_SPM_SERVER=\"servername\"" fi fi }