# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=5 inherit toolchain-funcs flag-o-matic versionator DESCRIPTION="A UNIX init scheme with service supervision" HOMEPAGE="http://smarden.org/runit/" SRC_URI="http://smarden.org/runit/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" IUSE="static" S=${WORKDIR}/admin/${P}/src src_prepare() { # we either build everything or nothing static sed -i -e 's:-static: :' Makefile # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726008 [[ ${COMPILER} == "diet" ]] && use ppc && filter-flags "-mpowerpc-gpopt" } src_configure() { use static && append-ldflags -static echo "$(tc-getCC) ${CFLAGS}" > conf-cc echo "$(tc-getCC) ${LDFLAGS}" > conf-ld } src_install() { into / dobin $(<../package/commands) dodir /sbin mv "${ED}"/bin/{runit-init,runit,utmpset} "${ED}"/sbin/ || die "dosbin" dosym ../etc/runit/2 /sbin/runsvdir-start into /usr cd .. dodoc package/{CHANGES,README,THANKS,TODO} dohtml doc/*.html doman man/*.[18] dodir /etc/runit exeinto /etc/runit doexe "${FILESDIR}"/{1,ctrlaltdel} newexe "${FILESDIR}"/2-${PV} 2 newexe "${FILESDIR}"/3-${PV} 3 dodir /etc/sv for tty in tty1 tty2 tty3 tty4 tty5 tty6; do exeinto /etc/sv/getty-$tty/ newexe "${FILESDIR}"/finish.getty finish newexe "${FILESDIR}"/run.getty-${PV} run for script in finish run; do sed -i -e "s:TTY:${tty}:g" "${ED}"/etc/sv/getty-$tty/$script done done # make sv command work cat <<-EOF > "${T}"/env.d #/etc/env.d/20runit SVDIR="/etc/service/" EOF insinto /etc/env.d newins "${T}"/env.d 20runit } pkg_preinst() { if has_version 'sys-process/runit' && has_version '