OpenWrt – Blame information for rev 2
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | # |
2 | # Copyright (C) 2006-2016 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:=dnsmasq |
||
11 | PKG_UPSTREAM_VERSION:=2.80 |
||
12 | PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) |
||
13 | PKG_RELEASE:=11 |
||
14 | |||
15 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz |
||
16 | PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq |
||
17 | PKG_HASH:=cdaba2785e92665cf090646cba6f94812760b9d7d8c8d0cfb07ac819377a63bb |
||
18 | |||
19 | PKG_LICENSE:=GPL-2.0 |
||
20 | PKG_LICENSE_FILES:=COPYING |
||
21 | PKG_CPE_ID:=cpe:/a:thekelleys:dnsmasq |
||
22 | |||
23 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_UPSTREAM_VERSION) |
||
24 | |||
25 | PKG_INSTALL:=1 |
||
26 | PKG_BUILD_PARALLEL:=1 |
||
27 | PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \ |
||
28 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ |
||
29 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \ |
||
30 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \ |
||
31 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \ |
||
32 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack \ |
||
33 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_noid \ |
||
34 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_broken_rtc \ |
||
35 | CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_tftp |
||
36 | |||
37 | include $(INCLUDE_DIR)/package.mk |
||
38 | |||
39 | define Package/dnsmasq/Default |
||
40 | SECTION:=net |
||
41 | CATEGORY:=Base system |
||
42 | TITLE:=DNS and DHCP server |
||
43 | URL:=http://www.thekelleys.org.uk/dnsmasq/ |
||
44 | DEPENDS:=+libubus |
||
45 | USERID:=dnsmasq=453:dnsmasq=453 |
||
46 | endef |
||
47 | |||
48 | define Package/dnsmasq |
||
49 | $(call Package/dnsmasq/Default) |
||
50 | VARIANT:=nodhcpv6 |
||
51 | endef |
||
52 | |||
53 | define Package/dnsmasq-dhcpv6 |
||
54 | $(call Package/dnsmasq/Default) |
||
55 | TITLE += (with DHCPv6 support) |
||
56 | DEPENDS+=@IPV6 |
||
57 | VARIANT:=dhcpv6 |
||
58 | PROVIDES:=dnsmasq |
||
59 | endef |
||
60 | |||
61 | define Package/dnsmasq-full |
||
62 | $(call Package/dnsmasq/Default) |
||
63 | TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default) |
||
64 | DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \ |
||
65 | +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \ |
||
66 | +PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack |
||
67 | VARIANT:=full |
||
68 | PROVIDES:=dnsmasq |
||
69 | endef |
||
70 | |||
71 | define Package/dnsmasq/description |
||
72 | It is intended to provide coupled DNS and DHCP service to a LAN. |
||
73 | endef |
||
74 | |||
75 | define Package/dnsmasq-dhcpv6/description |
||
76 | $(call Package/dnsmasq/description) |
||
77 | |||
78 | This is a variant with DHCPv6 support |
||
79 | endef |
||
80 | |||
81 | define Package/dnsmasq-full/description |
||
82 | $(call Package/dnsmasq/description) |
||
83 | |||
84 | This is a fully configurable variant with DHCPv4, DHCPv6, DNSSEC, Authoritative DNS |
||
85 | and IPset, Conntrack support & NO_ID enabled by default. |
||
86 | endef |
||
87 | |||
88 | define Package/dnsmasq/conffiles |
||
89 | /etc/config/dhcp |
||
90 | /etc/dnsmasq.conf |
||
91 | endef |
||
92 | |||
93 | define Package/dnsmasq-full/config |
||
94 | if PACKAGE_dnsmasq-full |
||
95 | config PACKAGE_dnsmasq_full_dhcp |
||
96 | bool "Build with DHCP support." |
||
97 | default y |
||
98 | config PACKAGE_dnsmasq_full_dhcpv6 |
||
99 | bool "Build with DHCPv6 support." |
||
100 | depends on IPV6 && PACKAGE_dnsmasq_full_dhcp |
||
101 | default y |
||
102 | config PACKAGE_dnsmasq_full_dnssec |
||
103 | bool "Build with DNSSEC support." |
||
104 | default y |
||
105 | config PACKAGE_dnsmasq_full_auth |
||
106 | bool "Build with the facility to act as an authoritative DNS server." |
||
107 | default y |
||
108 | config PACKAGE_dnsmasq_full_ipset |
||
109 | bool "Build with IPset support." |
||
110 | default y |
||
111 | config PACKAGE_dnsmasq_full_conntrack |
||
112 | bool "Build with Conntrack support." |
||
113 | default y |
||
114 | config PACKAGE_dnsmasq_full_noid |
||
115 | bool "Build with NO_ID. (hide *.bind pseudo domain)" |
||
116 | default y |
||
117 | config PACKAGE_dnsmasq_full_broken_rtc |
||
118 | bool "Build with HAVE_BROKEN_RTC." |
||
119 | default n |
||
120 | config PACKAGE_dnsmasq_full_tftp |
||
121 | bool "Build with TFTP server support." |
||
122 | default y |
||
123 | endif |
||
124 | endef |
||
125 | |||
126 | Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles) |
||
127 | Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles) |
||
128 | |||
129 | TARGET_CFLAGS += -ffunction-sections -fdata-sections |
||
130 | TARGET_LDFLAGS += -Wl,--gc-sections |
||
131 | |||
132 | COPTS = -DHAVE_UBUS \ |
||
133 | $(if $(CONFIG_IPV6),,-DNO_IPV6) |
||
134 | |||
135 | ifeq ($(BUILD_VARIANT),nodhcpv6) |
||
136 | COPTS += -DNO_DHCP6 |
||
137 | endif |
||
138 | |||
139 | ifeq ($(BUILD_VARIANT),full) |
||
140 | COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp),,-DNO_DHCP) \ |
||
141 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ |
||
142 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \ |
||
143 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \ |
||
144 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \ |
||
145 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack),-DHAVE_CONNTRACK,) \ |
||
146 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_noid),-DNO_ID,) \ |
||
147 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_broken_rtc),-DHAVE_BROKEN_RTC) \ |
||
148 | $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_tftp),,-DNO_TFTP) |
||
149 | COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,) |
||
150 | else |
||
151 | COPTS += -DNO_AUTH -DNO_IPSET -DNO_ID |
||
152 | endif |
||
153 | |||
154 | MAKE_FLAGS := \ |
||
155 | $(TARGET_CONFIGURE_OPTS) \ |
||
156 | CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ |
||
157 | LDFLAGS="$(TARGET_LDFLAGS)" \ |
||
158 | COPTS="$(COPTS)" \ |
||
159 | PREFIX="/usr" |
||
160 | |||
161 | define Package/dnsmasq/install |
||
162 | $(INSTALL_DIR) $(1)/usr/sbin |
||
163 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnsmasq $(1)/usr/sbin/ |
||
164 | $(INSTALL_DIR) $(1)/etc/config |
||
165 | $(INSTALL_CONF) ./files/dhcp.conf $(1)/etc/config/dhcp |
||
166 | $(INSTALL_CONF) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf |
||
167 | $(INSTALL_DIR) $(1)/etc/init.d |
||
168 | $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq |
||
169 | $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp |
||
170 | $(INSTALL_DIR) $(1)/etc/hotplug.d/neigh |
||
171 | $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp |
||
172 | $(INSTALL_DIR) $(1)/etc/hotplug.d/tftp |
||
173 | $(INSTALL_CONF) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec |
||
174 | $(INSTALL_DIR) $(1)/usr/share/dnsmasq |
||
175 | $(INSTALL_CONF) ./files/dhcpbogushostname.conf $(1)/usr/share/dnsmasq/ |
||
176 | $(INSTALL_CONF) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/ |
||
177 | $(INSTALL_DIR) $(1)/usr/lib/dnsmasq |
||
178 | $(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh |
||
179 | $(INSTALL_DIR) $(1)/usr/share/acl.d |
||
180 | $(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/ |
||
181 | endef |
||
182 | |||
183 | Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install) |
||
184 | |||
185 | define Package/dnsmasq-full/install |
||
186 | $(call Package/dnsmasq/install,$(1)) |
||
187 | ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec),) |
||
188 | $(INSTALL_DIR) $(1)/usr/share/dnsmasq |
||
189 | $(INSTALL_CONF) $(PKG_BUILD_DIR)/trust-anchors.conf $(1)/usr/share/dnsmasq |
||
190 | endif |
||
191 | endef |
||
192 | |||
193 | $(eval $(call BuildPackage,dnsmasq)) |
||
194 | $(eval $(call BuildPackage,dnsmasq-dhcpv6)) |
||
195 | $(eval $(call BuildPackage,dnsmasq-full)) |