🎶 AND DON'T FORGET THE JOKER
[flussence-overlay.git] / sys-process / runit / runit-2.1.2-r13.ebuild
blob72db8f2a589c88f6811c9863127bcfc126d8ca1e
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit toolchain-funcs flag-o-matic
8 DESCRIPTION="A UNIX init scheme with service supervision"
9 HOMEPAGE="http://smarden.org/runit/"
10 SRC_URI="http://smarden.org/runit/${P}.tar.gz"
11 S=${WORKDIR}/admin/${P}/src
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="static"
17 # runtime dependencies in /etc/runit/{1,3}
18 RDEPEND="
19 sys-apps/openrc
20 sys-process/psmisc
23 PATCHES=( "${FILESDIR}"/bug721880-dont-hardcode-ar-ranlib.patch )
25 src_prepare() {
26 # we either build everything or nothing static
27 sed -i -e 's:-static: :' Makefile
29 default
32 src_configure() {
33 use static && append-ldflags -static
35 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
36 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld # [sic]
37 tc-getAR > conf-ar
38 tc-getRANLIB > conf-ranlib
41 src_install() {
42 dodir /etc/env.d /etc/service
43 echo 'SVDIR=/etc/service' >> "${T}/99${PN}" || die
44 doenvd "${T}/99${PN}"
46 into /
47 dobin chpst runsv runsvchdir runsvdir sv svlogd
48 dosbin runit runit-init utmpset
50 into /usr
51 for tty in agetty-tty{1..6}; do
52 exeinto /etc/sv/"${tty}"/
53 for script in run finish; do
54 newexe "${FILESDIR}/${script}".agetty "${script}"
55 done
56 done
58 exeinto /etc/runit
59 doexe "${FILESDIR}"/{1,2,3,ctrlaltdel}
61 # N.B. this is not $WORKDIR because $S is redefined above
62 cd "${S}"/.. || die
64 dodoc package/{CHANGES,README,THANKS,TODO} doc/*.html
65 doman man/*.[18]
68 pkg_postinst() {
69 elog "If this is your first time installing runit, some manual setup is"
70 elog "required before you can use it as your primary init system."
71 elog "'agetty' services have been installed in /etc/sv/, but they are not"
72 elog "enabled automatically. Symlink one or more of these into "
73 elog "/etc/service/ to have console logins available at boot."
74 elog "The supplied startup scripts will run up to OpenRC's 'boot' runlevel"
75 elog "and then start runit's services."
76 if [[ -n ${REPLACING_VERSIONS} ]] ; then
77 echo
78 ewarn "A pre-existing runit version was detected."
79 ewarn "You may want to verify your /etc/service setup is sane."
83 pkg_postrm() {
84 if [[ -z ${REPLACED_BY_VERSION} ]] ; then
85 ewarn "runit was uninstalled. Make sure your system is still bootable!"