net-misc/dhcpcd: set rundir=/run/dhcpcd in 9.x
authorMike Gilbert <floppym@gentoo.org>
Thu, 21 May 2020 01:56:33 +0000 (21:56 -0400)
committerMike Gilbert <floppym@gentoo.org>
Thu, 21 May 2020 02:04:25 +0000 (22:04 -0400)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
net-misc/dhcpcd/dhcpcd-9.0.2-r1.ebuild [moved from net-misc/dhcpcd/dhcpcd-9.0.2.ebuild with 96% similarity]
net-misc/dhcpcd/dhcpcd-9999.ebuild
net-misc/dhcpcd/files/dhcpcd.initd-r1 [new file with mode: 0644]
net-misc/dhcpcd/files/dhcpcd.service-r1 [new file with mode: 0644]

similarity index 96%
rename from net-misc/dhcpcd/dhcpcd-9.0.2.ebuild
rename to net-misc/dhcpcd/dhcpcd-9.0.2-r1.ebuild
index 9656eabee928b2784c254ff214f14da77f97dfe8..ac18c5907ad88b3a8e0f6d741f3800bdd4c3ce66 100644 (file)
@@ -45,7 +45,7 @@ src_configure() {
                $(use_enable ipv6)
                $(use_enable privsep)
                $(usex elibc_glibc '--with-hook=yp.conf' '')
-               $(usex kernel_linux '--rundir=${EPREFIX}/run' '')
+               --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd")
                $(usex privsep '--privsepuser=dhcpcd' '')
                $(usex udev '' '--without-dev --without-udev')
                CC="$(tc-getCC)"
@@ -56,8 +56,8 @@ src_configure() {
 src_install() {
        default
        keepdir /var/lib/dhcpcd
-       newinitd "${FILESDIR}"/${PN}.initd ${PN}
-       systemd_dounit "${FILESDIR}"/${PN}.service
+       newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd
+       systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service
 }
 
 pkg_postinst() {
index 9656eabee928b2784c254ff214f14da77f97dfe8..ac18c5907ad88b3a8e0f6d741f3800bdd4c3ce66 100644 (file)
@@ -45,7 +45,7 @@ src_configure() {
                $(use_enable ipv6)
                $(use_enable privsep)
                $(usex elibc_glibc '--with-hook=yp.conf' '')
-               $(usex kernel_linux '--rundir=${EPREFIX}/run' '')
+               --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd")
                $(usex privsep '--privsepuser=dhcpcd' '')
                $(usex udev '' '--without-dev --without-udev')
                CC="$(tc-getCC)"
@@ -56,8 +56,8 @@ src_configure() {
 src_install() {
        default
        keepdir /var/lib/dhcpcd
-       newinitd "${FILESDIR}"/${PN}.initd ${PN}
-       systemd_dounit "${FILESDIR}"/${PN}.service
+       newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd
+       systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service
 }
 
 pkg_postinst() {
diff --git a/net-misc/dhcpcd/files/dhcpcd.initd-r1 b/net-misc/dhcpcd/files/dhcpcd.initd-r1
new file mode 100644 (file)
index 0000000..5a87235
--- /dev/null
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 2007-2008 Roy Marples <roy@marples.name>
+# All rights reserved. Released under the 2-clause BSD license.
+
+command=${RC_PREFIX}/sbin/dhcpcd
+pidfile=${RC_PREFIX}/var/run/dhcpcd/pid
+command_args=-q
+name="DHCP Client Daemon"
+
+depend()
+{
+       provide net
+       need localmount
+       use logger network
+       after bootmisc modules
+       before dns
+}
diff --git a/net-misc/dhcpcd/files/dhcpcd.service-r1 b/net-misc/dhcpcd/files/dhcpcd.service-r1
new file mode 100644 (file)
index 0000000..b4309c3
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=Lightweight DHCP client daemon
+Wants=network.target
+Before=network.target network-online.target
+
+[Service]
+Type=forking
+ExecStart=/sbin/dhcpcd -q
+PIDFile=/run/dhcpcd/pid
+# Avoid duplicate output on stderr/syslog
+StandardOutput=null
+StandardError=null
+
+[Install]
+WantedBy=multi-user.target