odhcpd: update to latest git HEAD (FS#1853)
[oweals/openwrt.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:=3
12 PKG_VERSION:=1.12
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
16 PKG_SOURCE_DATE:=2018-10-07
17 PKG_SOURCE_VERSION:=57f639e3b0288c2ec12cdfb8598a182293746a0a
18 PKG_MIRROR_HASH:=2cf81f6044ac3a325481c3f0a754773c74fca6fb5cf3a44d4105e43df47cdbf8
19
20 PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
21 PKG_LICENSE:=GPL-2.0
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
24
25 PKG_INSTALL:=1
26 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/cmake.mk
30
31 define Package/odhcpd/default
32   SECTION:=net
33   CATEGORY:=Network
34   TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay
35   DEPENDS:=+libubox +libuci +libubus +libnl-tiny
36 endef
37
38 define Package/odhcpd/default/description
39  odhcpd is a daemon for serving and relaying IP management protocols to
40  configure clients and downstream routers. It tries to follow the RFC 6204
41  requirements for IPv6 home routers.
42 endef
43
44 define Package/odhcpd/default/config
45 menu "Configuration"
46         depends on PACKAGE_$(1)
47
48 config PACKAGE_odhcpd_$(2)_ext_cer_id
49         int
50         default 0
51         prompt "CER-ID Extension ID (0 = disabled)"
52 endmenu
53 endef
54
55 define Package/odhcpd
56   $(call Package/odhcpd/default)
57   TITLE += and DHCPv4 server
58   VARIANT:=full
59 endef
60
61 Package/odhcpd/config=$(call Package/odhcpd/default/config,odhcpd,full)
62
63 define Package/odhcpd/description
64  $(call Package/odhcpd/default/description)
65
66  This is a variant providing server services for DHCPv4, RA, stateless and
67  stateful DHCPv6,  prefix delegation and can be used to relay RA, DHCPv6 and
68  NDP between routed (non-bridged) interfaces in case no delegated prefixes
69  are available.
70 endef
71
72 define Package/odhcpd-ipv6only
73   $(call Package/odhcpd/default)
74   VARIANT:=ipv6only
75   DEPENDS+= @IPV6
76 endef
77
78 Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only)
79
80 define Package/odhcpd-ipv6only/description
81  $(call Package/odhcpd/default/description)
82
83  This is a variant providing server services for RA, stateless and stateful
84  DHCPv6,  prefix delegation and can be used to relay RA, DHCPv6 and NDP between
85  routed (non-bridged) interfaces in case no delegated prefixes are available.
86 endef
87
88 CMAKE_OPTIONS += -DUBUS=1
89
90 ifeq ($(BUILD_VARIANT),full)
91   CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1
92 endif
93
94 ifneq ($(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id),0)
95   CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id)
96 endif
97
98 define Package/odhcpd/install
99         $(INSTALL_DIR) $(1)/usr/sbin/
100         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/
101         $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/
102         $(INSTALL_DIR) $(1)/etc/init.d
103         $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd
104         $(INSTALL_DIR) $(1)/etc/uci-defaults
105         $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults
106 endef
107
108 Package/odhcpd-ipv6only/install = $(Package/odhcpd/install)
109
110 $(eval $(call BuildPackage,odhcpd))
111 $(eval $(call BuildPackage,odhcpd-ipv6only))