# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils MY_PV="10.1.5629.3" RALUS_Q_ID="Q180968" RALUS_DOC_ID="279329" RALUS_FILE="${RALUS_Q_ID}.BE.RALUS.${MY_PV}.tar_${RALUS_DOC_ID}.gz" RALUS_FETCH_URI="http://seer.support.veritas.com/docs/${RALUS_DOC_ID}.htm" PATCH_DOC_ID="282308" PATCH_FILE="ralus5629HF21_${PATCH_DOC_ID}.zip" PATCH_FETCH_URI="http://seer.support.veritas.com/docs/${PATCH_DOC_ID}.htm" VRTSRALUS_FILE="VRTSralus-10.00.5629-0.i386.rpm" VRTSVXMSA_FILE="VRTSvxmsa-4.2.1-211.i386.rpm" LINUX_PATCH_FILE="ralus5629HF21-Linux.tar" LINUX_HOTFIX_FILE="HF21-Linux.tar" DESCRIPTION="Symantec Backup Exec - Remote Agent for Linux or Unix Servers" HOMEPAGE="http://www.veritas.com/" SRC_URI="${RALUS_FILE} ${PATCH_FILE}" LICENSE="VERITAS-EUSLA" SLOT="0" KEYWORDS="~x86" IUSE="" RESTRICT="fetch" DEPEND=">=app-arch/rpm-4.2 >=app-arch/unzip-5.52" RDEPEND=">=sys-libs/lib-compat-1.4" S="${WORKDIR}" pkg_nofetch() { einfo "Please download ${RALUS_FILE} from:" einfo "${RALUS_FETCH_URI}" einfo "and move it to ${DISTDIR}" einfo "" einfo "Please download ${PATCH_FILE} from:" einfo "${PATCH_FETCH_URI}" einfo "and move it to ${DISTDIR}" } src_unpack() { # unpack the package for i in ${VRTSRALUS_FILE} ${VRTSVXMSA_FILE} do einfo "Extracting: ${i}" tar -xzOf "${DISTDIR}/${RALUS_FILE}" "linux/pkgs/linux/${i}" \ | rpm2cpio - | cpio --extract --make-directories --unconditional --quiet \ || die "Extracting ${i} failed" done # unpack the hotfix einfo "Extracting: ${LINUX_HOTFIX_FILE}" unzip -pqq "${DISTDIR}/${PATCH_FILE}" "${LINUX_PATCH_FILE}" | tar -xO "${LINUX_HOTFIX_FILE}" | tar -x \ || die "Extracting ${LINUX_HOTFIX_FILE} failed" # merge the hotfix files mv -f "${S}/beremote" "${S}/opt/VRTSralus/bin" mv -f "${S}/libndmpcomm.so" "${S}/opt/VRTSralus/bin" mv -f "${S}/ralus.ver" "${S}/var/VRTSralus" # delete the original init script rm -f "${S}/opt/VRTSralus/bin/VRTSralus.init" } src_install() { # install the package files to /etc dodir /etc/VRTSralus chmod -R 600 "${S}/etc" cp -aR "${S}/etc/VRTSralus" "${D}/etc" || die "Install failed" # install the package files to /opt dodir /opt/VRTS dodir /opt/VRTSralus dodir /opt/VRTSvxms chmod -R 500 "${S}/opt" cp -aR "${S}/opt/VRTS" "${D}/opt" || die "Install failed" cp -aR "${S}/opt/VRTSralus" "${D}/opt" || die "Install failed" cp -aR "${S}/opt/VRTSvxms" "${D}/opt" || die "Install failed" # install the package files to /var dodir /var/VRTSralus chmod -R 600 "${S}/var" cp -aR "${S}/var/VRTSralus" "${D}/var" || die "Install failed" # install the init.d file newinitd "${FILESDIR}/backupexec-ralus.initd" backupexec-ralus # install the conf.d file newconfd "${FILESDIR}/backupexec-ralus.confd" backupexec-ralus } pkg_preinst() { # add the beoper group enewgroup beoper } pkg_postinst() { einfo "" einfo "You must add a user to the beoper group for the remote agent to function." einfo "The user must have permission to access the files that you wish to backup." einfo "gpasswd -a beoper" einfo "" einfo "By default the remote agent will use port 10000. If this port is already in use," einfo "edit /etc/services and add the ndmp service with a more suitable port." einfo "ndmp /tcp" einfo "" einfo "You must configure /etc/VRTSralus/ralus.cfg before starting the remote agent." einfo "Refer to the Backup Exec Administrator's Guide for configuration options." einfo ${RALUS_FETCH_URI} einfo "" einfo "To start the remote agent, run:" einfo "/etc/init.d/backupexec-ralus start" einfo "" einfo "To have the remote agent start at boot, run:" einfo "rc-update add backupexec-ralus default" einfo "" }