commit:     8bdea3071842b04cc1c183856c7af4ce8a118154
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat May 11 17:18:07 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat May 11 17:19:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bdea307

sys-apps/util-linux: wire up uuidd properly

Closes: https://bugs.gentoo.org/470910
Closes: https://bugs.gentoo.org/931303
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-apps/util-linux/files/uuidd.initd               | 10 ++++++++++
 sys-apps/util-linux/metadata.xml                    |  1 +
 ...ux-2.40.1.ebuild => util-linux-2.40.1-r1.ebuild} | 21 +++++++++++++++++++--
 sys-apps/util-linux/util-linux-9999.ebuild          | 21 +++++++++++++++++++--
 4 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/sys-apps/util-linux/files/uuidd.initd 
b/sys-apps/util-linux/files/uuidd.initd
new file mode 100644
index 000000000000..329929e9a9ab
--- /dev/null
+++ b/sys-apps/util-linux/files/uuidd.initd
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/uuidd
+pidfile=/run/uuidd/uuidd.pid
+
+depend() {
+       need clock localmount
+}

diff --git a/sys-apps/util-linux/metadata.xml b/sys-apps/util-linux/metadata.xml
index 2d9b8b837fe2..291587be5409 100644
--- a/sys-apps/util-linux/metadata.xml
+++ b/sys-apps/util-linux/metadata.xml
@@ -24,6 +24,7 @@
                su: non-root users may become root
                </flag>
                <flag name="tty-helpers">install the mesg/wall/write tools for 
talking to local users</flag>
+               <flag name="uuidd">build uuidd daemon</flag>
        </use>
        <upstream>
                <remote-id 
type="cpe">cpe:/a:andries_brouwer:util-linux</remote-id>

diff --git a/sys-apps/util-linux/util-linux-2.40.1.ebuild 
b/sys-apps/util-linux/util-linux-2.40.1-r1.ebuild
similarity index 95%
rename from sys-apps/util-linux/util-linux-2.40.1.ebuild
rename to sys-apps/util-linux/util-linux-2.40.1-r1.ebuild
index fefca19af628..c112b4749522 100644
--- a/sys-apps/util-linux/util-linux-2.40.1.ebuild
+++ b/sys-apps/util-linux/util-linux-2.40.1-r1.ebuild
@@ -4,9 +4,10 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
+TMPFILES_OPTIONAL=1
 
 inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
-       pam python-r1 multilib-minimal multiprocessing systemd
+       pam python-r1 multilib-minimal multiprocessing systemd tmpfiles
 
 MY_PV="${PV/_/-}"
 MY_P="${PN}-${MY_PV}"
@@ -33,7 +34,7 @@ S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
 SLOT="0"
-IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger 
magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid 
systemd test tty-helpers udev unicode"
+IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger 
magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid 
systemd test tty-helpers udev unicode uuidd"
 
 # Most lib deps here are related to programs rather than our libs,
 # so we rarely need to specify ${MULTILIB_USEDEP}.
@@ -84,6 +85,10 @@ RDEPEND+="
                !<sys-apps/shadow-4.7-r2
                !>=sys-apps/shadow-4.7-r2[su]
        )
+       uuidd? (
+               acct-user/uuidd
+               virtual/tmpfiles
+       )
        !net-wireless/rfkill
 "
 
@@ -230,6 +235,7 @@ multilib_src_configure() {
                $(use_enable static-libs static)
                $(use_with ncurses tinfo)
                $(use_with selinux)
+               $(multilib_native_use_enable uuidd)
 
                # TODO: Wire this up (bug #931118)
                --without-econf
@@ -303,6 +309,9 @@ multilib_src_configure() {
                        --enable-libsmartcols
                        --enable-libfdisk
                        --enable-libmount
+
+                       # Support uuidd for non-native libuuid
+                       $(use_enable uuidd libuuid-force-uuidd)
                )
        fi
 
@@ -388,6 +397,10 @@ multilib_src_install_all() {
                fperms u+s /bin/su
        fi
 
+       if use uuidd; then
+               newinitd "${FILESDIR}/uuidd.initd" uuidd
+       fi
+
        # Note:
        # Bash completion for "runuser" command is provided by same file which
        # would also provide bash completion for "su" command. However, we don't
@@ -412,4 +425,8 @@ pkg_postinst() {
                elog "The agetty util now clears the terminal by default. You"
                elog "might want to add --noclear to your /etc/inittab lines."
        fi
+
+       if use uuidd; then
+               tmpfiles_process uuidd-tmpfiles.conf
+       fi
 }

diff --git a/sys-apps/util-linux/util-linux-9999.ebuild 
b/sys-apps/util-linux/util-linux-9999.ebuild
index a3c518db9e1d..053f45a99077 100644
--- a/sys-apps/util-linux/util-linux-9999.ebuild
+++ b/sys-apps/util-linux/util-linux-9999.ebuild
@@ -4,9 +4,10 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
+TMPFILES_OPTIONAL=1
 
 inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
-       pam python-r1 multilib-minimal multiprocessing systemd
+       pam python-r1 multilib-minimal multiprocessing systemd tmpfiles
 
 MY_PV="${PV/_/-}"
 MY_P="${PN}-${MY_PV}"
@@ -33,7 +34,7 @@ S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
 SLOT="0"
-IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger 
magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid 
systemd test tty-helpers udev unicode"
+IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger 
magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid 
systemd test tty-helpers udev unicode uuidd"
 
 # Most lib deps here are related to programs rather than our libs,
 # so we rarely need to specify ${MULTILIB_USEDEP}.
@@ -84,6 +85,10 @@ RDEPEND+="
                !<sys-apps/shadow-4.7-r2
                !>=sys-apps/shadow-4.7-r2[su]
        )
+       uuidd? (
+               acct-user/uuidd
+               virtual/tmpfiles
+       )
        !net-wireless/rfkill
 "
 
@@ -230,6 +235,7 @@ multilib_src_configure() {
                $(use_enable static-libs static)
                $(use_with ncurses tinfo)
                $(use_with selinux)
+               $(multilib_native_use_enable uuidd)
 
                # TODO: Wire this up (bug #931118)
                --without-econf
@@ -303,6 +309,9 @@ multilib_src_configure() {
                        --enable-libsmartcols
                        --enable-libfdisk
                        --enable-libmount
+
+                       # Support uuidd for non-native libuuid
+                       $(use_enable uuidd libuuid-force-uuidd)
                )
        fi
 
@@ -387,6 +396,10 @@ multilib_src_install_all() {
                fperms u+s /bin/su
        fi
 
+       if use uuidd; then
+               newinitd "${FILESDIR}/uuidd.initd" uuidd
+       fi
+
        # Note:
        # Bash completion for "runuser" command is provided by same file which
        # would also provide bash completion for "su" command. However, we don't
@@ -411,4 +424,8 @@ pkg_postinst() {
                elog "The agetty util now clears the terminal by default. You"
                elog "might want to add --noclear to your /etc/inittab lines."
        fi
+
+       if use uuidd; then
+               tmpfiles_process uuidd-tmpfiles.conf
+       fi
 }

Reply via email to