2 # Copyright (C) 2006-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
16 PKG_MD5SUM:=00f5ee66b4e4b7f14538bf62ae3c9461
19 PKG_LICENSE_FILES:=COPYING
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \
26 CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \
27 CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \
28 CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \
29 CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack
31 include $(INCLUDE_DIR)/package.mk
33 define Package/dnsmasq/Default
36 TITLE:=DNS and DHCP server
37 URL:=http://www.thekelleys.org.uk/dnsmasq/
38 USERID:=dnsmasq=453:dnsmasq=453
41 define Package/dnsmasq
42 $(call Package/dnsmasq/Default)
46 define Package/dnsmasq-dhcpv6
47 $(call Package/dnsmasq/Default)
48 TITLE += (with DHCPv6 support)
53 define Package/dnsmasq-full
54 $(call Package/dnsmasq/Default)
55 TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack enabled by default)
56 DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \
57 +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \
58 +PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack
62 define Package/dnsmasq/description
63 It is intended to provide coupled DNS and DHCP service to a LAN.
66 define Package/dnsmasq-dhcpv6/description
67 $(call Package/dnsmasq/description)
69 This is a variant with DHCPv6 support
72 define Package/dnsmasq-full/description
73 $(call Package/dnsmasq/description)
75 This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and
76 IPset, Conntrack support enabled by default.
79 define Package/dnsmasq/conffiles
84 define Package/dnsmasq-full/config
85 if PACKAGE_dnsmasq-full
86 config PACKAGE_dnsmasq_full_dhcpv6
87 bool "Build with DHCPv6 support."
90 config PACKAGE_dnsmasq_full_dnssec
91 bool "Build with DNSSEC support."
93 config PACKAGE_dnsmasq_full_auth
94 bool "Build with the facility to act as an authoritative DNS server."
96 config PACKAGE_dnsmasq_full_ipset
97 bool "Build with IPset support."
99 config PACKAGE_dnsmasq_full_conntrack
100 bool "Build with Conntrack support."
105 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
106 Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
108 TARGET_CFLAGS += -ffunction-sections -fdata-sections
109 TARGET_LDFLAGS += -Wl,--gc-sections
111 COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6)
113 ifeq ($(BUILD_VARIANT),nodhcpv6)
117 ifeq ($(BUILD_VARIANT),full)
118 COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \
119 $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \
120 $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \
121 $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \
122 $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack),-DHAVE_CONNTRACK,)
123 COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,)
125 COPTS += -DNO_AUTH -DNO_IPSET
129 $(TARGET_CONFIGURE_OPTS) \
130 CFLAGS="$(TARGET_CFLAGS)" \
131 LDFLAGS="$(TARGET_LDFLAGS)" \
135 define Package/dnsmasq/install
136 $(INSTALL_DIR) $(1)/usr/sbin
137 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnsmasq $(1)/usr/sbin/
138 $(INSTALL_DIR) $(1)/etc/config
139 $(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
140 $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
141 $(INSTALL_DIR) $(1)/etc/init.d
142 $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
143 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
144 $(INSTALL_DATA) ./files/dnsmasq.hotplug $(1)/etc/hotplug.d/iface/25-dnsmasq
147 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
149 define Package/dnsmasq-full/install
150 $(call Package/dnsmasq/install,$(1))
151 ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec),)
152 $(INSTALL_DIR) $(1)/usr/share/dnsmasq
153 $(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf $(1)/usr/share/dnsmasq
157 $(eval $(call BuildPackage,dnsmasq))
158 $(eval $(call BuildPackage,dnsmasq-dhcpv6))
159 $(eval $(call BuildPackage,dnsmasq-full))