7e06ec1720d753fa1c8770a09bb35a0c62e01af6
[openwrt/staging/chunkeey.git] / package / dnsmasq / Makefile
1 #
2 # Copyright (C) 2006-2012 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.62
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:=f47e5cb8f5bac6343f24b2dbe317ab40
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/dnsmasq/Default
25 SECTION:=net
26 CATEGORY:=Base system
27 TITLE:=A lightweight DNS and DHCP server
28 URL:=http://www.thekelleys.org.uk/dnsmasq/
29 endef
30
31 define Package/dnsmasq
32 $(call Package/dnsmasq/Default)
33 VARIANT:=nodhcpv6
34 endef
35
36 define Package/dnsmasq-dhcpv6
37 $(call Package/dnsmasq/Default)
38 TITLE += (with DHCPv6 support)
39 DEPENDS:=@IPV6 +kmod-ipv6
40 VARIANT:=dhcpv6
41 endef
42
43 define Package/dnsmasq/description
44 It is intended to provide coupled DNS and DHCP service to a LAN.
45 endef
46
47 define Package/dnsmasq-dhcpv6/description
48 $(call Package/dnsmasq/description)
49
50 This is a variant with DHCPv6 support
51 endef
52
53 define Package/dnsmasq/conffiles
54 /etc/config/dhcp
55 /etc/dnsmasq.conf
56 endef
57
58 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
59
60 TARGET_CFLAGS += \
61 -ffunction-sections -fdata-sections \
62 $(if $(CONFIG_IPV6),,-DNO_IPV6)
63
64 ifeq ($(BUILD_VARIANT),nodhcpv6)
65 TARGET_CFLAGS += -DNO_DHCP6
66 endif
67
68 MAKE_FLAGS := \
69 $(TARGET_CONFIGURE_OPTS) \
70 CFLAGS="$(TARGET_CFLAGS)" \
71 LDFLAGS="-Wl,--gc-sections" \
72 PREFIX="/usr"
73
74 define Package/dnsmasq/install
75 $(INSTALL_DIR) $(1)/usr/sbin
76 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnsmasq $(1)/usr/sbin/
77 $(INSTALL_DIR) $(1)/etc/config
78 $(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
79 $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
80 $(INSTALL_DIR) $(1)/etc/init.d
81 $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
82 endef
83
84 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
85
86 $(eval $(call BuildPackage,dnsmasq))
87 $(eval $(call BuildPackage,dnsmasq-dhcpv6))