1################################################################################
2#
3# dhcpcd
4#
5################################################################################
6
7DHCPCD_VERSION = 10.0.8
8DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.xz
9DHCPCD_SITE = https://github.com/NetworkConfiguration/dhcpcd/releases/download/v$(DHCPCD_VERSION)
10DHCPCD_DEPENDENCIES = host-pkgconf
11DHCPCD_LICENSE = BSD-2-Clause
12DHCPCD_LICENSE_FILES = LICENSE
13DHCPCD_CPE_ID_VALID = YES
14
15DHCPCD_CONFIG_OPTS = \
16	--libexecdir=/lib/dhcpcd \
17	--os=linux \
18	--privsepuser=dhcpcd
19
20DHCPCD_MAKE_OPTS = \
21	BINMODE=755
22
23ifeq ($(BR2_PACKAGE_DHCPCD_ENABLE_PRIVSEP),y)
24DHCPCD_CONFIG_OPTS += --enable-privsep
25else
26DHCPCD_CONFIG_OPTS += --disable-privsep
27endif
28
29ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
30DHCPCD_CONFIG_OPTS += --with-udev
31DHCPCD_DEPENDENCIES += udev
32else
33DHCPCD_CONFIG_OPTS += --without-udev
34endif
35
36ifeq ($(BR2_STATIC_LIBS),y)
37DHCPCD_CONFIG_OPTS += --enable-static
38endif
39
40ifeq ($(BR2_USE_MMU),)
41DHCPCD_CONFIG_OPTS += --disable-fork
42endif
43
44define DHCPCD_CONFIGURE_CMDS
45	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure $(DHCPCD_CONFIG_OPTS))
46endef
47
48define DHCPCD_BUILD_CMDS
49	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(DHCPCD_MAKE_OPTS) all
50endef
51
52define DHCPCD_INSTALL_TARGET_CMDS
53	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(DHCPCD_MAKE_OPTS) install DESTDIR=$(TARGET_DIR)
54endef
55
56# When network-manager is enabled together with dhcpcd, it will use
57# dhcpcd as a DHCP client, and will be in charge of running, so we
58# don't want the init script or service file to be installed.
59ifeq ($(BR2_PACKAGE_NETWORK_MANAGER),)
60define DHCPCD_INSTALL_INIT_SYSV
61	$(INSTALL) -m 755 -D package/dhcpcd/S41dhcpcd \
62		$(TARGET_DIR)/etc/init.d/S41dhcpcd
63endef
64
65define DHCPCD_INSTALL_INIT_SYSTEMD
66	$(INSTALL) -D -m 0644 package/dhcpcd/dhcpcd.service \
67		$(TARGET_DIR)/usr/lib/systemd/system/dhcpcd.service
68endef
69endif
70
71define DHCPCD_USERS
72	dhcpcd -1 dhcpcd -1 * - - - dhcpcd user
73endef
74
75# NOTE: Even though this package has a configure script, it is not generated
76# using the autotools, so we have to use the generic package infrastructure.
77
78$(eval $(generic-package))
79