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