# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit versionator DESCRIPTION="Tivoli Storage Manager (TSM) Backup/Archive (B/A) Client and API" HOMEPAGE="http://www.tivoli.com/" MY_PV_NODOTS=$(delete_all_version_separators) MY_PV_MAJOR=$(get_major_version) MY_PV_MINOR=$(get_version_component_range 2) MY_PVR_ALLDOTS=$(replace_all_version_separators . ${PVR//r/}) BASE_URI="ftp://ftp.software.ibm.com/storage/tivoli-storage-management/patches/client/v${MY_PV_MAJOR}r${MY_PV_MINOR}/Linux/LinuxX86/v${MY_PV_NODOTS}/" SRC_TAR="${MY_PVR_ALLDOTS}-TIV-TSMBAC-LinuxX86.tar" SRC_URI="${BASE_URI}${SRC_TAR}" RESTRICT="strip binchecks" # Breaks libPiIMG.ss and libPiSNAP.so LICENSE="as-is Apache-1.1 JDOM gSOAP" SLOT="0" # There should only be one version installed at any give time. KEYWORDS="x86 ~amd64" IUSE="hsm" DEPEND="sys-libs/lib-compat app-arch/rpm" RDEPEND="sys-libs/lib-compat" # Doesn't need rpm once it's installed S="${WORKDIR}" # Different than the default of ${WORKDIR}/${P} src_unpack() { unpack ${A} #Avoid "is setXid, dynamically linked and using lazy bindings" QA notices # (doesn't help, since they are binaries?) RPMS=("TIVsm-BA.i386.rpm" "TIVsm-API.i386.rpm") if use amd64 ; then RPMS=("${RPMS[@]}" "TIVsm-API64.i386.rpm") fi if use hsm ; then RPMS=("${RPMS[@]}" "TIVsm-HSM.i386.rpm") fi for rpm in ${RPMS[@]} do einfo "Extracting: ${rpm}" rpm2cpio ${rpm} | cpio --extract --make-directories --unconditional done } src_install() { cp -a opt ${D} cp -a usr ${D} chmod -R go+rX ${D}/opt/tivoli # Allow all users to access TSM tools dodir /etc/tivoli keepdir /etc/tivoli cp -a ${S}/opt/tivoli/tsm/client/ba/bin/dsm.sys.smp ${D}/etc/tivoli/dsm.sys echo ' PasswordDir "/etc/tivoli/"' >> ${D}/etc/tivoli/dsm.sys echo ' PasswordAccess generate' >> ${D}/etc/tivoli/dsm.sys # Added the hostname to be more friendly, the admin will need to edit this file anyway echo ' NodeName' `hostname` >> ${D}/etc/tivoli/dsm.sys echo ' ErrorLogName "/var/log/dsmerror.log"' >> ${D}/etc/tivoli/dsm.sys echo ' SchedLogName "/var/log/dsmsched.log"' >> ${D}/etc/tivoli/dsm.sys dosym ../../../../../../etc/tivoli/dsm.sys /opt/tivoli/tsm/client/ba/bin/dsm.sys cp -a ${S}/opt/tivoli/tsm/client/ba/bin/dsm.opt.smp ${D}/etc/tivoli/dsm.opt dosym ../../../../../../etc/tivoli/dsm.opt /opt/tivoli/tsm/client/ba/bin/dsm.opt # This creates the symlinks for the API libs dodir /usr/lib dosym ../../opt/tivoli/tsm/client/api/bin/libct_cu.so /usr/lib/libct_cu.so dosym ../../opt/tivoli/tsm/client/api/bin/libdmapi.so /usr/lib/libdmapi.so dosym ../../opt/tivoli/tsm/client/api/bin/libgpfs.so /usr/lib/libgpfs.so dosym ../../opt/tivoli/tsm/client/api/bin/libha_gs_r.so /usr/lib/libha_gs_r.so dosym ../../opt/tivoli/tsm/client/api/bin/libApiDS.so /usr/lib/libApiDS.so # Fix the client's inability to find dsmclientV3.cat dosym ../../lang/en_US /opt/tivoli/tsm/client/ba/bin/en_US # Setup the env dodir /etc/env.d ENV_FILE="${D}/etc/env.d/80tivoli" echo 'DSM_CONFIG="/etc/tivoli/dsm.opt"' >> ${ENV_FILE} echo 'DSM_DIR="/opt/tivoli/tsm/client/ba/bin"' >> ${ENV_FILE} echo 'DSM_LOG="/var/log"' >> ${ENV_FILE} echo 'PATH="/opt/tivoli/tsm/client/admin/bin:/opt/tivoli/tsm/client/ba/bin"' >> ${ENV_FILE} echo 'ROOTPATH="/opt/tivoli/tsm/client/admin/bin:/opt/tivoli/tsm/client/ba/bin"' >> ${ENV_FILE} insinto /etc/conf.d && newins ${FILESDIR}/dsmc.conf.d dsmc exeinto /etc/init.d && newexe ${FILESDIR}/dsmc.init.d dsmc }