Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 476300 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/app-admin/bcfg2/bcfg2-1.2.4.ebuild (-42 / +48 lines)
Lines 1-80 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/app-admin/bcfg2/bcfg2-1.2.4.ebuild,v 1.1 2013/04/21 07:56:34 xmw Exp $
3
# $Header: 
4
5
EAPI="4"
6
4
7
PYTHON_DEPEND="2:2.6"
5
EAPI=5
8
SUPPORT_PYTHON_ABIS="1"
6
PYTHON_COMPAT=( python{2_6,2_7,3_1,3_2,3_3} )
9
# ssl module required.
10
RESTRICT_PYTHON_ABIS="2.4 2.5 3.*"
11
7
12
inherit distutils
8
inherit distutils-r1 readme.gentoo
13
9
14
DESCRIPTION="configuration management tool"
10
DESCRIPTION="Configuration management tool"
15
HOMEPAGE="http://bcfg2.org"
11
HOMEPAGE="http://bcfg2.org"
16
SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${P}.tar.gz"
12
SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${P}.tar.gz"
17
13
18
LICENSE="BSD-2"
14
LICENSE="BSD-2"
19
SLOT="0"
15
SLOT="0"
20
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris"
16
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~x64-solaris"
21
IUSE="doc cheetah genshi server"
17
IUSE="doc cheetah genshi server"
22
18
23
DEPEND="dev-python/setuptools
19
DEPEND="dev-python/setuptools
24
	doc? ( dev-python/sphinx )"
20
	dev-python/sphinx[${PYTHON_USEDEP}]
21
	doc? ( dev-libs/libgamin[python]
22
			dev-python/cherrypy[${PYTHON_USEDEP}]
23
			dev-python/genshi[${PYTHON_USEDEP}]
24
			dev-python/lxml[${PYTHON_USEDEP}]
25
			dev-python/mock[${PYTHON_USEDEP}]
26
			dev-python/pyinotify[${PYTHON_USEDEP}]
27
			dev-python/python-daemon[${PYTHON_USEDEP}] )"
25
RDEPEND="app-portage/gentoolkit
28
RDEPEND="app-portage/gentoolkit
26
	cheetah? ( dev-python/cheetah )
29
	cheetah? ( dev-python/cheetah[${PYTHON_USEDEP}] )
27
	genshi? ( dev-python/genshi )
30
	genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
31
	dev-python/m2crypto[${PYTHON_USEDEP}]
28
	server? (
32
	server? (
29
		dev-libs/libgamin[python]
33
		dev-python/django[${PYTHON_USEDEP},sqlite]
30
		dev-python/lxml
34
		dev-python/lxml[${PYTHON_USEDEP}]
31
		dev-python/nose
35
		dev-python/python-daemon[${PYTHON_USEDEP}]
32
		virtual/fam )"
36
		dev-python/nose[${PYTHON_USEDEP}]
33
37
		dev-python/south[${PYTHON_USEDEP}]
34
PYTHON_MODNAME="Bcfg2"
38
		media-gfx/graphviz
35
39
		|| ( dev-python/pyinotify[${PYTHON_USEDEP}]
36
distutils_src_install_post_hook() {
40
		     dev-libs/libgamin[python,${PYTHON_USEDEP}] ) )"
37
	if ! use server; then
38
		rm -f "$(distutils_get_intermediate_installation_image)${EPREFIX}/usr/sbin/bcfg2-"*
39
	fi
40
}
41
41
42
src_compile() {
42
DOC_CONTENTS="For new installs, you need to run:\n bcfg2-admin init"
43
	distutils_src_compile
44
43
45
	if use doc; then
44
python_compile_all() {
46
		einfo "Building Bcfg2 documentation"
45
	"${PYTHON}" setup.py build_sphinx || die
47
		PYTHONPATH="build-$(PYTHON -f --ABI)" \
48
			sphinx-build doc doc_output || die
49
	fi
50
}
46
}
51
47
52
src_install() {
48
src_install() {
53
	distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
49
	distutils-r1_src_install
54
50
55
	if ! use server; then
51
	if ! use server; then
56
		rm -rf "${ED}usr/share/bcfg2" || die
52
		rm -rf "${ED}usr/share/bcfg2" || die
57
		rm -rf "${ED}usr/share/man/man8" || die
53
		rm -rf "${ED}usr/share/man/man8" || die
54
		rm -f "${ED}/usr/bin/bcfg2-"[a-oq-z]*  # don't remove implementations
55
		remove-server-libs() {
56
			local sitedir=$(python_get_sitedir)
57
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Reporting"
58
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Server"
59
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/SSLServer"*
60
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Statistics"*
61
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/settings"*
62
		}
63
		python_foreach_impl remove-server-libs
58
	else
64
	else
59
		newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
65
		newinitd "${FILESDIR}/${PN}-server-1.3.rc" bcfg2-server
66
		newinitd "${FILESDIR}/${PN}-report-collector-1.3.rc" bcfg2-report-collector
67
		readme.gentoo_create_doc
60
	fi
68
	fi
61
69
62
	insinto /etc
70
	insinto /etc
63
	doins examples/bcfg2.conf
71
	doins examples/bcfg2.conf
72
}
64
73
74
python_install_all() {
65
	if use doc; then
75
	if use doc; then
66
		pushd doc_output > /dev/null
76
        rm -rf ../${P}-*/sphinx/html/_sources
67
		insinto /usr/share/doc/${PF}/html
77
        local HTML_DOCS=( ../${P}-*/sphinx/html/. )
68
		doins -r [a-z]* _images _static || die "Failed to install documentation"
69
		popd > /dev/null
70
	fi
78
	fi
79
	distutils-r1_python_install_all
71
}
80
}
72
81
73
pkg_postinst () {
82
pkg_postinst () {
74
	distutils_pkg_postinst
75
76
	if use server; then
83
	if use server; then
77
		einfo "If this is a new installation, you probably need to run:"
84
		readme.gentoo_print_elog
78
		einfo "    bcfg2-admin init"
79
	fi
85
	fi
80
}
86
}

Return to bug 476300