odhcpd: update to latest git HEAD (make dhcpv4 support optional)
[openwrt/staging/lynxis.git] / package / network / services / odhcpd / Makefile
1 #
2 # Copyright (C) 2013-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=odhcpd
11 PKG_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git
15 PKG_SOURCE_DATE:=2017-11-09
16 PKG_SOURCE_VERSION:=fd80621fea5cafcdca3f7fe762fede374a66e4b2
17 PKG_MIRROR_HASH:=150683aa71021b5721ca177b4d0449c3e2bbf7ee696aafde0229c81e5ce50f00
18
19 PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
20 PKG_LICENSE:=GPL-2.0
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/cmake.mk
24
25 CMAKE_OPTIONS += -DUBUS=1
26
27 define Package/odhcpd
28 SECTION:=net
29 CATEGORY:=Network
30 TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay
31 DEPENDS:=+libubox +libuci +libubus +libnl-tiny
32 endef
33
34 define Package/odhcpd/config
35 menu "Configuration"
36 depends on PACKAGE_odhcpd
37
38 config PACKAGE_odhcpd_ext_cer_id
39 int
40 default 0
41 prompt "CER-ID Extension ID (0 = disabled)"
42
43 config PACKAGE_odhcpd_dhcpv4_support
44 bool
45 default n
46 prompt "Enable DHCPv4 server support"
47 endmenu
48 endef
49
50 ifneq ($(CONFIG_PACKAGE_odhcpd_ext_cer_id),0)
51 CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_ext_cer_id)
52 endif
53
54 ifeq ($(CONFIG_PACKAGE_odhcpd_dhcpv4_support),y)
55 CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1
56 endif
57
58
59 define Package/odhcpd/description
60 odhcpd is a daemon for serving and relaying IP management protocols to
61 configure clients and downstream routers. It tries to follow the RFC 6204
62 requirements for IPv6 home routers.
63
64 odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6,
65 prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed
66 (non-bridged) interfaces in case no delegated prefixes are available.
67 endef
68
69 define Package/odhcpd/install
70 $(INSTALL_DIR) $(1)/usr/sbin/
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcpd $(1)/usr/sbin/
72 $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/
73 $(INSTALL_DIR) $(1)/etc/init.d
74 $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd
75 $(INSTALL_DIR) $(1)/etc/uci-defaults
76 $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults
77 endef
78
79 $(eval $(call BuildPackage,odhcpd))