blob: 5cf77fa0f677b529d265199df3be1556d5fcfecc [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001SECTION = "console/network"
2SUMMARY = "dhcpcd - a DHCP client"
3DESCRIPTION = "dhcpcd runs on your machine and silently configures your \
4 computer to work on the attached networks without trouble \
5 and mostly without configuration."
6
7HOMEPAGE = "http://roy.marples.name/projects/dhcpcd/"
8
9LICENSE = "BSD-2-Clause"
10LIC_FILES_CHKSUM = "file://LICENSE;md5=d148485768fe85b9f1072b186a7e9b4d"
11
12UPSTREAM_CHECK_URI = "https://roy.marples.name/downloads/dhcpcd/"
13
14SRC_URI = "https://roy.marples.name/downloads/${BPN}/${BPN}-${PV}.tar.xz \
15 file://0001-remove-INCLUDEDIR-to-prevent-build-issues.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060016 file://0001-20-resolv.conf-improve-the-sitation-of-working-with-.patch \
17 file://0001-privsep-Allow-getrandom-sysctl-for-newer-glibc.patch \
18 file://0002-privsep-Allow-newfstatat-syscall-as-well.patch \
Andrew Geisslereff27472021-10-29 15:35:00 -050019 file://dhcpcd.service \
20 file://dhcpcd@.service \
21 "
22
23SRC_URI[sha256sum] = "819357634efed1ea5cf44ec01b24d3d3f8852fec8b4249925dcc5667c54e376c"
24
25inherit pkgconfig autotools-brokensep systemd useradd
26
27SYSTEMD_SERVICE:${PN} = "dhcpcd.service"
28
29PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
30
31PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev"
32PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
33# ntp conflicts with chrony
34PACKAGECONFIG[ntp] = "--with-hook=ntp, , ,ntp"
35PACKAGECONFIG[chrony] = "--with-hook=ntp, , ,chrony"
36PACKAGECONFIG[ypbind] = "--with-eghook=yp, , ,ypbind-mt"
37
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000038# add option to override DBDIR location
39DBDIR ?= "${localstatedir}/lib/${BPN}"
40
Andrew Geisslereff27472021-10-29 15:35:00 -050041EXTRA_OECONF = "--enable-ipv4 \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000042 --dbdir=${DBDIR} \
Andrew Geisslereff27472021-10-29 15:35:00 -050043 --sbindir=${base_sbindir} \
44 --runstatedir=/run \
45 --enable-privsep \
46 --privsepuser=dhcpcd \
47 --with-hooks \
48 --with-eghooks \
49 "
50
51USERADD_PACKAGES = "${PN}"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000052USERADD_PARAM:${PN} = "--system -d ${DBDIR} -M -s /bin/false -U dhcpcd"
Andrew Geisslereff27472021-10-29 15:35:00 -050053
54do_install:append () {
55 # install systemd unit files
56 install -d ${D}${systemd_system_unitdir}
57 install -m 0644 ${WORKDIR}/dhcpcd*.service ${D}${systemd_system_unitdir}
58
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000059 chmod 700 ${D}${DBDIR}
60 chown dhcpcd:dhcpcd ${D}${DBDIR}
Andrew Geisslereff27472021-10-29 15:35:00 -050061}
62
63FILES:${PN}-dbg += "${libdir}/dhcpcd/dev/.debug"