2 # Copyright (C) 2006-2015 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.gz
15 PKG_SOURCE_URL
:=http
://thekelleys.org.uk
/dnsmasq
16 PKG_MD5SUM
:=cf82f81cf09ad3d47612985012240483
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
30 include $(INCLUDE_DIR
)/package.mk
32 define Package
/dnsmasq
/Default
35 TITLE
:=DNS and DHCP server
36 URL
:=http
://www.thekelleys.org.uk
/dnsmasq
/
39 define Package
/dnsmasq
40 $(call Package
/dnsmasq
/Default
)
44 define Package
/dnsmasq-dhcpv6
45 $(call Package
/dnsmasq
/Default
)
46 TITLE
+= (with DHCPv6 support
)
47 DEPENDS
:=@IPV6
+kmod-ipv6
51 define Package
/dnsmasq-full
52 $(call Package
/dnsmasq
/Default
)
53 TITLE
+= (with DNSSEC
, DHCPv6
, Auth DNS
, IPset enabled by default
)
54 DEPENDS
:=+PACKAGE_dnsmasq_full_dnssec
:libnettle \
55 +PACKAGE_dnsmasq_full_dhcpv6
:kmod-ipv6 \
56 +PACKAGE_dnsmasq_full_ipset
:kmod-ipt-ipset
60 define Package
/dnsmasq
/description
61 It is intended to provide coupled DNS and DHCP service to a LAN.
64 define Package
/dnsmasq-dhcpv6
/description
65 $(call Package
/dnsmasq
/description
)
67 This is a variant with DHCPv6 support
70 define Package
/dnsmasq-full
/description
71 $(call Package
/dnsmasq
/description
)
73 This is a fully configurable variant with DHCPv6
, DNSSEC
, Authroitative DNS and
74 IPset support enabled by default.
77 define Package
/dnsmasq
/conffiles
82 define Package
/dnsmasq-full
/config
83 if PACKAGE_dnsmasq-full
84 config PACKAGE_dnsmasq_full_dhcpv6
85 bool
"Build with DHCPv6 support."
88 config PACKAGE_dnsmasq_full_dnssec
89 bool
"Build with DNSSEC support."
91 config PACKAGE_dnsmasq_full_auth
92 bool
"Build with the facility to act as an authoritative DNS server."
94 config PACKAGE_dnsmasq_full_ipset
95 bool
"Build with IPset support."
100 Package
/dnsmasq-dhcpv6
/conffiles
= $(Package
/dnsmasq
/conffiles
)
101 Package
/dnsmasq-full
/conffiles
= $(Package
/dnsmasq
/conffiles
)
103 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
104 TARGET_LDFLAGS
+= -Wl
,--gc-sections
106 COPTS
= $(if
$(CONFIG_IPV6
),,-DNO_IPV6
)
108 ifeq ($(BUILD_VARIANT
),nodhcpv6
)
112 ifeq ($(BUILD_VARIANT
),full
)
113 COPTS
+= $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dhcpv6
),,-DNO_DHCP6
) \
114 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dnssec
),-DHAVE_DNSSEC
) \
115 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_auth
),,-DNO_AUTH
) \
116 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_ipset
),,-DNO_IPSET
)
117 COPTS
+= $(if
$(CONFIG_LIBNETTLE_MINI
),-DNO_GMP
,)
119 COPTS
+= -DNO_AUTH
-DNO_IPSET
123 $(TARGET_CONFIGURE_OPTS
) \
124 CFLAGS
="$(TARGET_CFLAGS)" \
125 LDFLAGS
="$(TARGET_LDFLAGS)" \
129 define Package
/dnsmasq
/install
130 $(INSTALL_DIR
) $(1)/usr
/sbin
131 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/dnsmasq
$(1)/usr
/sbin
/
132 $(INSTALL_DIR
) $(1)/etc
/config
133 $(INSTALL_DATA
) .
/files
/dhcp.conf
$(1)/etc
/config
/dhcp
134 $(INSTALL_DATA
) .
/files
/dnsmasq.conf
$(1)/etc
/dnsmasq.conf
135 $(INSTALL_DIR
) $(1)/etc
/init.d
136 $(INSTALL_BIN
) .
/files
/dnsmasq.init
$(1)/etc
/init.d
/dnsmasq
137 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
138 $(INSTALL_DATA
) .
/files
/dnsmasq.hotplug
$(1)/etc
/hotplug.d
/iface
/25-dnsmasq
141 Package
/dnsmasq-dhcpv6
/install = $(Package
/dnsmasq
/install)
143 define Package
/dnsmasq-full
/install
144 $(call Package
/dnsmasq
/install,$(1))
145 ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec
),)
146 $(INSTALL_DIR
) $(1)/usr
/share
/dnsmasq
147 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/trust-anchors.conf
$(1)/usr
/share
/dnsmasq
151 $(eval
$(call BuildPackage
,dnsmasq
))
152 $(eval
$(call BuildPackage
,dnsmasq-dhcpv6
))
153 $(eval
$(call BuildPackage
,dnsmasq-full
))