# Distributed under the terms of the GNU General Public License v2 # $Header: MY_P=${P/netbackup/NetBackup} DESCRIPTION="Veritas NetBackup" HOMEPAGE="http://www.symantec.com/business/netbackup" SRC_URI="${MY_P/-/_}_CLIENTS2.tar.gz doc? ( ${MY_P/-/_}_Docs.tar.gz )" DOWNLOAD_URL="https://fileconnect.symantec.com" LICENSE="commercial" SLOT="0" IUSE="" KEYWORDS="-amd64 ~ia64 x86" IUSE="java doc" RESTRICT="fetch strip" #I dont see why we would need the xorg crap DEPEND="sys-libs/lib-compat virtual/libstdc++ sys-apps/xinetd java? ( virtual/jre )" RDEPEND="${DEPEND}" QA_TEXTRELS="usr/openv/*" QA_EXECSTACK="usr/openv/*" pkg_nofetch() { einfo "The following files need to be aquired from ${DOWNLOAD_URL}" einfo "and place the file in ${DISTDIR}" einfo "\t${MY_P/-/_}_CLIENTS2.tar.gz" if use doc ; then einfo "\t${MY_P/-/_}_Docs.tar.gz" fi } src_unpack() { # Extraction dir has a build? date appended to it... # Tested with 20070723 EXTDIR=${WORKDIR}/NB_${PV/./}_CLIENTS2_[0-9]* unpack "${MY_P/-/_}_CLIENTS2.tar.gz" if [ ! -d ${EXTDIR} ] ; then die "Expected extraction directory does not exist." fi if use doc ; then unpack ${MY_P/-/_}_Docs.tar.gz fi if use x86 ; then # Maybe amd64 useing bin 32 libs. cd ${EXTDIR}/NBClients/anb/Clients/usr/openv/netbackup/client/Linux/RedHat2.6 tar xzf "client_bin.tar.Z" -C ${WORKDIR} # Remove unused library. rm ${WORKDIR}/openv/lib/libnborbST.so elif use ia64 ; then cd ${EXTDIR}"/NBClients/anb/Clients/usr/openv/netbackup/client/Linux-IA64/RedHat2.6" tar xzf "client_bin.tar.Z" -C ${WORKDIR} else die "Unknwon archicture" fi cp -f version ${WORKDIR}/openv cp -f tar ${WORKDIR}/openv if use java; then cd ${EXTDIR}/NBClients/anb/Clients/usr/openv tar xzf "NB-Java.tar.Z" -C ${WORKDIR}/openv fi # Do Help cp -Rf netbackup/help ${WORKDIR}/openv/netbackup } src_install() { # Do Help insinto /usr/openv/netbackup/help/bp/ doins openv/netbackup/help/bp/* # Handle all of the bins # FIXME Should probably move 500 exec to sbin or at least # maintain the same permissions. This is also the case # for the shared objects lib/ into /usr/openv/netbackup/ newbin openv/netbackup/bin/bpcd_new bpcd rm -f openv/netbackup/bin/bpcd_new openv/netbackup/bin/bpcd # FIXME Can we use app-arch/tar ? dobin openv/tar # Fix what looks like another compatibility issue dosym ${DESTTREE}bin/bpbackup ${DESTTREE}bin/bparchive dosym ${DESTTREE}bin/bp.kill_all ${DESTTREE}bin/goodies/bp.kill_all for file in openv/netbackup/bin/*; do if [ ! -d ${file} ]; then dobin ${file} fi done for file in openv/netbackup/bin/goodies/*; do if [ ! -d ${file} ]; then dobin ${file} fi done for file in openv/netbackup/bin/private/*; do if [ ! -d ${file} ]; then dobin ${file} fi done for file in openv/netbackup/bin/support/*; do if [ ! -d ${file} ]; then dobin ${file} fi done # Do Java stuff if use java; then insinto /usr/openv/java/ insopts -m0644 doins openv/java/*.jar doins openv/java/*.properties doins openv/java/*.txt doins openv/java/*.conf doins openv/java/Xenv insopts -m0500 doins openv/java/nonroot_admin_nbjava insopts -m0555 doins openv/java/FSA doins openv/java/get_trace doins openv/java/jbpSA doins openv/java/jnbSA # Fix more compatibility issues dosym ${INSDESTTREE}jbpSA ${DESTTREE}bin/goodies/jbpSA dosym ${INSDESTTREE}jnbSA ${DESTTREE}bin/goodies/jnbSA for file in `find openv/java/vrts/* -print`; do # We are still -m0555 doins ${file} done fi # Do conf files # prevent overwrite if file exists, such as the etc-update or such ;) insinto /usr/openv/netbackup/ insopts -m0644 sed -e s/YYYYY/"so"/ openv/netbackup/nblog.conf.template > openv/netbackup/nblog.conf newins openv/netbackup/nblog.conf.template nblog.conf.template doins openv/netbackup/nblog.conf export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSDESTTREE}nblog.conf" # Do bp.conf echo "SERVER = " >> openv/netbackup/bp.conf echo "CLIENT_NAME = `hostname`" >> openv/netbackup/bp.conf echo "SERVER_SENDS_MAIL = YES" >> openv/netbackup/bp.conf echo "SERVER = root@`hostname`" >> openv/netbackup/bp.conf doins openv/netbackup/bp.conf export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSDESTTREE}bp.conf" # Do exclude_list echo "/mnt" >> openv/netbackup/exclude_list doins openv/netbackup/exclude_list export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSDESTTREE}exclude_list" # Copy version to netbackup client folder insinto /usr/openv/netbackup/bin/ insopts -m0444 doins openv/version # Copy resouce data to openv folder insinto /usr/openv/resources/ insopts -m0444 doins openv/resources/* # Copy msg data to openv folder insinto /usr/openv/msg/ insopts -m0555 doins openv/msg/.conf # Do openv bin files # FIXME Should probably move 500 exec to sbin into /usr/openv/ newbin openv/bin/vnetd_new vnetd rm -f openv/bin/vnetd_new openv/bin/vnetd for file in openv/bin/*; do if [ ! -d ${file} ]; then dobin ${file} fi done # Handle the var folders insinto /usr/openv/var/auth/ insopts -m0444 doins openv/var/auth/template.*.txt insopts -m0644 for template in openv/var/auth/template.*.txt do tmp=openv/var/auth/${template/template./} newins ${template} ${tmp##*/} done insinto /usr/openv/var/vnetd/ insopts -m0444 doins openv/var/vnetd/*.txt # chmod 700 ${D}/usr/openv/var/vnetd # Create init scripts newinitd "${FILESDIR}"/nbclient.initd nbclient insinto /etc/xinetd.d newins "${FILESDIR}"/bpcd.xinetd bpcd if use java ; then newins "${FILESDIR}"/bpjava-msvc.xinetd bpjava-msvc fi newins "${FILESDIR}"/vnetd.xinetd vnetd newins "${FILESDIR}"/vopied.xinetd vopied # Work out all the libraries into /usr/openv/netbackup/ for lib in openv/lib/*.so_new do newlib=${lib##*/} newlib=${newlib/_new/} newlib.so ${lib} ${newlib} done # ACE libraries are versioned. Need a different loop for them. # VxUL libraries are now versioned. Need a different loop for them. for lib in openv/lib/*.so.?_new do newlib=${lib##*/} newlib=${newlib/_new/} newlib.so ${lib} ${newlib} done # The rest of the libraries for lib in openv/lib/*.so do newlib=${lib##*/} newlib=${newlib/_new/} newlib.so ${lib} ${newlib} done for lib in openv/lib/*.so.? do newlib=${lib##*/} newlib=${newlib/_new/} newlib.so ${lib} ${newlib} done # Scheduling broke backward compatibility as far as the JNI # library name. Create a symbolic link as a workaround. #into lib/openv dosym ${DESTTREE}lib/libvxSigScheduleJNI2.so ${DESTTREE}lib/libSigScheduleJNI.so # Add the following to /etc/ld.so.conf and then run ldconfig echo "LDPATH=\"${DESTTREE}/lib\"" >> 99netbackup echo "CONFIG_PROTECT=\"${CONFIG_PROTECT}\"" >> 99netbackup doenvd 99netbackup # Setup some destionation dirs dodir /usr/openv/netbackup/dbext dodir /usr/openv/netbackup/hardlink_info/root dodir /usr/openv/netbackup/baremetal/client/data dodir /usr/openv/netbackup/tir_info dodir /usr/openv/netbackup/logs dodir /usr/openv/netbackup/logs/user_ops dodir /usr/openv/share dodir /usr/openv/tmp dodir /usr/openv/logs dodir /usr/openv/var/global dodir /usr/openv/var/vxss dodir /usr/openv/var/vxss/credentials # Install the documentation if use doc ; then # Extraction dir has a build? date appended to it... # Tested with 20070723 dodoc NB_65_Docs_[0-9]*/*.pdf dodoc NB_65_Docs_[0-9]*/*.html dodoc NB_65_Docs_[0-9]*/images/* fi ebegin "Trying to fix bad things..." TMPDIR=${T} scanelf -BXrR "${D}/usr/openv" -o /dev/null eend $? } pkg_config() { einfo "Updating /etc/services" { grep -v ^bpcd /etc/services | grep -v ^vopied | grep -v nbdb | grep -v nomdb ; echo -e "bpcd\t\t13782/tcp\t\t\t# VERITAS NetBackup" ; echo -e "bpcd\t\t13782/udp\t\t\t# VERITAS NetBackup" ; echo -e "vopied\t\t13783/tcp\t\t\t# VOPIED Protocol" ; echo -e "vopied\t\t13783/udp\t\t\t# VOPIED Protocol" ; echo -e "nbdb\t\t13785/tcp\t\t\t# NetBackup Database" ; echo -e "nbdb\t\t13785/udp\t\t\t# NetBackup Database" ; echo -e "nomdb\t\t13786/tcp\t\t\t# Veritas-nomdb" ; echo -e "nomdb\t\t13786/udp\t\t\t# Veritas-nomdb" } > /etc/services } pkg_postinst() { elog "Please check the following files and enable the ones you need." elog "\t/etc/xinetd.d/bpcd" elog "\t/etc/xinetd.d/bpjava-msvc" elog "\t/etc/xinetd.d/vnetd" elog "\t/etc/xinetd.d/vopied\n" if use doc ; then elog "Documentation was installe to /usr/share/doc/${PF}\n" fi elog "You will also need to configure the following files:" elog "\t/usr/openv/netbackup/bp.conf" elog "\t/usr/openv/netbackup/exclude_list\n" elog "Please review your /etc/xinetd.conf file." elog "Gentoo has the 'only_from' variable set to localhost " elog "by default!" }