diff --git a/sys-process/dinit/Manifest b/sys-process/dinit/Manifest new file mode 100644 index 0000000..754dac9 --- /dev/null +++ b/sys-process/dinit/Manifest @@ -0,0 +1 @@ +DIST dinit-0.21.0.tar.gz 415328 BLAKE2B f1634ce5545918576bf2b2d5a689e9468a480667b28d2525ae1579c67e666aae026ebba99b8b9e67036799dbe0fb42273d23c836e31cce70797d7a0b83a2509f SHA512 9362ddc400570bed7c0d67eeeafef2e339834c8a71948542562e1c5467da7a6f0fad74599118138c02f2d08116a9a8bfe3d9d1a5d02ea0ccf5e97192ea5deea7 diff --git a/sys-process/dinit/dinit-0.21.0.ebuild b/sys-process/dinit/dinit-0.21.0.ebuild new file mode 100644 index 0000000..fc94097 --- /dev/null +++ b/sys-process/dinit/dinit-0.21.0.ebuild @@ -0,0 +1,53 @@ +# Copyright 2026 Shin'ya Minazuki +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Service monitoring and init system" +HOMEPAGE="https://davmac.org/projects/dinit/" +SRC_URI="https://github.com/davmac314/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="capabilities? ( sys-libs/libcap )" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +IUSE="+capabilities +cgroups initgroups ioprio oom-adj +openrc shutdown utmpx" +RESTRICT="mirror" + +src_configure() { + export CXX="$(tc-getCXX)" + export EXTRA_CXXFLAGS="${CFLAGS}" + + ./configure --prefix="${EPREFIX}/usr" \ + --shutdown-prefix="${PN}" \ + $(use_enable shutdown) \ + $(use_enable capabilities) \ + $(use_enable oom-adj) \ + $(use_enable utmpx) \ + $(use_enable initgroups) \ + $(use_enable ioprio) + + # Let the user put their own optimization settings + elog "Filtering out upstream's optimization settings..." + sed -i -e 's/-Os//' mconfig + sed -i -e 's/-flto//' mconfig +} + +src_compile() { + emake +} + +src_install() { + emake DESTDIR="${D}" install + use openrc && newinitd "${FILESDIR}/${PN}.initd-r0" "${PN}" + use systemd && systemd_dounit "${FILESDIR}/${PN}.service" +} + +pkg_postinst() { + einfo "This package will not override your init system by default," + einfo "and if you want to use it as such, you will have to port the init scripts yourself" +} diff --git a/sys-process/dinit/dinit-9999.ebuild b/sys-process/dinit/dinit-9999.ebuild new file mode 100644 index 0000000..1a19250 --- /dev/null +++ b/sys-process/dinit/dinit-9999.ebuild @@ -0,0 +1,50 @@ +# Copyright 2026 Shin'ya Minazuki +EAPI=8 + +inherit git-r3 toolchain-funcs + +DESCRIPTION="Service monitoring and init system" +HOMEPAGE="https://davmac.org/projects/dinit/" +EGIT_REPO_URI="https://github.com/davmac314/dinit" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="capabilities? ( sys-libs/libcap )" +RDEPEND="${DEPEND}" +BDEPEND="" + +IUSE="capabilities cgroups initgroups ioprio oom-adj shutdown utmpx" + +src_configure() { + export CXX="$(tc-getCXX)" + export EXTRA_CXXFLAGS="${CFLAGS}" + + ./configure --prefix="${EPREFIX}/usr" \ + --shutdown-prefix="${PN}" \ + $(use_enable shutdown) \ + $(use_enable capabilities) \ + $(use_enable oom-adj) \ + $(use_enable utmpx) \ + $(use_enable initgroups) \ + $(use_enable ioprio) + + # Let the user put their own optimization settings + elog "Filtering out upstream's optimization settings..." + sed -i -e 's/-Os//' mconfig + sed -i -e 's/-flto//' mconfig +} + +src_compile() { + emake +} + +src_install() { + emake DESTDIR="${D}" install +} + +pkg_postinst() { + einfo "This package will not override your init system by default," + einfo "and if you want to use it as such, you will have to port the init scripts yourself" +} diff --git a/sys-process/dinit/files/dinit.initd-r0 b/sys-process/dinit/files/dinit.initd-r0 new file mode 100644 index 0000000..488a9ab --- /dev/null +++ b/sys-process/dinit/files/dinit.initd-r0 @@ -0,0 +1,9 @@ +#!/sbin/openrc-run +# Copyright 2026 Shin'ya Minazuki + +supervisor="supervise-daemon" + +command="/usr/sbin/${RC_SVCNAME}" +command_args="-s -d /etc/dinit.d -q" +command_background="true" +pidfile="/run/${RC_SVCNAME}.pid" diff --git a/sys-process/dinit/metadata.xml b/sys-process/dinit/metadata.xml new file mode 100644 index 0000000..d5af97e --- /dev/null +++ b/sys-process/dinit/metadata.xml @@ -0,0 +1,16 @@ + + + + + shinyoukai@laidback.moe + Shin'ya Minazuki + + + Enable support for capabilities (using sys-libs/libcap) + Enable initialization of supplementary groups for run-as + Enable support for I/O priority setting + Enable support for out of memory score adjustment + Build the shutdown commands + Enable manipulation of the utmp/utmpx database + +