diff mbox series

[bug#68675] gnu: Add dhcpcd.

Message ID 026d5ef86d6351918ee989f48be225bd97490d4d.1706026000.git.soeren@soeren-tempel.net
State New
Headers show
Series [bug#68675] gnu: Add dhcpcd. | expand

Commit Message

Sören Tempel Jan. 23, 2024, 4:14 p.m. UTC
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/admin.scm (dhcpcd): new procedure.

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
---
 gnu/packages/admin.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index fcf05992d8..78a5bbd973 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1608,6 +1608,48 @@  (define-public isc-dhcp
       (license license:mpl2.0)
       (properties '((cpe-name . "dhcp"))))))
 
+(define-public dhcpcd
+  (package
+    (name "dhcpcd")
+    (version "10.0.6")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/NetworkConfiguration/dhcpcd")
+               (commit (string-append "v" version))))
+        (sha256
+         (base32 "07n7d5wsmy955i6l8rkcmxhgxjygj2cxgpw79id2hx9w41fbkl5l"))
+        (file-name (git-file-name name version))))
+    (native-inputs (list eudev))
+    (build-system gnu-build-system)
+    (arguments
+      (list
+        #:test-target "test"
+        #:configure-flags
+        #~(list "--enable-ipv6"
+                "--enable-privsep"
+                "--privsepuser=dhcpcd"
+                (string-append "--dbdir=" "/var/db/dhcpcd")
+                (string-append "--rundir=" "/var/run/dhcpcd")
+                "CC=gcc")
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'do-not-create-dbdir
+              (lambda _
+                (substitute* "src/Makefile"
+                  (("\\$\\{INSTALL\\} -m \\$\\{DBMODE\\} -d \\$\\{DESTDIR\\}\\$\\{DBDIR\\}") ""))))
+            (add-before 'build 'setenv
+              (lambda _
+                (setenv "HOST_SH" (string-append #$bash-minimal "/bin/sh")))))))
+    (home-page "https://roy.marples.name/projects/dhcpcd")
+    (synopsis "Feature-rich DHCP and DHCPv6 client.")
+    (description "Provides a DHCP and a DHCPv6 client.  Additionally,
+dhcpcd is also an IPv4LL (aka ZeroConf) client.  In layperson's terms,
+dhcpcd runs on your machine and silently configures your computer to work
+on the attached networks without trouble and mostly without configuration.")
+    (license license:bsd-2)))
+
 (define-public radvd
   (package
     (name "radvd")