# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 inherit toolchain-funcs flag-o-matic 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 ~sparc ~x86" IUSE="static" RDEPEND="" S=${WORKDIR}/admin/${P}/src src_prepare() { default # 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 DOCS=( ../package/{CHANGES,README,THANKS,TODO} ) HTML_DOCS=( ../doc/*.html ) einstalldocs doman ../man/*.[18] dodir /etc/runit dodir /etc/sv # 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 '