#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=monit
-PKG_VERSION:=4.6
+PKG_VERSION:=5.2.5
PKG_RELEASE:=1
-PKG_MD5SUM:=4e53aa44e4ca264e61c7c401cee4e697
-PKG_SOURCE_URL:=http://www.tildeslash.com/monit/dist/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_CAT:=zcat
+PKG_SOURCE_URL:=http://mmonit.com/monit/dist
+PKG_MD5SUM:=862fb7939ad6f73fc0cc82096c2309c7
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
-define Package/monit
+define Package/monit/Default
SECTION:=admin
CATEGORY:=Administration
- DEPENDS:=+libpthread +libopenssl
- TITLE:=System services monitoring utility, with SSL support
- DESCRIPTION:=An utility for monitoring services on a Unix system\\\
-This package is built with SSL support.\\\
- URL:=http://www.tildeslash.com/monit
+ DEPENDS:= +libpthread
+ TITLE:=System services monitoring utility
+ URL:=http://mmonit.com/monit/
endef
-define Package/monit/conffiles
-/etc/monitrc
+define Package/monit/Default/description
+ An utility for monitoring services on a Unix system
endef
-define Package/monit-nossl
- SECTION:=admin
- CATEGORY:=Administration
- TITLE:=System services monitoring utility, without SSL support
- DESCRIPTION:=An utility for monitoring services on a Unix system.\\\
-This package is built without SSL support.\\\
- URL:=http://www.tildeslash.com/monit
+define Package/monit
+$(call Package/monit/Default)
+ DEPENDS+= +libopenssl
+ TITLE+= (with SSL support)
+ VARIANT:=ssl
endef
-define Package/monit/conffiles
-/etc/monitrc
+define Package/monit/description
+$(call Package/monit/Default/description)
+ This package is built with SSL support.
endef
-define Build/Configure
-$(call Build/Configure/Default,--with-ssl \
- --with-ssl-dir="$(STAGING_DIR)/usr" \
-)
- $(MAKE) -C $(PKG_BUILD_DIR)
- mv $(PKG_BUILD_DIR)/monit $(PKG_BUILD_DIR)/monit-ssl
- $(MAKE) -C $(PKG_BUILD_DIR) clean
-$(call Build/Configure/Default,--without-ssl)
+define Package/monit-nossl
+$(call Package/monit/Default)
+ TITLE+= (without SSL support)
+ VARIANT:=nossl
endef
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- clean all
- mv $(PKG_BUILD_DIR)/monit $(PKG_BUILD_DIR)/monit-nossl
+define Package/monit-nossl/description
+$(call Package/monit/Default/description)
+ This package is built without SSL support.
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/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/monit-ssl $(1)/usr/sbin/monit
+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-nossl/install
+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/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/monit-nossl $(1)/usr/sbin/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))