summaryrefslogtreecommitdiff
path: root/package/dnsmasq
diff options
context:
space:
mode:
Diffstat (limited to 'package/dnsmasq')
-rw-r--r--package/dnsmasq/Config.in11
-rw-r--r--package/dnsmasq/Makefile31
-rw-r--r--package/dnsmasq/files/dnsmasq.conf39
-rw-r--r--package/dnsmasq/files/dnsmasq.init26
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.conffiles1
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.control4
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.postinst7
-rw-r--r--package/dnsmasq/patches/patch-src_config_h23
8 files changed, 142 insertions, 0 deletions
diff --git a/package/dnsmasq/Config.in b/package/dnsmasq/Config.in
new file mode 100644
index 000000000..0fd2a5ce0
--- /dev/null
+++ b/package/dnsmasq/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_DNSMASQ
+ prompt "dnsmasq........................... Lightweight DNS and DHCP server"
+ tristate
+ default n
+ help
+ A lightweight DNS and DHCP server. It is intended to
+ provide coupled DNS and DHCP service to a LAN. Dnsmasq
+ supports static and dynamic DHCP leases and BOOTP/TFTP for
+ network booting of diskless machines.
+
+ http://www.thekelleys.org.uk/dnsmasq/
diff --git a/package/dnsmasq/Makefile b/package/dnsmasq/Makefile
new file mode 100644
index 000000000..11c9669a8
--- /dev/null
+++ b/package/dnsmasq/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dnsmasq
+PKG_VERSION:= 2.47
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4524081e56d0b935717d493e8e8d3e11
+MASTER_SITES:= http://thekelleys.org.uk/dnsmasq/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DNSMASQ,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE= manual
+MAKE_FLAGS+= BINDIR=/usr/sbin MANDIR=/usr/man COPTS="${TCFLAGS}"
+ifneq ($(ADK_IPV6),y)
+MAKE_FLAGS+= COPTS="${TCFLAGS} -DNO_IPV6"
+endif
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_DNSMASQ}/{etc/init.d,usr/sbin}
+ ${INSTALL_BIN} ${WRKBUILD}/src/dnsmasq ${IDIR_DNSMASQ}/usr/sbin/
+ ${INSTALL_DATA} files/dnsmasq.conf ${IDIR_DNSMASQ}/etc/dnsmasq.conf
+ ${INSTALL_BIN} files/dnsmasq.init ${IDIR_DNSMASQ}/etc/init.d/dnsmasq
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dnsmasq/files/dnsmasq.conf b/package/dnsmasq/files/dnsmasq.conf
new file mode 100644
index 000000000..086a0b7f7
--- /dev/null
+++ b/package/dnsmasq/files/dnsmasq.conf
@@ -0,0 +1,39 @@
+# filter what we send upstream
+user=dnsmasq
+domain-needed
+bogus-priv
+localise-queries
+
+# allow /etc/hosts and dhcp lookups via *.lan
+local=/lan/
+domain=lan
+expand-hosts
+
+# add more dhcp-range options for every subnet
+dhcp-range=192.168.1.129,192.168.1.254,255.255.255.0,72h
+interface=lo
+interface=eth0.0
+#interface=eth1
+interface=br0
+
+# Enable dnsmasq's built-in TFTP server
+#enable-tftp
+# Set the root directory for files available via TFTP.
+#tftp-root=/tftpboot
+
+dhcp-authoritative
+dhcp-leasefile=/tmp/dhcp.leases
+
+# use /etc/ethers for static hosts
+# <hwaddr> <ipaddr>
+#read-ethers
+
+# other useful options (0.0.0.0 means server itself)
+# default route(s):
+dhcp-option=3,0.0.0.0
+# DNS server(s):
+dhcp-option=6,0.0.0.0
+# NTP server(s):
+dhcp-option=42,0.0.0.0
+# WINS server(s):
+#dhcp-option=44,0.0.0.0
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
new file mode 100644
index 000000000..e92ad3acc
--- /dev/null
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+(autostop) ;;
+(autostart)
+ [[ $dns_dhcp = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/dnsmasq.conf ] || exit
+ /usr/sbin/dnsmasq
+ ;;
+(stop)
+ killall dnsmasq
+ ;;
+(restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+(*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/dnsmasq/ipkg/dnsmasq.conffiles b/package/dnsmasq/ipkg/dnsmasq.conffiles
new file mode 100644
index 000000000..e30eba8f6
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.conffiles
@@ -0,0 +1 @@
+/etc/dnsmasq.conf
diff --git a/package/dnsmasq/ipkg/dnsmasq.control b/package/dnsmasq/ipkg/dnsmasq.control
new file mode 100644
index 000000000..6f61edc65
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.control
@@ -0,0 +1,4 @@
+Package: dnsmasq
+Priority: essential
+Section: net
+Description: A lightweight DNS and DHCP server
diff --git a/package/dnsmasq/ipkg/dnsmasq.postinst b/package/dnsmasq/ipkg/dnsmasq.postinst
new file mode 100644
index 000000000..f2ff69e58
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+gid=$(get_next_gid)
+add_user dnsmasq $(get_next_uid) $gid /tmp
+add_group dnsmasq $gid
+add_rcconf dnsmasq dns_dhcp NO
diff --git a/package/dnsmasq/patches/patch-src_config_h b/package/dnsmasq/patches/patch-src_config_h
new file mode 100644
index 000000000..297097565
--- /dev/null
+++ b/package/dnsmasq/patches/patch-src_config_h
@@ -0,0 +1,23 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dnsmasq-2.47.orig/src/config.h 2009-02-05 13:14:24.000000000 +0100
++++ dnsmasq-2.47/src/config.h 2009-03-19 18:40:37.000000000 +0100
+@@ -45,7 +45,7 @@
+ # elif defined(__sun__) || defined (__sun)
+ # define LEASEFILE "/var/cache/dnsmasq.leases"
+ # else
+-# define LEASEFILE "/var/lib/misc/dnsmasq.leases"
++# define LEASEFILE "/tmp/dnsmasq.leases"
+ # endif
+ #endif
+
+@@ -282,8 +282,9 @@ typedef unsigned long in_addr_t;
+ /* We assume that systems which don't have IPv6
+ headers don't have ntop and pton either */
+
+-#if defined(INET6_ADDRSTRLEN) && defined(IPV6_V6ONLY) && !defined(NO_IPV6)
++#if defined(INET6_ADDRSTRLEN) && !defined(NO_IPV6)
+ # define HAVE_IPV6
++# define IPV6_V6ONLY 26
+ # define ADDRSTRLEN INET6_ADDRSTRLEN
+ # if defined(SOL_IPV6)
+ # define IPV6_LEVEL SOL_IPV6