diff options
Diffstat (limited to 'app-backup/bacula/bacula-3.0.3.ebuild')
-rw-r--r-- | app-backup/bacula/bacula-3.0.3.ebuild | 357 |
1 files changed, 0 insertions, 357 deletions
diff --git a/app-backup/bacula/bacula-3.0.3.ebuild b/app-backup/bacula/bacula-3.0.3.ebuild deleted file mode 100644 index 6e332e0..0000000 --- a/app-backup/bacula/bacula-3.0.3.ebuild +++ /dev/null @@ -1,357 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/bacula-3.0.3.ebuild,v 1.2 2009/12/26 17:22:56 pva Exp $ - -EAPI="2" - -MY_PV=${PV/_beta/-b} -MY_P=${PN}-${MY_PV} - -inherit base - -DESCRIPTION="Featureful client/server network backup suite" -HOMEPAGE="http://www.bacula.org/" -SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz" - -IUSE="X +bacula-dir +bacula-sd +client gnome ipv6 logwatch mysql nls postgres python qt4 readline +server +sqlite ssl static tcpd wxwindows" -# bacula-web bimagemgr brestore bweb -KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86" - -S=${WORKDIR}/${MY_P} - -LICENSE="GPL-2" -SLOT="0" - -CDEPEND=" - dev-libs/gmp - sys-libs/zlib - client? ( - gnome? ( - >=gnome-base/libgnome-2 - >=gnome-base/libgnomeui-2 - x11-libs/gksu - ) - qt4? ( - x11-libs/qt-svg:4 - >=x11-libs/qwt-5 - ) - wxwindows? ( x11-libs/wxGTK ) - ) - logwatch? ( sys-apps/logwatch ) - server? ( - virtual/mta - mysql? ( virtual/mysql ) - postgres? ( >=virtual/postgresql-server-7.4 ) - sqlite? ( dev-db/sqlite:3 ) - !postgres? ( !mysql? ( !sqlite? ( dev-db/sqlite:3 ) ) ) - ) - ssl? ( dev-libs/openssl ) - tcpd? ( sys-apps/tcp-wrappers ) - readline? ( sys-libs/readline ) - python? ( dev-lang/python[threads] )" -RDEPEND="${CDEPEND} - server? ( - sys-block/mtx - app-arch/mt-st - )" -DEPEND="${CDEPEND} - nls? ( sys-devel/gettext ) -" - -PATCHES=( - "${FILESDIR}/${PV}/${PN}-default-configs.patch" - "${FILESDIR}/${PV}/${PN}-gnomesu2gksu.diff" -) - -DOCS=( - "${S}/ChangeLog" - "${S}/README" - "${S}/ReleaseNotes" - "${S}/SUPPORT" - "${S}/kernstodo" - "${S}/projects" -) - -pkg_setup() { - if use server; then - einfo "Descending database types are overruled this way:" - einfo " postgres > mysql > sqlite" - if use postgres; then - DB_TYPE="postgresql" - elif use mysql; then - DB_TYPE="mysql" - elif use sqlite; then - DB_TYPE="sqlite3" - fi - if ! use postgres && ! use mysql && ! use sqlite; then - eerror "No database backend selected, selecting sqlite as fallback" - DB_TYPE="sqlite3" - fi - fi -} - -src_configure() { - local myconf - - # to be done: - # --disable-acl disable acl support [default=auto] - # --disable-xattr disable xattr support [default=auto] - - if use client && ! use server; then - myconf+=" - $(use_enable client client-only) - $(use_enable static static-fd) - " - else - myconf+=" - --with-${DB_TYPE} - --enable-batch-insert - $(use_enable static static-tools) - $(use_enable static static-fd) - $(use_enable bacula-dir build-dird) - $(use_enable bacula-sd build-stored) - " - use bacula-dir && myconf+=" $(use_enable static static-dir)" - use bacula-sd && myconf+=" $(use_enable static static-sd)" - fi - - if use client; then - myconf+=" - $(use_with X x) - $(use_enable gnome) - $(use_enable gnome tray-monitor) - $(use_enable wxwindows bwx-console) - $(use_enable qt4 bat) - $(use_enable static static-cons) - " - fi - - myconf+=" - $(use_with pyhon) - $(use_enable readline) - $(use_with readline readline /usr) - $(use_with ssl openssl) - $(use_enable ipv6) - $(use_with tcpd tcp-wrappers) - " - - econf \ - --with-pid-dir=/var/run \ - --sysconfdir=/etc/bacula \ - --with-subsys-dir=/var/lock/subsys \ - --with-working-dir=/var/lib/bacula \ - --with-scriptdir=/usr/libexec/bacula \ - --with-dir-user=bacula \ - --with-dir-group=bacula \ - --with-sd-user=root \ - --with-sd-group=bacula \ - --with-fd-user=root \ - --with-fd-group=bacula \ - --enable-smartalloc \ - ${myconf} -} - -src_install() { - local x scripts remove - - base_src_install - - # install bat when enabled (for some reason ./configure doesn't pick this up) - use client && use qt4 && { dosbin "${S}"/src/qt-console/.libs/bat || die "dosbin failed" ; } - - # remove some scripts we don't need at all - rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql} - - if use static; then - # symlink statically linked apps - # to their non-static names - scripts="bacula-fd bfconsole" - if use server; then - use bacula-dir && scripts+=" bacula-dir" - use bacula-sd && scripts+=" bacula-sd" - fi - if use client; then - use gnome && scripts+=" gnome-console" - use qt4 && scripts+=" bat" - - fi - for x in ${scripts}; do - dosym /usr/sbin/static-${name} /usr/sbin/${name} || die - done - fi - - # gnome-console menu entries using gksu - if use client && use gnome; then - emake DESTDIR="${D}" install-menu-xsu \ - || die "Failed to install gnome menu files" - fi - - # extra files which 'make install' doesn't cover - if use server; then - # the database update scripts - diropts -m0750 - insinto /usr/libexec/bacula/updatedb - insopts -m0754 - doins "${S}"/updatedb/* || die - fperms 0640 /usr/libexec/bacula/updatedb/README || die - - # the logrotate configuration - # (now unconditional wrt bug #258187) - diropts -m0755 - insinto /etc/logrotate.d - insopts -m0644 - newins "${S}"/scripts/logrotate bacula || die - - # the logwatch scripts - if use logwatch; then - diropts -m0750 - dodir /etc/log.d/scripts/services - dodir /etc/log.d/scripts/shared - dodir /etc/log.d/conf/logfiles - dodir /etc/log.d/conf/services - pushd "${S}"/scripts/logwatch > /dev/null - emake DESTDIR="${D}" install || die "Failed to install logwatch scripts" - popd > /dev/null - fi - fi - - # remove unwanted files - if ! use client; then - remove=( - "${D}"/etc/bacula/bconsole.conf - "${D}"/usr/sbin/bconsole - "${D}"/usr/libexec/bacula/bconsole - ) - fi - if ! use client || ! use gnome; then - remove+=( - "${D}"/usr/share/man/man1/bacula-bgnome-console.1* - "${D}"/usr/libexec/bacula/gconsole - ) - fi - if ! use client || ! use wxwindows; then - remove+=( - "${D}"/usr/share/man/man1/bacula-bwxconsole.1* - ) - fi - if ! use server; then - remove+=( - "${D}"/usr/share/man/man1/bat.1* - "${D}"/usr/share/man/man1/bacula-tray-monitor.1* - ) - fi - if ! use server || ! use bacula-dir; then - remove+=( - "${D}"/usr/share/man/man8/bacula-dir.8* - "${D}"/usr/share/man/man8/dbcheck.8* - "${D}"/usr/share/man/man1/bsmtp.1* - "${D}"/usr/libexec/bacula/create_*_database - "${D}"/usr/libexec/bacula/drop_*_database - "${D}"/usr/libexec/bacula/make_*_tables - "${D}"/usr/libexec/bacula/update_*_tables - "${D}"/usr/libexec/bacula/drop_*_tables - "${D}"/usr/libexec/bacula/grant_*_privileges - "${D}"/usr/libexec/bacula/*_catalog_backup - ) - fi - if ! use server || ! use bacula-sd; then - remove+=( - "${D}"/usr/share/man/man8/bacula-sd.8* - "${D}"/usr/share/man/man8/bcopy.8* - "${D}"/usr/share/man/man8/bextract.8* - "${D}"/usr/share/man/man8/bls.8* - "${D}"/usr/share/man/man8/bscan.8* - "${D}"/usr/share/man/man8/btape.8* - "${D}"/usr/libexec/bacula/disk-changer - "${D}"/usr/libexec/bacula/mtx-changer - "${D}"/usr/libexec/bacula/dvd-handler - ) - fi - if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then - for x in "${remove[@]}"; do - rm ${x} || die "removal failed" - done - fi - - # setup init scripts - scripts="bacula-fd" - if use server; then - use bacula-dir && scripts+=" bacula-dir" - use bacula-sd && scripts+=" bacula-sd" - fi - for x in ${scripts}; do - # copy over init script and config to a temporary location - # so we can modify them as needed - cp "${FILESDIR}/${PV}/${x}"-conf "${T}/${x}".conf || die "failed to copy ${x}-conf" - cp "${FILESDIR}/${PV}/${x}"-init "${T}/${x}".init || die "failed to copy ${x}-init" - # set database dependancy for the director init scripts - if [[ ${x} == bacula-dir ]]; then - if [[${DB_TYPE} == sqlite3 ]]; then - sed -i \ - -e 's/need "%database%"/:/g' - "${T}/${x}.init" || die - else - sed -i \ - -e "s:%database%:${DB_TYPE}:" \ - "${T}/${x}.init" || die - fi - fi - # install init script and config - newinitd "${T}/${x}".init "${x}" || die - newconfd "${T}/${x}".conf "${x}" || die - done - - # make sure the working directory exists - diropts -m0750 - keepdir /var/lib/bacula - - # make sure bacula group can execute bacula libexec scripts - fowners -R root:bacula /usr/libexec/bacula -} - -pkg_preinst() { - # create the daemon group and user - if [[ -z "$(egetent group bacula)" ]]; then - enewgroup ${PN} - einfo "The group \"${PN}\" has been created. Any users you add to this" - einfo "group have access to files created by the daemons." - echo - fi - if use server && [[ -z "$(egetent passwd ${PN})" ]]; then - enewuser ${PN} -1 -1 /var/lib/${PN} ${PN},disk,tape,cdrom,cdrw - einfo "The user \"${PN}\" has been created. Please see the bacula manual" - einfo "for information about running bacula as a non-root user." - echo - fi -} - -pkg_postinst() { - if useq bacula-clientonly; then - fowners root:bacula /var/lib/bacula - else - fowners bacula:bacula /var/lib/bacula - fi - - if use server && use bacula-dir; then - einfo - einfo "If this is a new install, you must create the ${mydbtype} databases with:" - einfo " /usr/libexec/bacula/create_${mydbtype}_database" - einfo " /usr/libexec/bacula/make_${mydbtype}_tables" - einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges" - einfo - einfo "If you're upgrading from a major release, you must upgrade your bacula catalog database." - einfo "Please read the manual chapter for how to upgrade your database." - einfo "You can find database upgrade scripts in /usr/libexec/bacula/updatedb." - einfo - fi - - ewarn "The bundled catalog backup script (/usr/libexec/bacula/make_catalog_backup)" - ewarn "is INSECURE. The script needs to be called with the database access password" - ewarn "as a command line parameter, thus, the password can be seen from any other" - ewarn "user on the system (if not using some non-default hardened/patched kernel" - ewarn "with /proc restrictions)!" - ewarn - ewarn "See also:" - ewarn "http://www.bacula.org/en/rel-manual/Bacula_Security_Issues.html" - ewarn "http://www.bacula.org/en/rel-manual/Catalog_Maintenance.html#BackingUpBaculaSecurityConsiderations" -} |