[6/7] dnsmasq: New recipe
diff mbox

Message ID d89044e89d3ac89454cb9617451b9d5b6e04bd2e.1411365801.git.kibo@prevas.dk
State Rejected
Delegated to: Kim
Headers show

Commit Message

Kim B√łndergaard Sept. 22, 2014, 6:09 a.m. UTC
From: Kim B√łndergaard <kim@fam-boendergaard.dk>

---
 recipes/dnsmasq/dnsmasq.inc          | 25 +++++++++++++++++++++++++
 recipes/dnsmasq/dnsmasq_2.71.oe      |  2 ++
 recipes/dnsmasq/dnsmasq_2.71.oe.sig  |  1 +
 recipes/dnsmasq/files/dnsmasq        | 34 ++++++++++++++++++++++++++++++++++
 recipes/dnsmasq/files/makefile.patch | 11 +++++++++++
 5 files changed, 73 insertions(+)
 create mode 100644 recipes/dnsmasq/dnsmasq.inc
 create mode 100644 recipes/dnsmasq/dnsmasq_2.71.oe
 create mode 100644 recipes/dnsmasq/dnsmasq_2.71.oe.sig
 create mode 100755 recipes/dnsmasq/files/dnsmasq
 create mode 100644 recipes/dnsmasq/files/makefile.patch

Patch
diff mbox

diff --git a/recipes/dnsmasq/dnsmasq.inc b/recipes/dnsmasq/dnsmasq.inc
new file mode 100644
index 0000000..a4ed159
--- /dev/null
+++ b/recipes/dnsmasq/dnsmasq.inc
@@ -0,0 +1,25 @@ 
+DESCRIPTION = "dnsmasq"
+HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html"
+LICENSE = "GPL-3"
+
+SRC_URI = "http://www.thekelleys.org.uk/${PN}/${PN}-${PV}.tar.gz"
+SRC_URI += "file://dnsmasq"
+SRC_URI += "file://makefile.patch"
+
+inherit c make sysvinit pkgconfig
+
+RECIPE_FLAGS += "dnsmasq_sysvinit_start"
+DEFAULT_USE_dnsmasq_sysvinit_start = "97"
+DEFAULT_USE_dnsmasq_sysvinit_stop = "0"
+SYSVINIT_SCRIPT_dnsmasq = "dnsmasq"
+
+do_install[postfuncs] =+ " do_install_dnsmasq_extra"
+do_install_dnsmasq_extra() {
+        install -d 755 ${D}${bindir} ${D}${sysconfdir}/init.d
+
+        install -m 755 ${SRCDIR}/dnsmasq ${D}${sysconfdir}/init.d
+        #install -m 755 ${S}/src/dnsmasq ${D}${bindir}/
+        install -m 755 ${S}/dnsmasq.conf.example ${D}${sysconfdir}/
+}
+
+FILES_${PN} += " ${sysconfdir} ${bindir}"
diff --git a/recipes/dnsmasq/dnsmasq_2.71.oe b/recipes/dnsmasq/dnsmasq_2.71.oe
new file mode 100644
index 0000000..8a5b07c
--- /dev/null
+++ b/recipes/dnsmasq/dnsmasq_2.71.oe
@@ -0,0 +1,2 @@ 
+require dnsmasq.inc
+
diff --git a/recipes/dnsmasq/dnsmasq_2.71.oe.sig b/recipes/dnsmasq/dnsmasq_2.71.oe.sig
new file mode 100644
index 0000000..2cc94f0
--- /dev/null
+++ b/recipes/dnsmasq/dnsmasq_2.71.oe.sig
@@ -0,0 +1 @@ 
+b0a39f66557c966629a0ed9282cd87df8f409004  dnsmasq-2.71.tar.gz
diff --git a/recipes/dnsmasq/files/dnsmasq b/recipes/dnsmasq/files/dnsmasq
new file mode 100755
index 0000000..4dbece2
--- /dev/null
+++ b/recipes/dnsmasq/files/dnsmasq
@@ -0,0 +1,34 @@ 
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dnsmasq
+NAME=dnsmasq
+DESC="Dnsmasq - DNS server"
+OPTS=""
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	sleep 1
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/recipes/dnsmasq/files/makefile.patch b/recipes/dnsmasq/files/makefile.patch
new file mode 100644
index 0000000..5b62741
--- /dev/null
+++ b/recipes/dnsmasq/files/makefile.patch
@@ -0,0 +1,11 @@ 
+--- dnsmasq-2.71/Makefile.orig	2014-09-09 22:19:14.705703992 +0200
++++ dnsmasq-2.71/Makefile	2014-09-09 22:21:03.441706034 +0200
+@@ -18,7 +18,7 @@
+ 
+ # Variables you may well want to override.
+ 
+-PREFIX        = /usr/local
++PREFIX        = /usr
+ BINDIR        = $(PREFIX)/sbin
+ MANDIR        = $(PREFIX)/share/man
+ LOCALEDIR     = $(PREFIX)/share/locale