public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/runit/
Date: Sun, 16 Jun 2024 06:07:23 +0000 (UTC)	[thread overview]
Message-ID: <1718518039.0e256f242d7ce36744c2165fd639bebe7f9b6589.robbat2@gentoo> (raw)

commit:     0e256f242d7ce36744c2165fd639bebe7f9b6589
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 06:02:59 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 06:07:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e256f24

sys-process/runit: EAPI=8 porting and other fixes

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/show_bug.cgi?id=920357
Closes: https://bugs.gentoo.org/show_bug.cgi?id=875533
Closes: https://bugs.gentoo.org/show_bug.cgi?id=721880
Closes: https://bugs.gentoo.org/show_bug.cgi?id=590412

 sys-process/runit/Manifest              |   1 +
 sys-process/runit/runit-2.1.2-r2.ebuild | 149 ++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+)

diff --git a/sys-process/runit/Manifest b/sys-process/runit/Manifest
index 8331848d7bf9..d3ffa90ef4a7 100644
--- a/sys-process/runit/Manifest
+++ b/sys-process/runit/Manifest
@@ -1 +1,2 @@
 DIST runit-2.1.2.tar.gz 110916 BLAKE2B 101e514aeed282685ebe636f401ca6f94d157281d08a3ac487340aebe945b82d2ee01d41e9917446f4ebd7b27fe9fd18ba4ad55739ab1b62a0e59e1c438b55e9 SHA512 a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf
+DIST runit_2.1.2-59ubuntu1.debian.tar.xz 66756 BLAKE2B d071dae4a92f292837f55210cda62d8d0471efa623aeb43b56fb6381050b64fa5d3def7d0738756621e1c4d05b36d0cdaedb7d056d24d796f834ace932bd55b9 SHA512 de6289d9909a8df5c5657762f8214858f9301ac0d55cac9c605f70f92e663ed8067fe018a8585616099ac369b7078a95415040c27e82626261f2adf925d0bad2

diff --git a/sys-process/runit/runit-2.1.2-r2.ebuild b/sys-process/runit/runit-2.1.2-r2.ebuild
new file mode 100644
index 000000000000..0d475b7e66d4
--- /dev/null
+++ b/sys-process/runit/runit-2.1.2-r2.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="A UNIX init scheme with service supervision"
+HOMEPAGE="http://smarden.org/runit/"
+UBUNTU_PR="59ubuntu1"
+UBUNTU_A="${PN}_${PV}-${UBUNTU_PR}.debian.tar.xz"
+SRC_URI="
+	http://smarden.org/runit/${P}.tar.gz
+	http://archive.ubuntu.com/ubuntu/pool/universe/r/runit/${UBUNTU_A}
+	"
+
+RDEPEND="sys-apps/openrc"
+
+S=${WORKDIR}/admin/${P}/src
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="static"
+
+src_prepare() {
+	default
+	cd "${WORKDIR}/admin/"
+	eapply -p1 "${WORKDIR}/debian/patches"
+	cd "${S}"
+
+	# 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
+	sed -i \
+		-e "/echo.*ar.*cr/s,\<ar\>,$(tc-getAR)," \
+		-e "/echo.*ranlib/s,\<ranlib\>,$(tc-getRANLIB)," \
+		print-ar.sh || die
+}
+
+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]
+
+	exeinto /etc/runit
+	doexe "${FILESDIR}"/ctrlaltdel
+	newexe "${FILESDIR}"/1-${PV} 1
+	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
+	newenvd - 20runit <<- EOF
+		#/etc/env.d/20runit
+		SVDIR="/etc/service/"
+	EOF
+}
+
+default_config() {
+	local sv="${EROOT}"/etc/sv
+	local service="${EROOT}"/etc/service
+	mkdir -p "${service}" || die
+	for x in tty1 tty2 tty3 tty4 tty5 tty6; do
+	ln -sf "${sv}"/getty-$x "${service}"/getty-$x || die
+	done
+	einfo "The links to services runit will supervise are installed"
+	einfo "in $service."
+	einfo "If you need multiple runlevels, please see the documentation"
+	einfo "for how to set them up."
+	einfo
+}
+
+migrate_from_211() {
+	# Create /etc/service and /var/service if requested
+	if [ -e "${T}"/make_var_service ]; then
+		ln -sf "${EROOT}"/etc/runit/runsvdir/current "${EROOT}"/etc/service || die
+		ln -sf "${EROOT}"/etc/runit/runsvdir/current "${EROOT}"/var/service || die
+	fi
+	if [ -d "${T}"/runsvdir ]; then
+		cp -a "${T}"/runsvdir "${EROOT}"/etc/runit || die
+	fi
+	return 0
+}
+
+pkg_preinst() {
+	if  has_version '<sys-process/runit-2.1.2'; then
+		pre_212=yes
+	fi
+}
+
+pkg_postinst() {
+	if [[ -z $REPLACING_VERSIONS ]]; then
+		default_config
+	elif [[ -n $pre_212 ]]; then
+		migrate_from_211
+	fi
+
+	ewarn "To make sure sv works correctly in your currently open"
+	ewarn "shells, please run the following command:"
+	ewarn
+	ewarn "source /etc/profile"
+	ewarn
+
+	if [ -L "${EROOT}"/var/service ]; then
+		ewarn "Once this version of runit is active, please remove the"
+		ewarn "compatibility symbolic link at ${EROOT}/var/service"
+		ewarn "The correct path now is ${EROOT}/etc/service"
+		ewarn
+	fi
+
+	if [ -L "${EROOT}"/etc/runit/runsvdir/all ]; then
+		ewarn "${EROOT}/etc/runit/runsvdir/all has moved to"
+		iewarn "${EROOT}/etc/sv."
+		ewarn "Any symbolic links under ${EROOT}/etc/runit/runsvdir"
+		ewarn "which point to services through ../all should be updated to"
+		ewarn "point to them through ${EROOT}/etc/sv."
+		ewarn "Once that is done, ${EROOT}/etc/runit/runsvdir/all should be"
+		ewarn "removed."
+		ewarn
+	fi
+}


             reply	other threads:[~2024-06-16  6:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16  6:07 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-26  5:57 [gentoo-commits] repo/gentoo:master commit in: sys-process/runit/ Eli Schwartz
2024-10-07 15:33 Mike Gilbert
2024-09-05 14:42 Mike Gilbert
2024-09-05 14:42 Mike Gilbert
2024-08-23  7:33 Ulrich Müller
2024-08-23  7:28 Sam James
2024-08-23  7:28 Sam James
2024-08-22 14:35 Mike Gilbert
2024-08-22 14:06 Mike Gilbert
2024-07-21  0:31 Sam James
2024-06-21 18:58 Arthur Zamarin
2024-06-21 18:58 Arthur Zamarin
2024-06-21 18:58 Arthur Zamarin
2024-06-21 18:58 Arthur Zamarin
2024-06-21 18:27 Arthur Zamarin
2024-06-21 18:27 Arthur Zamarin
2024-06-21 18:27 Arthur Zamarin
2024-06-21 18:27 Arthur Zamarin
2024-01-12 16:41 Ionen Wolkens
2024-01-12 16:31 William Hubbs
2022-08-01  2:33 Sam James
2022-02-13 21:08 Conrad Kostecki
2021-05-14  9:35 Agostino Sarubbo
2021-05-13 21:17 Sam James
2021-05-13 21:17 Sam James
2021-05-13 21:16 Sam James
2021-05-13 21:15 Sam James
2021-05-13 21:15 Sam James
2021-05-13 21:15 Sam James
2018-05-20  0:20 William Hubbs
2018-05-20  0:18 William Hubbs
2016-11-15  3:47 Mike Frysinger
2016-11-14 14:50 Mike Frysinger
2016-11-11 18:52 William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1718518039.0e256f242d7ce36744c2165fd639bebe7f9b6589.robbat2@gentoo \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox