summaryrefslogtreecommitdiff
blob: 9f203099d2981b59e5cfdd7e8dbe9e8d1f07aebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-benchmarks/bootchart2/bootchart2-0.14.2-r1.ebuild,v 1.1 2012/04/02 13:06:32 jlec Exp $

EAPI=4

PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"

inherit linux-info python systemd toolchain-funcs

DESCRIPTION="Performance analysis and visualization of the system boot process"
HOMEPAGE="https://github.com/mmeeks/bootchart/"
SRC_URI="mirror://github/mmeeks/bootchart/${P}.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="svg"

RDEPEND="
	!app-benchmarks/bootchart
	dev-python/pycairo[svg=]
	dev-python/pygtk"
DEPEND="${RDEPEND}"

CONFIG_CHECK="~PROC_EVENTS ~TASKSTATS ~TASK_DELAY_ACCT ~TMPFS"

src_prepare() {
	tc-export CC
	sed \
		-e "/^install/s:py-install-compile::g" \
		-e "/^VER/s:0.14.1:0.14.2:g" \
		-e "/^SYSTEMD_UNIT_DIR/s:=.*:= $(systemd_get_unitdir):g" \
		-i Makefile || die
}

src_test() {
	testing() {
		emake test
	}
	python_execute_function testing
}

src_install() {
	export NO_PYTHON_COMPILE=0
	export DOCDIR=/usr/share/doc/${PF}
	default

	# Note: LIBDIR is hardcoded as /lib in collector/common.h, so we shouldn't
	# just change it. Since no libraries are installed, /lib is fine.
	keepdir /lib/bootchart/tmpfs

	installation() {
		emake \
			DESTDIR="${D}" \
			PY_SITEDIR=$(python_get_sitedir) \
			py-install-compile
	}
	python_execute_function installation

	newinitd "${FILESDIR}"/${PN}.init ${PN}
}

pkg_postinst() {
	elog "Please add the init script to your default runlevel"
	elog "rc-update add bootchart2 default"
	echo ""
	elog "Please review /usr/share/doc/${PF}/README"
	elog "for further usage informations."
	echo
	python_mod_optimize pybootchartgui
}

pkg_postrm() {
	python_mod_cleanup pybootchartgui
}