This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dnsmasq.mk
95 lines (78 loc) · 3.04 KB
/
dnsmasq.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# dnsmasq.mk
# Jose Luis Duran June 2009
#
# Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
# server. It is designed to provide DNS, and optionally DHCP, to a small
# network. It can serve the names of local machines which are not in the
# global DNS. The DHCP server integrates with the DNS server and allows
# machines with DHCP-allocated addresses to appear in the DNS with names
# configured either in each host or in a central configuration file.
# Dnsmasq supports static and dynamic DHCP leases and BOOTP/TFTP/PXE for
# network booting of diskless machines.
#
# To make dnsmasq:
# $ make -f dnsmasq.mk dnsmasq-package
include rules.mk
DNSMASQ_VERSION=2.49
DNSMASQ_SITE=http://thekelleys.org.uk/dnsmasq
DNSMASQ_SOURCE=dnsmasq-$(DNSMASQ_VERSION).tar.gz
DNSMASQ_DIR=$(BUILD_DIR)/dnsmasq-$(DNSMASQ_VERSION)
TARGET_DIR=$(BUILD_DIR)/tmp/dnsmasq/ipkg/dnsmasq
PKG_NAME:=dnsmasq
PKG_VERSION:=$(DNSMASQ_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/dnsmasq
DNSMASQ_COPTS=-DNO_IPV6 -DNO_TFTP -DNO_LARGEFILE -DHAVE_BROKEN_RTC \
-D__uClinux__
$(DL_DIR)/$(DNSMASQ_SOURCE):
mkdir -p dl
wget -P $(DL_DIR) $(DNSMASQ_SITE)/$(DNSMASQ_SOURCE)
$(DNSMASQ_DIR)/.unpacked: $(DL_DIR)/$(DNSMASQ_SOURCE)
zcat $(DL_DIR)/$(DNSMASQ_SOURCE) | tar -C $(BUILD_DIR) -xf -
touch $(DNSMASQ_DIR)/.unpacked
dnsmasq: $(DNSMASQ_DIR)/.unpacked
make -C $(DNSMASQ_DIR) CC=bfin-linux-uclibc-gcc \
COPTS='$(DNSMASQ_COPTS)' \
BINDIR=/bin DESTDIR=$(TARGET_DIR) install
mkdir -p $(TARGET_DIR)/var/lib/misc
mkdir -p $(TARGET_DIR)/etc/init.d
rm -rf $(TARGET_DIR)/usr
cp -f $(DNSMASQ_DIR)/dnsmasq.conf.example $(TARGET_DIR)/etc/dnsmasq.conf
cp files/dnsmasq.init $(TARGET_DIR)/etc/init.d/dnsmasq
chmod u+x $(TARGET_DIR)/etc/init.d/dnsmasq
touch $(PKG_BUILD_DIR)/.built
all: dnsmasq
dnsmasq-dirclean:
rm -rf $(DNSMASQ_DIR)
rm -rf $(TOPDIR)/tmp/$(PKG_NAME)
#--------------------------------------------------------------------------
# CREATING PACKAGE
#--------------------------------------------------------------------------
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Dnsmasq
DESCRIPTION:=\
Dnsmasq is a lightweight, easy to configure DNS forwarder and \\\
DHCP server. It is designed to provide DNS, and optionally DHCP, \\\
to a small network. It can serve the names of local machines \\\
which are not in the global DNS. The DHCP server integrates with \\\
the DNS server and allows machines with DHCP-allocated addresses \\\
to appear in the DNS with names configured either in each host \\\
or in a central configuration file. Dnsmasq supports static and \\\
dynamic DHCP leases and BOOTP/TFTP/PXE for network booting of \\\
diskless machines.
URL:=http://thekelleys.org.uk/dnsmasq/doc.html
endef
# post installation
define Package/$(PKG_NAME)/postinst
#!/bin/sh
/etc/init.d/dnsmasq enable
endef
# pre-remove
define Package/$(PKG_NAME)/prerm
#!/bin/sh
/etc/init.d/dnsmasq disable
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
dnsmasq-package: dnsmasq $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk