# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ S=${WORKDIR}/${P} SLOT="0" LICENSE="BSD" DESCRIPTION=" The AMANDA tape backup client and server" SRC_URI="ftp://ftp.amanda.org/pub/amanda/${P}p2.tar.gz" HOMEPAGE="http://www.amanda.org/" IUSE="zlib" KEYWORDS="x86" DEPEND="" RDEPEND="sys-apps/xinetd" pkg_setup() { id "amanda" 1> /dev/null || die "Must add user amanda:tape first." } src_compile() { local myconf myconf=" \ --prefix=/usr \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --with-user=amanda \ --with-group=tape \ --with-tape-device=/dev/nst0 \ --with-gnutar \ --with-mmap \ --with-fqdn" use samba && myconf="${myconf} --with-smbclient" cd ${S}p2 econf ${myconf} || die "econf FAILED" make || die "make FAILED" } src_install() { local amanda_home cd ${S}p2 make DESTDIR=${D} install || die "make install to DESTDIR=${D} FAILED" echo "Creating /etc/amandates" touch ${D}/etc/amandates fowners amanda:tape /etc/amandates echo "Creating /etc/amanda and populating" mkdir -p ${D}/etc/amanda/DailySet1 cp ${S}p2/example/*.conf ${D}/etc/amanda/DailySet1 cp ${S}p2/example/disklist ${D}/etc/amanda/DailySet1 chown -R amanda:tape ${D}/etc/amanda amanda_home=~amanda mkdir -p ${D}/${amanda_home}/DailySet1/index mkdir ${D}/${amanda_home}/gnutar-lists chown -R amanda:tape ${D}/${amanda_home}/* #If xinetd is installed on system, copy stub files for the user if [ -d /etc/xinetd.d/ ] then mkdir -p ${D}/etc/xinetd.d cp /usr/portage/app-admin/amanda/files/amanda ${D}/etc/xinetd.d/ cp /usr/portage/app-admin/amanda/files/amandaidx ${D}/etc/xinetd.d/ cp /usr/portage/app-admin/amanda/files/amidxtape ${D}/etc/xinetd.d/ else ewarn "NOTE TO ADMINISTRATOR:" ewarn " xinetd stub files for amanda are located in \ /usr/portage/app-admin/amanda/files." fi }