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
11 PKG_UPSTREAM_VERSION
:=2.89
12 PKG_VERSION
:=$(subst test,~~
test,$(subst rc
,~rc
,$(PKG_UPSTREAM_VERSION
)))
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_UPSTREAM_VERSION
).
tar.xz
16 PKG_SOURCE_URL
:=https
://thekelleys.org.uk
/dnsmasq
/
17 PKG_HASH
:=02bd230346cf0b9d5909f5e151df168b2707103785eb616b56685855adebb609
20 PKG_LICENSE_FILES
:=COPYING
21 PKG_CPE_ID
:=cpe
:/a
:thekelleys
:dnsmasq
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_UPSTREAM_VERSION
)
28 PKG_ASLR_PIE_REGULAR
:=1
29 PKG_CONFIG_DEPENDS
:= CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dhcp \
30 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dhcpv6 \
31 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dnssec \
32 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_auth \
33 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_ipset \
34 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_nftset \
35 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_conntrack \
36 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_noid \
37 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_broken_rtc \
38 CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_tftp
40 include $(INCLUDE_DIR
)/package.mk
42 define Package
/dnsmasq
/Default
45 TITLE
:=DNS and DHCP server
46 URL
:=http
://www.thekelleys.org.uk
/dnsmasq
/
48 USERID
:=dnsmasq
=453:dnsmasq
=453
51 define Package
/dnsmasq
52 $(call Package
/dnsmasq
/Default
)
56 define Package
/dnsmasq-dhcpv6
57 $(call Package
/dnsmasq
/Default
)
58 TITLE
+= (with DHCPv6 support
)
64 define Package
/dnsmasq-full
65 $(call Package
/dnsmasq
/Default
)
66 TITLE
+= (with DNSSEC
, DHCPv6
, Auth DNS
, IPset
, Nftset
, Conntrack
, NO_ID enabled by default
)
67 DEPENDS
+=+PACKAGE_dnsmasq_full_dnssec
:libnettle \
68 +PACKAGE_dnsmasq_full_ipset
:kmod-ipt-ipset \
69 +PACKAGE_dnsmasq_full_conntrack
:libnetfilter-conntrack \
70 +PACKAGE_dnsmasq_full_nftset
:nftables-json
75 define Package
/dnsmasq
/description
76 It is intended to provide coupled DNS and DHCP service to a LAN.
79 define Package
/dnsmasq-dhcpv6
/description
80 $(call Package
/dnsmasq
/description
)
82 This is a variant with DHCPv6 support
85 define Package
/dnsmasq-full
/description
86 $(call Package
/dnsmasq
/description
)
88 This is a fully configurable variant with DHCPv4
, DHCPv6
, DNSSEC
, Authoritative DNS
89 and nftset
, Conntrack support
& NO_ID enabled by default.
92 define Package
/dnsmasq
/conffiles
98 define Package
/dnsmasq-full
/config
99 if PACKAGE_dnsmasq-full
100 config PACKAGE_dnsmasq_full_dhcp
101 bool
"Build with DHCP support."
103 config PACKAGE_dnsmasq_full_dhcpv6
104 bool
"Build with DHCPv6 support."
105 depends on IPV6
&& PACKAGE_dnsmasq_full_dhcp
107 config PACKAGE_dnsmasq_full_dnssec
108 bool
"Build with DNSSEC support."
110 config PACKAGE_dnsmasq_full_auth
111 bool
"Build with the facility to act as an authoritative DNS server."
113 config PACKAGE_dnsmasq_full_ipset
114 bool
"Build with IPset support."
116 config PACKAGE_dnsmasq_full_nftset
117 bool
"Build with Nftset support."
119 config PACKAGE_dnsmasq_full_nftset
120 bool
"Build with Nftset support."
122 config PACKAGE_dnsmasq_full_conntrack
123 bool
"Build with Conntrack support."
125 config PACKAGE_dnsmasq_full_noid
126 bool
"Build with NO_ID. (hide *.bind pseudo domain)"
128 config PACKAGE_dnsmasq_full_broken_rtc
129 bool
"Build with HAVE_BROKEN_RTC."
131 config PACKAGE_dnsmasq_full_tftp
132 bool
"Build with TFTP server support."
137 Package
/dnsmasq-dhcpv6
/conffiles
= $(Package
/dnsmasq
/conffiles
)
138 Package
/dnsmasq-full
/conffiles
= $(Package
/dnsmasq
/conffiles
)
140 COPTS
= -DHAVE_UBUS
-DHAVE_POLL_H \
141 $(if
$(CONFIG_IPV6
),,-DNO_IPV6
)
143 ifeq ($(BUILD_VARIANT
),nodhcpv6
)
147 ifeq ($(BUILD_VARIANT
),full
)
148 COPTS
+= $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dhcp
),,-DNO_DHCP
) \
149 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dhcpv6
),,-DNO_DHCP6
) \
150 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_dnssec
),-DHAVE_DNSSEC
) \
151 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_auth
),,-DNO_AUTH
) \
152 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_ipset
),,-DNO_IPSET
) \
153 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_nftset
),-DHAVE_NFTSET
,) \
154 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_conntrack
),-DHAVE_CONNTRACK
,) \
155 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_noid
),-DNO_ID
,) \
156 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_broken_rtc
),-DHAVE_BROKEN_RTC
) \
157 $(if
$(CONFIG_PACKAGE_dnsmasq_
$(BUILD_VARIANT
)_tftp
),,-DNO_TFTP
)
158 COPTS
+= $(if
$(CONFIG_LIBNETTLE_MINI
),-DNO_GMP
,)
160 COPTS
+= -DNO_AUTH
-DNO_IPSET
-DNO_ID
164 $(TARGET_CONFIGURE_OPTS
) \
165 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
166 LDFLAGS
="$(TARGET_LDFLAGS)" \
170 define Package
/dnsmasq
/install
171 $(INSTALL_DIR
) $(1)/usr
/sbin
172 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/dnsmasq
$(1)/usr
/sbin
/
173 $(INSTALL_DIR
) $(1)/etc
/config
174 $(INSTALL_CONF
) .
/files
/dhcp.conf
$(1)/etc
/config
/dhcp
175 $(INSTALL_CONF
) .
/files
/dnsmasq.conf
$(1)/etc
/dnsmasq.conf
176 $(INSTALL_DIR
) $(1)/etc
/init.d
177 $(INSTALL_BIN
) .
/files
/dnsmasq.init
$(1)/etc
/init.d
/dnsmasq
178 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/dhcp
179 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/neigh
180 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/ntp
181 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/tftp
182 $(INSTALL_DATA
) .
/files
/dnsmasqsec.hotplug
$(1)/etc
/hotplug.d
/ntp
/25-dnsmasqsec
183 $(INSTALL_DIR
) $(1)/usr
/share
/dnsmasq
184 $(INSTALL_CONF
) .
/files
/dhcpbogushostname.conf
$(1)/usr
/share
/dnsmasq
/
185 $(INSTALL_CONF
) .
/files
/rfc6761.conf
$(1)/usr
/share
/dnsmasq
/
186 $(INSTALL_DIR
) $(1)/usr
/lib
/dnsmasq
187 $(INSTALL_BIN
) .
/files
/dhcp-script.sh
$(1)/usr
/lib
/dnsmasq
/dhcp-script.sh
188 $(INSTALL_DIR
) $(1)/usr
/share
/acl.d
189 $(INSTALL_DATA
) .
/files
/dnsmasq_acl.json
$(1)/usr
/share
/acl.d
/
190 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
191 $(INSTALL_BIN
) .
/files
/50-dnsmasq-migrate-resolv-conf-auto.sh
$(1)/etc
/uci-defaults
192 $(INSTALL_BIN
) .
/files
/50-dnsmasq-migrate-ipset.sh
$(1)/etc
/uci-defaults
195 Package
/dnsmasq-dhcpv6
/install = $(Package
/dnsmasq
/install)
197 define Package
/dnsmasq-full
/install
198 $(call Package
/dnsmasq
/install,$(1))
199 ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec
),)
200 $(INSTALL_DIR
) $(1)/usr
/share
/dnsmasq
201 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/trust-anchors.conf
$(1)/usr
/share
/dnsmasq
205 $(eval
$(call BuildPackage
,dnsmasq
))
206 $(eval
$(call BuildPackage
,dnsmasq-dhcpv6
))
207 $(eval
$(call BuildPackage
,dnsmasq-full
))