1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-13 19:03:52 +02:00
openwrt-packages/admin/monit/Makefile
Jeffery To 53e1692ae9 treewide: Use default PKG_BUILD_DIR when possible
This removes lines that set PKG_BUILD_DIR when the set value is no
different from the default value.

Specifically, the line is removed if the assigned value is:

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

  The default PKG_BUILD_DIR was updated[1] to incorporate BUILD_VARIANT
  if it is set, so now this is identical to the default value.

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)

  if PKG_SOURCE_SUBDIR is set to $(PKG_NAME)-$(PKG_VERSION), making it
  the same as the previous case

* $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

  This is the same as the default PKG_BUILD_DIR when there is no
  BUILD_VARIANT.

* $(BUILD_DIR)/[name]-$(PKG_VERSION)

  where [name] is a string that is identical to PKG_NAME

[1]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e545fac8d968864a965edb9e50c6f90940b0a6c9

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-10-13 02:01:34 +08:00

98 lines
2.2 KiB
Makefile

#
# 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.26.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://mmonit.com/monit/dist
PKG_HASH:=87fc4568a3af9a2be89040efb169e3a2e47b262f99e78d5ddde99dd89f02f3c2
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:tildeslash:monit
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/monit/Default
SECTION:=admin
CATEGORY:=Administration
DEPENDS:= +libpthread +zlib
TITLE:=System services monitoring utility
URL:=https://mmonit.com/monit/
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
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 \
ac_cv_ipv6=$(if $(CONFIG_IPV6),yes,no) \
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))