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 (-36 / +43 lines)
Lines 2-15 Link Here
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: /var/cvsroot/gentoo-x86/app-admin/bcfg2/bcfg2-1.2.4.ebuild,v 1.1 2013/04/21 07:56:34 xmw Exp $
4
4
5
EAPI="4"
5
EAPI=5
6
PYTHON_COMPAT=( python{2_6,2_7,3_1,3_2,3_3} )
6
7
7
PYTHON_DEPEND="2:2.6"
8
inherit distutils-r1 readme.gentoo
8
SUPPORT_PYTHON_ABIS="1"
9
# ssl module required.
10
RESTRICT_PYTHON_ABIS="2.4 2.5 3.*"
11
12
inherit distutils
13
9
14
DESCRIPTION="configuration management tool"
10
DESCRIPTION="configuration management tool"
15
HOMEPAGE="http://bcfg2.org"
11
HOMEPAGE="http://bcfg2.org"
Lines 21-80 Link Here
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
	doc? (
21
		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/m2crypto[${PYTHON_USEDEP}]
26
		dev-python/mock[${PYTHON_USEDEP}]
27
		dev-python/pyinotify[${PYTHON_USEDEP}]
28
		dev-python/python-daemon[${PYTHON_USEDEP}]
29
		dev-python/sphinx[${PYTHON_USEDEP}] )"
25
RDEPEND="app-portage/gentoolkit
30
RDEPEND="app-portage/gentoolkit
26
	cheetah? ( dev-python/cheetah )
31
	cheetah? ( dev-python/cheetah[${PYTHON_USEDEP}] )
27
	genshi? ( dev-python/genshi )
32
	genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
28
	server? (
33
	server? (
29
		dev-libs/libgamin[python]
34
		dev-python/lxml[${PYTHON_USEDEP}]
30
		dev-python/lxml
35
		dev-python/nose[${PYTHON_USEDEP}]
31
		dev-python/nose
36
		dev-python/python-daemon[${PYTHON_USEDEP}]
32
		virtual/fam )"
37
		|| ( dev-python/pyinotify[${PYTHON_USEDEP}]
33
38
			dev-libs/libgamin[python,${PYTHON_USEDEP}] ) )"
34
PYTHON_MODNAME="Bcfg2"
35
36
distutils_src_install_post_hook() {
37
	if ! use server; then
38
		rm -f "$(distutils_get_intermediate_installation_image)${EPREFIX}/usr/sbin/bcfg2-"*
39
	fi
40
}
41
39
42
src_compile() {
40
DOC_CONTENTS="For new installs, you need to run:\n
43
	distutils_src_compile
41
    bcfg2-admin init"
44
42
43
python_compile_all() {
45
	if use doc; then
44
	if use doc; then
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
46
	fi
50
}
47
}
51
48
52
src_install() {
49
src_install() {
53
	distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
50
	distutils-r1_src_install
54
51
55
	if ! use server; then
52
	if ! use server; then
53
		# Remove files only necessary for a server installation
56
		rm -rf "${ED}usr/share/bcfg2" || die
54
		rm -rf "${ED}usr/share/bcfg2" || die
57
		rm -rf "${ED}usr/share/man/man8" || die
55
		rm -rf "${ED}usr/share/man/man8" || die
56
		rm -f "${ED}/usr/bin/bcfg2-"[a-oq-z]*  # don't remove implementations
57
		remove-server-libs() {
58
			local sitedir=$(python_get_sitedir)
59
			rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Reporting"
60
			rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Server"
61
			rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/SSLServer"*
62
			rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Statistics"*
63
			rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/settings"*
64
		}
65
		python_foreach_impl remove-server-libs
58
	else
66
	else
59
		newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
67
		newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
68
		readme.gentoo_create_doc
60
	fi
69
	fi
61
70
62
	insinto /etc
71
	insinto /etc
63
	doins examples/bcfg2.conf
72
	doins examples/bcfg2.conf
73
}
64
74
75
python_install_all() {
65
	if use doc; then
76
	if use doc; then
66
		pushd doc_output > /dev/null
77
		rm -rf build/sphinx/html/_sources
67
		insinto /usr/share/doc/${PF}/html
78
		local HTML_DOCS=( build/sphinx/html/. )
68
		doins -r [a-z]* _images _static || die "Failed to install documentation"
69
		popd > /dev/null
70
	fi
79
	fi
80
	distutils-r1_python_install_all
71
}
81
}
72
82
73
pkg_postinst () {
83
pkg_postinst () {
74
	distutils_pkg_postinst
75
76
	if use server; then
84
	if use server; then
77
		einfo "If this is a new installation, you probably need to run:"
85
		readme.gentoo_print_elog
78
		einfo "    bcfg2-admin init"
79
	fi
86
	fi
80
}
87
}

Return to bug 476300