Patchwork [9/9] monit: Port to OE-lite from OpenEmbedded and upgrade from 4.x to 5.4

login
register
mail settings
Submitter Morten Svendsen
Date Oct. 17, 2012, 2:39 p.m.
Message ID <f019d93e9fa62d1e510f62b7da7ab9cba2fc9dcf.1350484529.git.morten.thunbergsvendsen@prevas.dk>
Download mbox | patch
Permalink /patch/192071/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Morten Svendsen - Oct. 17, 2012, 2:39 p.m.
---
 recipes/monit/files/monit      |   38 ++++++++++++++++++++++++++++++++++++++
 recipes/monit/monit.inc        |   28 ++++++++++++++++++++++++++++
 recipes/monit/monit_5.4.oe     |    1 +
 recipes/monit/monit_5.4.oe.sig |    1 +
 4 files changed, 68 insertions(+)
 create mode 100644 recipes/monit/files/monit
 create mode 100644 recipes/monit/monit.inc
 create mode 100644 recipes/monit/monit_5.4.oe
 create mode 100644 recipes/monit/monit_5.4.oe.sig

Patch

diff --git a/recipes/monit/files/monit b/recipes/monit/files/monit
new file mode 100644
index 0000000..a18bc2e
--- /dev/null
+++ b/recipes/monit/files/monit
@@ -0,0 +1,38 @@ 
+#! /bin/sh 
+#
+monit=/usr/bin/monit
+pidfile=/var/run/monit.pid
+monit_args="-c /etc/monitrc"
+
+test -x "$monit" || exit 0
+
+case "$1" in
+  start)
+    echo -n "Starting Monit"
+    start-stop-daemon --start --quiet --exec $monit -- $monit_args
+    RETVAL=$?
+    echo "."
+    ;;
+  stop)
+    echo -n "Stopping Monit"
+    start-stop-daemon --stop --quiet --pidfile $pidfile
+    RETVAL=$?
+    echo "."
+    ;;
+  restart)
+    $0 stop
+    $0 start
+    RETVAL=$?
+    ;;
+  status)
+    $monit $monit_args status
+    RETVAL=$?
+    echo "."
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|restart|status}"
+    exit 1
+esac
+
+exit $RETVAL
+
diff --git a/recipes/monit/monit.inc b/recipes/monit/monit.inc
new file mode 100644
index 0000000..371b064
--- /dev/null
+++ b/recipes/monit/monit.inc
@@ -0,0 +1,28 @@ 
+LICENSE = "AGPL-3.0"
+DEPENDS = "libssl libpthread libcrypto libdl libcrypt"
+RDEPENDS_${PN} = "libssl libpthread libcrypto libc libcrypt"
+inherit sysvinit
+
+SRC_URI = "http://www.tildeslash.com/monit/dist/monit-${PV}.tar.gz\
+	file://monit"
+
+RECIPE_FLAGS = "monit_sysvinit_start"
+DEFAULT_USE_monit_sysvinit_start = "99"
+
+inherit autotools-autoreconf
+
+# Workaround bug in monit config
+EXTRA_OECONF = "--with-ssl-lib-dir=${TARGET_SYSROOT}${libdir} --with-ssl-incl-dir=${TARGET_SYSROOT}${includedir}"
+
+EXTRA_OECONF =+ "--without-pam libmonit_cv_setjmp_available=yes libmonit_cv_vsnprintf_c99_conformant=yes"
+
+do_install[postfuncs] += "do_install_fix"
+do_install_fix() {
+	sysvinit_install_script ${SRCDIR}/monit
+        
+        #Delete lines with pam
+        sed -i '/allow.*@/d' ${S}/monitrc
+
+	install -m 600 ${S}/monitrc ${D}${sysconfdir}/monitrc
+	install -m 700 -d ${D}${sysconfdir}/monit.d/
+}
diff --git a/recipes/monit/monit_5.4.oe b/recipes/monit/monit_5.4.oe
new file mode 100644
index 0000000..070e4f7
--- /dev/null
+++ b/recipes/monit/monit_5.4.oe
@@ -0,0 +1 @@ 
+require monit.inc
diff --git a/recipes/monit/monit_5.4.oe.sig b/recipes/monit/monit_5.4.oe.sig
new file mode 100644
index 0000000..22d7fd6
--- /dev/null
+++ b/recipes/monit/monit_5.4.oe.sig
@@ -0,0 +1 @@ 
+d497ff61da9d30c286e2a2079538a802e02436c2  monit-5.4.tar.gz