# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/backuppc-2.1.2-r1.ebuild,v 1.2 2006/10/10 14:45:52 seemant Exp $ inherit eutils webapp IUSE="samba doc" MY_P=BackupPC-${PV} PATCH_VER=0.1 S=${WORKDIR}/${MY_P} DESCRIPTION="A high performance, enterprise grade backup system for backing up Linux, Windows, Mac OS X desktops and laptops to a server's disk. No client side software needed." HOMEPAGE="http://backuppc.sourceforge.net" SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" #SRC_URI="http://superb-west.dl.sourceforge.net/sourceforge/backuppc/${MY_P}.tar.gz" LICENSE="GPL-2" KEYWORDS="~amd64 x86" DEPEND="dev-lang/perl" RDEPEND="dev-perl/File-RsyncP app-arch/par2cmdline app-arch/gzip app-arch/bzip2 app-arch/unzip dev-perl/Archive-Zip virtual/mta net-www/apache www-apache/mod_perl samba? ( net-fs/samba )" PATCHDIR=${WORKDIR}/gentoo/prepatch pkg_setup() { enewgroup backuppc enewuser backuppc -1 -1 /dev/null backuppc webapp_pkg_setup } src_unpack() { unpack ${A}; cd ${S} epatch ${FILESDIR}/perlInterpreter.patch } src_compile() { find ./ -name 'CVS' -type d | xargs rm -rf } src_test() { einfo "Can not test" } src_install() { local myconf myconf="" if use samba ; then myconf="--bin-path smbclient=$(type -p smbclient)" myconf="${myconf} --bin-path nmblookup=$(type -p nmblookup)" fi webapp_src_preinst dodir ${MY_HTDOCSDIR}/${PN} ./configure.pl \ --batch \ --bin-path perl=$(type -p perl) \ --bin-path tar=$(type -p tar) \ --bin-path rsync=$(type -p rsync) \ --bin-path ping=$(type -p ping) \ --bin-path df=$(type -p df) \ --bin-path ssh=$(type -p ssh) \ --bin-path sendmail=$(type -p sendmail) \ --bin-path hostname=$(type -p hostname) \ --bin-path gzip=$(type -p gzip) \ --bin-path bzip2=$(type -p bzip2) \ --hostname $(hostname) \ --uid-ignore \ --dest-dir ${D} \ --html-dir ${MY_HTDOCSDIR}/image \ --html-dir-url /icons \ --cgi-dir ${MY_CGIBINDIR} \ --fhs \ ${myconf} || die "failed the configure.pl script" pod2man \ --section=8 \ --center="BackupPC manual" \ ${S}/doc/BackupPC.pod backuppc.8 || die "failed to generate man page" doman backuppc.8 diropts -m 750 keepdir /var/lib/backuppc/{trash,pool,pc,log,cpool} diropts -m 755 dodir /etc/BackupPC newinitd ${S}/init.d/gentoo-backuppc backuppc newinitd ${FILESDIR}/backuppcApache2.init backuppcApache2 newconfd ${S}/init.d/gentoo-backuppc.conf backuppc newconfd ${FILESDIR}/backuppcApache2.conf backuppcApache2 webapp_postinst_txt \ en ${FILESDIR}/postinstall-en.txt || die "webapp_postinst_txt" webapp_src_install || die "webapp_src_install" } pkg_postinst() { install ${FILESDIR}/httpd.conf ${ROOT}/etc/BackupPC/httpd.conf install -g root -o backuppc -m 460 ${FILESDIR}/authUser ${ROOT}/etc/BackupPC/authUser webapp_pkg_postinst mkdir -p /var/log/BackupPC ebegin "Adjusting ownership of various things..." chown -Rf backuppc:backuppc "${ROOT}/var/lib/backuppc" chown -Rf backuppc:backuppc "${ROOT}/etc/BackupPC" chown -Rf backuppc:backuppc "${ROOT}/var/log/BackupPC" chown backuppc:backuppc "${ROOT}/${MY_CGIBINDIR}/BackupPC_Admin" chmod 755 "${ROOT}/${MY_CGIBINDIR}/BackupPC_Admin" chown -Rf backuppc:backuppc "${ROOT}/data/BackupPC" chmod 770 "${ROOT}/data/BackupPC" eend $? elog "Please read the documentation" elog "It is important to know that the webserver and the backuppc user" elog "*must* be one and the same" }