[OpenWrt-Devel] [PATCH v3] dnsmasq: allow de-selecting features from -full variant.

Yousong Zhou yszhou4tech at gmail.com
Wed Sep 17 09:22:01 EDT 2014


Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
v2 -> v3

    - Let the kconfig menu items depend on actual build variant selected.
    - Make features of -full variant selectable.

v1 -> v2

    Rebase it on the lastest trunk.

 package/network/services/dnsmasq/Makefile          |   26 ++++++++++++++++++--
 .../network/services/dnsmasq/files/dnsmasq.init    |    5 ++++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 17af3c5..1dc3adf 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.71
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
@@ -72,6 +72,25 @@ define Package/dnsmasq/conffiles
 /etc/dnsmasq.conf
 endef
 
+define Package/dnsmasq/config/Default
+  if PACKAGE_$(1)-$(2)
+  config PACKAGE_dnsmasq_$(2)_dhcpv6
+    bool "Build with DHCPv6 support."
+    default y
+  config PACKAGE_dnsmasq_$(2)_dnssec
+    bool "Build with DNSSEC support."
+    default y
+  config PACKAGE_dnsmasq_$(2)_auth
+    bool "Build with the facility to act as an authoritative DNS server."
+    default y
+  config PACKAGE_dnsmasq_$(2)_ipset
+    bool "Build with ipset support."
+    default y
+  endif
+endef
+
+Package/dnsmasq-full/config=$(call Package/dnsmasq/config/Default,dnsmasq,full)
+
 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
 Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
 
@@ -85,7 +104,10 @@ ifeq ($(BUILD_VARIANT),nodhcpv6)
 endif
 
 ifeq ($(BUILD_VARIANT),full)
-	COPTS += -DHAVE_DNSSEC
+	COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \
+		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \
+		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \
+		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET)
 	COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,)
 else
 	COPTS += -DNO_AUTH -DNO_IPSET
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 942acd7..209952b 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -85,6 +85,10 @@ append_address() {
 	xappend "--address=$1"
 }
 
+append_ipset() {
+	xappend "--ipset=$1"
+}
+
 append_interface() {
 	local ifname=$(uci_get_state network "$1" ifname "$1")
 	xappend "--interface=$ifname"
@@ -135,6 +139,7 @@ dnsmasq() {
 	append_parm "$cfg" "local" "--server"
 	config_list_foreach "$cfg" "server" append_server
 	config_list_foreach "$cfg" "address" append_address
+	config_list_foreach "$cfg" "ipset" append_ipset
 	config_list_foreach "$cfg" "interface" append_interface
 	config_list_foreach "$cfg" "notinterface" append_notinterface
 	config_list_foreach "$cfg" "addnhosts" append_addnhosts
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list