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 (-35 / +39 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 )
27
	genshi? ( dev-python/genshi )
31
	genshi? ( dev-python/genshi )
28
	server? (
32
	server? (
29
		dev-libs/libgamin[python]
30
		dev-python/lxml
33
		dev-python/lxml
31
		dev-python/nose
34
		dev-python/python-daemon
32
		virtual/fam )"
35
		|| ( dev-python/pyinotify dev-libs/libgamin[python] ) )"
33
34
PYTHON_MODNAME="Bcfg2"
35
36
36
distutils_src_install_post_hook() {
37
DOC_CONTENTS="For new installs, you need to run:\n
37
	if ! use server; then
38
    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
39
40
python_compile_all() {
45
	if use doc; then
41
	if use doc; then
46
		einfo "Building Bcfg2 documentation"
42
	    "${PYTHON}" setup.py build_sphinx || die
47
		PYTHONPATH="build-$(PYTHON -f --ABI)" \
48
			sphinx-build doc doc_output || die
49
	fi
43
	fi
50
}
44
}
51
45
52
src_install() {
46
src_install() {
53
	distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
47
	distutils-r1_src_install
54
48
55
	if ! use server; then
49
	if ! use server; then
50
		# Remove files only necessary for a server installation
56
		rm -rf "${ED}usr/share/bcfg2" || die
51
		rm -rf "${ED}usr/share/bcfg2" || die
57
		rm -rf "${ED}usr/share/man/man8" || die
52
		rm -rf "${ED}usr/share/man/man8" || die
53
		rm -f "${ED}/usr/bin/bcfg2-"[a-oq-z]*  # don't remove implementations
54
		remove-server-libs() {
55
			local sitedir=$(python_get_sitedir)
56
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Reporting"
57
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Server"
58
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/SSLServer"*
59
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/Statistics"*
60
		    rm -rf "${ED}/${sitedir#${EPREFIX}}/Bcfg2/settings"*
61
		}
62
		python_foreach_impl remove-server-libs
58
	else
63
	else
59
		newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
64
		newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
65
	    readme.gentoo_create_doc
60
	fi
66
	fi
61
67
62
	insinto /etc
68
	insinto /etc
63
	doins examples/bcfg2.conf
69
	doins examples/bcfg2.conf
70
}
64
71
72
python_install_all() {
65
	if use doc; then
73
	if use doc; then
66
		pushd doc_output > /dev/null
74
	    rm -rf build/sphinx/html/_sources
67
		insinto /usr/share/doc/${PF}/html
75
		local HTML_DOCS=( build/sphinx/html/. )
68
		doins -r [a-z]* _images _static || die "Failed to install documentation"
76
    fi
69
		popd > /dev/null
77
	distutils-r1_python_install_all
70
	fi
71
}
78
}
72
79
73
pkg_postinst () {
80
pkg_postinst () {
74
	distutils_pkg_postinst
75
76
	if use server; then
81
	if use server; then
77
		einfo "If this is a new installation, you probably need to run:"
82
		readme.gentoo_print_elog
78
		einfo "    bcfg2-admin init"
79
	fi
83
	fi
80
}
84
}

Return to bug 476300