monit: import 5.6 (2013-09-03) from packages
authorEtienne CHAMPETIER <etienne.champetier@free.fr>
Tue, 10 Jun 2014 19:54:10 +0000 (21:54 +0200)
committerEtienne CHAMPETIER <etienne.champetier@free.fr>
Tue, 10 Jun 2014 22:59:06 +0000 (00:59 +0200)
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
admin/monit/Makefile [new file with mode: 0644]
admin/monit/files/monit.init [new file with mode: 0644]

diff --git a/admin/monit/Makefile b/admin/monit/Makefile
new file mode 100644 (file)
index 0000000..a6a4dfb
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=monit
+PKG_VERSION:=5.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://mmonit.com/monit/dist
+PKG_MD5SUM:=19dfc1ce8512e832134d06eedd96ba50
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/monit/Default
+  SECTION:=admin
+  CATEGORY:=Administration
+  DEPENDS:= +libpthread
+  TITLE:=System services monitoring utility
+  URL:=http://mmonit.com/monit/
+endef
+
+define Package/monit/Default/description
+       An utility for monitoring services on a Unix system
+endef
+
+define Package/monit
+$(call Package/monit/Default)
+  DEPENDS+= +libopenssl
+  TITLE+= (with SSL support)
+  VARIANT:=ssl
+endef
+
+define Package/monit/description
+$(call Package/monit/Default/description)
+       This package is built with SSL support.
+endef
+
+define Package/monit-nossl
+$(call Package/monit/Default)
+  TITLE+= (without SSL support)
+  VARIANT:=nossl
+endef
+
+define Package/monit-nossl/description
+$(call Package/monit/Default/description)
+       This package is built without SSL support.
+endef
+
+CONFIGURE_ARGS += \
+       --without-pam \
+       libmonit_cv_setjmp_available=yes \
+       libmonit_cv_vsnprintf_c99_conformant=yes
+
+ifeq ($(BUILD_VARIANT),ssl)
+       CONFIGURE_ARGS += \
+               --with-ssl \
+               --with-ssl-dir="$(STAGING_DIR)/usr"
+endif
+
+ifeq ($(BUILD_VARIANT),nossl)
+       CONFIGURE_ARGS += \
+               --without-ssl
+endif
+
+define Package/monit/conffiles
+/etc/monitrc
+endef
+
+define Package/monit/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/monitrc $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/monit.init $(1)/etc/init.d/monit
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/monit $(1)/usr/bin/
+endef
+
+Package/monit-nossl/conffiles = $(Package/monit/conffiles)
+Package/monit-nossl/install = $(Package/monit/install)
+
+$(eval $(call BuildPackage,monit))
+$(eval $(call BuildPackage,monit-nossl))
diff --git a/admin/monit/files/monit.init b/admin/monit/files/monit.init
new file mode 100644 (file)
index 0000000..b8a8ff8
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2013 OpenWrt.org
+
+START=60
+
+SERVICE_USE_PID=1
+
+start() {
+       [ -f /etc/monitrc ] || return 1
+       chmod 0600 /etc/monitrc
+       service_start /usr/bin/monit
+}
+
+stop() {
+       service_stop /usr/bin/monit
+}