From 0bb7ddd91a87bb8b6a88139a97fafe5e5eb5efad Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Mon, 2 Apr 2012 13:06:33 +0000 Subject: add init script for termination (Portage version: 2.2.0_alpha96/cvs/Linux x86_64) --- app-benchmarks/bootchart2/ChangeLog | 8 ++- .../bootchart2/bootchart2-0.14.2-r1.ebuild | 77 ++++++++++++++++++++++ app-benchmarks/bootchart2/bootchart2-0.14.2.ebuild | 67 ------------------- app-benchmarks/bootchart2/files/bootchart2.init | 26 ++++++++ 4 files changed, 110 insertions(+), 68 deletions(-) create mode 100644 app-benchmarks/bootchart2/bootchart2-0.14.2-r1.ebuild delete mode 100644 app-benchmarks/bootchart2/bootchart2-0.14.2.ebuild create mode 100644 app-benchmarks/bootchart2/files/bootchart2.init (limited to 'app-benchmarks/bootchart2') diff --git a/app-benchmarks/bootchart2/ChangeLog b/app-benchmarks/bootchart2/ChangeLog index e60090c6985e..e7971b771f1d 100644 --- a/app-benchmarks/bootchart2/ChangeLog +++ b/app-benchmarks/bootchart2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-benchmarks/bootchart2 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-benchmarks/bootchart2/ChangeLog,v 1.1 2012/04/02 07:19:16 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-benchmarks/bootchart2/ChangeLog,v 1.2 2012/04/02 13:06:32 jlec Exp $ + +*bootchart2-0.14.2-r1 (02 Apr 2012) + + 02 Apr 2012; Justin Lecher +files/bootchart2.init, + -bootchart2-0.14.2.ebuild, +bootchart2-0.14.2-r1.ebuild: + add init script for termination *bootchart2-0.14.2 (02 Apr 2012) diff --git a/app-benchmarks/bootchart2/bootchart2-0.14.2-r1.ebuild b/app-benchmarks/bootchart2/bootchart2-0.14.2-r1.ebuild new file mode 100644 index 000000000000..9f203099d298 --- /dev/null +++ b/app-benchmarks/bootchart2/bootchart2-0.14.2-r1.ebuild @@ -0,0 +1,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 +} diff --git a/app-benchmarks/bootchart2/bootchart2-0.14.2.ebuild b/app-benchmarks/bootchart2/bootchart2-0.14.2.ebuild deleted file mode 100644 index 41779baeb71b..000000000000 --- a/app-benchmarks/bootchart2/bootchart2-0.14.2.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# 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.ebuild,v 1.1 2012/04/02 07:19:16 jlec Exp $ - -EAPI=4 - -PYTHON_DEPEND="2" -SUPPORT_PYTHON_ABIS="1" -RESTRICT_PYTHON_ABI="2.7-pypy-*" - -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=]" -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_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 -} - -src_test() { - testing() { - emake test - } - python_execute_function testing -} - -pkg_postinst() { - elog "Please review /usr/share/doc/${PF}/README" - elog "for further usage informations." -} diff --git a/app-benchmarks/bootchart2/files/bootchart2.init b/app-benchmarks/bootchart2/files/bootchart2.init new file mode 100644 index 000000000000..4670fe12d096 --- /dev/null +++ b/app-benchmarks/bootchart2/files/bootchart2.init @@ -0,0 +1,26 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-benchmarks/bootchart2/files/bootchart2.init,v 1.1 2012/04/02 13:06:33 jlec Exp $ + +depend() { + use localmount +} + +start() { + if /bin/grep -q "rdinitrd=/sbin/bootchartd" /proc/cmdline; then + if /bin/pidof bootchart-collector> /dev/null 2>&1; then + ebegin "Scheduling termination of Bootchart" + /sbin/bootchartd start + /sbin/bootchartd wait & + eend $? + else + elog "No bootchart process found!" + eindent + elog "This script does not start bootchart, but only schedules its termination." + elog "Bootchart should be started from the kernel command line." + elog "Please check the README on how to do that." + eoutdent + eend 0 + fi +} -- cgit v1.2.3-65-gdbad