modernize backfire 10.03 so it can be operational again
[openwrt-10.03/.git] / package / dnsmasq / Makefile
1
2 # Copyright (C) 2006-2011 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.76
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
16 PKG_MD5SUM:=00f5ee66b4e4b7f14538bf62ae3c9461
17
18 include $(INCLUDE_DIR)/package.mk
19
20 TARGET_CFLAGS += -ffunction-sections -fdata-sections
21 TARGET_LDFLAGS += -Wl,--gc-sections
22
23 COPTS = -DNO_IPV6 -DNO_DHCP6 -DNO_AUTH -DNO_IPSET -DNO_LARGEFILE -DNO_INOTIFY
24
25 MAKE_FLAGS := \
26         $(TARGET_CONFIGURE_OPTS) \
27         CFLAGS="$(TARGET_CFLAGS)" \
28         LDFLAGS="$(TARGET_LDFLAGS)" \
29         COPTS="$(COPTS)" \
30         PREFIX="/usr"
31
32 define Package/dnsmasq
33   SECTION:=net
34   CATEGORY:=Base system
35   TITLE:=A lightweight DNS and DHCP server
36   URL:=http://www.thekelleys.org.uk/dnsmasq/
37 endef
38
39 define Package/dnsmasq/description
40  It is intended to provide coupled DNS and DHCP service to a LAN.
41 endef
42
43 define Package/dnsmasq/conffiles
44 /etc/config/dhcp
45 /etc/dnsmasq.conf
46 endef
47
48 define Build/Compile
49         $(MAKE) -C $(PKG_BUILD_DIR) \
50                 $(MAKE_FLAGS) \
51                 $(TARGET_CONFIGURE_OPTS) \
52                 CFLAGS="$(TARGET_CFLAGS)" \
53                 BINDIR="/usr/sbin" MANDIR="/usr/man" \
54                 AWK="awk" \
55                 all
56 endef
57
58 define Package/dnsmasq/install
59         $(INSTALL_DIR) $(1)/usr/sbin
60         $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dnsmasq $(1)/usr/sbin/
61         $(INSTALL_DIR) $(1)/etc/config
62         $(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
63         $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
64         $(INSTALL_DIR) $(1)/etc/init.d
65         $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
66 endef
67
68 $(eval $(call BuildPackage,dnsmasq))