| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-admin/bcfg2/bcfg2-1.2.2.ebuild,v 1.4 2012/06/29 06:16:32 xmw Exp $
|
| 4 |
|
| 5 |
EAPI="4"
|
| 6 |
|
| 7 |
PYTHON_DEPEND="2:2.6"
|
| 8 |
SUPPORT_PYTHON_ABIS="1"
|
| 9 |
# ssl module required.
|
| 10 |
RESTRICT_PYTHON_ABIS="2.4 2.5 3.*"
|
| 11 |
|
| 12 |
inherit distutils
|
| 13 |
|
| 14 |
DESCRIPTION="configuration management tool"
|
| 15 |
HOMEPAGE="http://bcfg2.org"
|
| 16 |
SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${P}.tar.gz"
|
| 17 |
|
| 18 |
LICENSE="BSD"
|
| 19 |
SLOT="0"
|
| 20 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris"
|
| 21 |
IUSE="doc cheetah genshi server"
|
| 22 |
|
| 23 |
DEPEND="dev-python/setuptools
|
| 24 |
doc? ( dev-python/sphinx )"
|
| 25 |
RDEPEND="app-portage/gentoolkit
|
| 26 |
cheetah? ( dev-python/cheetah )
|
| 27 |
genshi? ( dev-python/genshi )
|
| 28 |
server? (
|
| 29 |
virtual/fam
|
| 30 |
dev-python/lxml
|
| 31 |
dev-libs/libgamin[python] )"
|
| 32 |
|
| 33 |
PYTHON_MODNAME="Bcfg2"
|
| 34 |
|
| 35 |
distutils_src_install_post_hook() {
|
| 36 |
if ! use server; then
|
| 37 |
rm -f "$(distutils_get_intermediate_installation_image)${EPREFIX}/usr/sbin/bcfg2-"*
|
| 38 |
fi
|
| 39 |
}
|
| 40 |
|
| 41 |
src_compile() {
|
| 42 |
distutils_src_compile
|
| 43 |
|
| 44 |
if use doc; then
|
| 45 |
einfo "Building Bcfg2 documentation"
|
| 46 |
PYTHONPATH="build-$(PYTHON -f --ABI)" \
|
| 47 |
sphinx-build doc doc_output || die
|
| 48 |
fi
|
| 49 |
}
|
| 50 |
|
| 51 |
src_install() {
|
| 52 |
distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
|
| 53 |
|
| 54 |
if ! use server; then
|
| 55 |
rm -rf "${ED}usr/share/bcfg2" || die
|
| 56 |
rm -rf "${ED}usr/share/man/man8" || die
|
| 57 |
else
|
| 58 |
newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
|
| 59 |
fi
|
| 60 |
|
| 61 |
insinto /etc
|
| 62 |
doins examples/bcfg2.conf
|
| 63 |
|
| 64 |
if use doc; then
|
| 65 |
pushd doc_output > /dev/null
|
| 66 |
insinto /usr/share/doc/${PF}/html
|
| 67 |
doins -r [a-z]* _images _static || die "Failed to install documentation"
|
| 68 |
popd > /dev/null
|
| 69 |
fi
|
| 70 |
}
|
| 71 |
|
| 72 |
pkg_postinst () {
|
| 73 |
distutils_pkg_postinst
|
| 74 |
|
| 75 |
if use server; then
|
| 76 |
einfo "If this is a new installation, you probably need to run:"
|
| 77 |
einfo " bcfg2-admin init"
|
| 78 |
fi
|
| 79 |
}
|