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 (-38 / +43 lines)
Lines 1-15 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
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? ( dev-libs/libgamin[python]
21
		   dev-python/cherrypy[${PYTHON_USEDEP}]
22
		   dev-python/genshi[${PYTHON_USEDEP}]
23
		   dev-python/lxml[${PYTHON_USEDEP}]
24
		   dev-python/m2crypto[${PYTHON_USEDEP}]
25
		   dev-python/mock[${PYTHON_USEDEP}]
26
           dev-python/pyinotify[${PYTHON_USEDEP}]
27
		   dev-python/python-daemon[${PYTHON_USEDEP}]
28
		   dev-python/sphinx[${PYTHON_USEDEP}] )"
25
RDEPEND="app-portage/gentoolkit
29
RDEPEND="app-portage/gentoolkit
26
	cheetah? ( dev-python/cheetah )
30
	cheetah? ( dev-python/cheetah[${PYTHON_USEDEP}] )
27
	genshi? ( dev-python/genshi )
31
	genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
28
	server? (
32
	server? (
29
		dev-libs/libgamin[python]
33
		dev-python/lxml[${PYTHON_USEDEP}]
30
		dev-python/lxml
34
		dev-python/python-daemon[${PYTHON_USEDEP}]
31
		dev-python/nose
35
		|| ( dev-python/pyinotify[${PYTHON_USEDEP}]
32
		virtual/fam )"
36
		     dev-libs/libgamin[python,${PYTHON_USEDEP}] ) )"
33
34
PYTHON_MODNAME="Bcfg2"
35
37
36
distutils_src_install_post_hook() {
38
DOC_CONTENTS="For new installs, you need to run:\n
37
	if ! use server; then
39
    bcfg2-admin init"
38
		rm -f "$(distutils_get_intermediate_installation_image)${EPREFIX}/usr/sbin/bcfg2-"*
39
	fi
40
}
41
42
src_compile() {
43
	distutils_src_compile
44
40
41
python_compile_all() {
45
	if use doc; then
42
	if use doc; then
46
		einfo "Building Bcfg2 documentation"
43
	    "${PYTHON}" setup.py build_sphinx || die
47
		PYTHONPATH="build-$(PYTHON -f --ABI)" \
48
			sphinx-build doc doc_output || die
49
	fi
44
	fi
50
}
45
}
51
46
52
src_install() {
47
src_install() {
53
	distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
48
	distutils-r1_src_install
54
49
55
	if ! use server; then
50
	if ! use server; then
51
		# Remove files only necessary for a server installation
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.2.0.rc" bcfg2-server
66
	    readme.gentoo_create_doc
60
	fi
67
	fi
61
68
62
	insinto /etc
69
	insinto /etc
63
	doins examples/bcfg2.conf
70
	doins examples/bcfg2.conf
71
}
64
72
73
python_install_all() {
65
	if use doc; then
74
	if use doc; then
66
		pushd doc_output > /dev/null
75
	    rm -rf build/sphinx/html/_sources
67
		insinto /usr/share/doc/${PF}/html
76
		local HTML_DOCS=( build/sphinx/html/. )
68
		doins -r [a-z]* _images _static || die "Failed to install documentation"
77
    fi
69
		popd > /dev/null
78
	distutils-r1_python_install_all
70
	fi
71
}
79
}
72
80
73
pkg_postinst () {
81
pkg_postinst () {
74
	distutils_pkg_postinst
75
76
	if use server; then
82
	if use server; then
77
		einfo "If this is a new installation, you probably need to run:"
83
		readme.gentoo_print_elog
78
		einfo "    bcfg2-admin init"
79
	fi
84
	fi
80
}
85
}

Return to bug 476300