firewall3 - a C implementation of the current firewall scripts
[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.62
12 PKG_RELEASE:=3
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_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:=A lightweight 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/description
48   It is intended to provide coupled DNS and DHCP service to a LAN.
49 endef
50
51 define Package/dnsmasq-dhcpv6/description
52 $(call Package/dnsmasq/description)
53
54 This is a variant with DHCPv6 support
55 endef
56
57 define Package/dnsmasq/conffiles
58 /etc/config/dhcp
59 /etc/dnsmasq.conf
60 endef
61
62 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
63
64 TARGET_CFLAGS += \
65         -ffunction-sections -fdata-sections \
66         $(if $(CONFIG_IPV6),,-DNO_IPV6)
67
68 ifeq ($(BUILD_VARIANT),nodhcpv6)
69   TARGET_CFLAGS += -DNO_DHCP6
70 endif
71
72 MAKE_FLAGS := \
73         $(TARGET_CONFIGURE_OPTS) \
74         CFLAGS="$(TARGET_CFLAGS)" \
75         LDFLAGS="-Wl,--gc-sections" \
76         PREFIX="/usr"
77
78 define Package/dnsmasq/install
79         $(INSTALL_DIR) $(1)/usr/sbin
80         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnsmasq $(1)/usr/sbin/
81         $(INSTALL_DIR) $(1)/etc/config
82         $(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
83         $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
84         $(INSTALL_DIR) $(1)/etc/init.d
85         $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
86 endef
87
88 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
89
90 $(eval $(call BuildPackage,dnsmasq))
91 $(eval $(call BuildPackage,dnsmasq-dhcpv6))