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