dnsmasq: various house-keeping updates
[openwrt/openwrt.git] / package / network / services / dnsmasq / Makefile
1 #
2 # Copyright (C) 2006-2013 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_VERSION:=2.71
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
16 PKG_MD5SUM:=15a68f7f6cc0119e843f67d2f79598f1
17
18 PKG_LICENSE:=GPLv2
19 PKG_LICENSE_FILES:=COPYING
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/dnsmasq/Default
29 SECTION:=net
30 CATEGORY:=Base system
31 TITLE:=DNS and DHCP server
32 URL:=http://www.thekelleys.org.uk/dnsmasq/
33 endef
34
35 define Package/dnsmasq
36 $(call Package/dnsmasq/Default)
37 VARIANT:=nodhcpv6
38 endef
39
40 define Package/dnsmasq-dhcpv6
41 $(call Package/dnsmasq/Default)
42 TITLE += (with DHCPv6 support)
43 DEPENDS:=@IPV6 +kmod-ipv6
44 VARIANT:=dhcpv6
45 endef
46
47 define Package/dnsmasq-full
48 $(call Package/dnsmasq/Default)
49 TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPSET)
50 DEPENDS:=@IPV6 +kmod-ipv6 +libnettle
51 VARIANT:=full
52 endef
53
54 define Package/dnsmasq/description
55 It is intended to provide coupled DNS and DHCP service to a LAN.
56 endef
57
58 define Package/dnsmasq-dhcpv6/description
59 $(call Package/dnsmasq/description)
60
61 This is a variant with DHCPv6 support
62 endef
63
64 define Package/dnsmasq-full/description
65 $(call Package/dnsmasq/description)
66
67 This is a variant with DHCPv6, DNSSEC, Authroitative DNS and IPSET support
68 endef
69
70 define Package/dnsmasq/conffiles
71 /etc/config/dhcp
72 /etc/dnsmasq.conf
73 endef
74
75 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
76 Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
77
78 TARGET_CFLAGS += -ffunction-sections -fdata-sections
79 TARGET_LDFLAGS += -Wl,--gc-sections
80
81 COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6)
82
83 ifeq ($(BUILD_VARIANT),nodhcpv6)
84 COPTS += -DNO_DHCP6
85 endif
86
87 ifeq ($(BUILD_VARIANT),full)
88 COPTS += -DHAVE_DNSSEC
89 COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,)
90 else
91 COPTS += -DNO_AUTH -DNO_IPSET
92 endif
93
94 MAKE_FLAGS := \
95 $(TARGET_CONFIGURE_OPTS) \
96 CFLAGS="$(TARGET_CFLAGS)" \
97 LDFLAGS="$(TARGET_LDFLAGS)" \
98 COPTS="$(COPTS)" \
99 PREFIX="/usr"
100
101 define Package/dnsmasq/install
102 $(INSTALL_DIR) $(1)/usr/sbin
103 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnsmasq $(1)/usr/sbin/
104 $(INSTALL_DIR) $(1)/etc/config
105 $(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
106 $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
107 $(INSTALL_DIR) $(1)/etc/init.d
108 $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
109 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
110 $(INSTALL_DATA) ./files/dnsmasq.hotplug $(1)/etc/hotplug.d/iface/25-dnsmasq
111 endef
112
113 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
114
115 define Package/dnsmasq-full/install
116 $(call Package/dnsmasq/install,$(1))
117 $(INSTALL_DIR) $(1)/usr/share/dnsmasq
118 $(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf $(1)/usr/share/dnsmasq
119 endef
120
121 $(eval $(call BuildPackage,dnsmasq))
122 $(eval $(call BuildPackage,dnsmasq-dhcpv6))
123 $(eval $(call BuildPackage,dnsmasq-full))