|
@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk |
|
|
|
|
|
|
|
|
PKG_NAME:=nut |
|
|
PKG_NAME:=nut |
|
|
PKG_VERSION:=2.7.4 |
|
|
PKG_VERSION:=2.7.4 |
|
|
PKG_RELEASE:=7 |
|
|
|
|
|
|
|
|
PKG_RELEASE:=8 |
|
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
|
|
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/ |
|
|
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/ |
|
|
PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7 |
|
|
PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7 |
|
|
PKG_MAINTAINER:=Daniel Dickinson <cshored@thecshore.com> |
|
|
PKG_MAINTAINER:=Daniel Dickinson <cshored@thecshore.com> |
|
|
PKG_LICENSE:=GPL-2.0 |
|
|
|
|
|
PKG_LICENSE_FILES:=LICENSE-GPL2 |
|
|
|
|
|
|
|
|
PKG_LICENSE:=GPL-2.0+ GPL-3.0+ GPL-1.0+ Artistic-1.0-Perl |
|
|
|
|
|
PKG_LICENSE_FILES:=LICENSE-GPL2 LICENSE-GPL3 COPYING |
|
|
PKG_FIXUP:=autoreconf |
|
|
PKG_FIXUP:=autoreconf |
|
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
|
@ -63,22 +63,32 @@ define Package/nut/install |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-server/install |
|
|
define Package/nut-server/install |
|
|
|
|
|
# Server portion |
|
|
$(INSTALL_DIR) $(1)/etc/nut |
|
|
$(INSTALL_DIR) $(1)/etc/nut |
|
|
$(INSTALL_DIR) $(1)/usr/sbin |
|
|
$(INSTALL_DIR) $(1)/usr/sbin |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_DIR) $(1)/usr/share/nut |
|
|
$(INSTALL_DIR) $(1)/usr/share/nut |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
|
|
|
$(INSTALL_BIN) ./files/nut-server.init $(1)/etc/init.d/nut-server |
|
|
$(INSTALL_BIN) ./files/nut-server.init $(1)/etc/init.d/nut-server |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin |
|
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/ |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/ |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/ |
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_CONF) ./files/nut_server $(1)/etc/config/nut_server |
|
|
$(INSTALL_CONF) ./files/nut_server $(1)/etc/config/nut_server |
|
|
ln -sf /var/etc/nut/nut.conf $(1)/etc/nut/nut.conf |
|
|
|
|
|
ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf |
|
|
|
|
|
ln -sf /var/etc/nut/upsd.users $(1)/etc/nut/upsd.users |
|
|
ln -sf /var/etc/nut/upsd.users $(1)/etc/nut/upsd.users |
|
|
ln -sf /var/etc/nut/upsd.conf $(1)/etc/nut/upsd.conf |
|
|
ln -sf /var/etc/nut/upsd.conf $(1)/etc/nut/upsd.conf |
|
|
|
|
|
# Driver common portion |
|
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin |
|
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/ |
|
|
|
|
|
ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf |
|
|
|
|
|
# Mangle libhid.usermap into a format (hotplug shell script) useful for OpenWrt |
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/hotplug.d/usb |
|
|
|
|
|
$(INSTALL_BIN) ./files/30-libhid-ups.head $(1)/etc/hotplug.d/usb/30-libhid-ups |
|
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/etc/hotplug/usb/libhid.usermap $(PKG_BUILD_DIR)/30-libhid-ups.middle |
|
|
|
|
|
$(SED) '/^$$$$/d' \
|
|
|
|
|
|
-e '/^#/d' \
|
|
|
|
|
|
-E -e 's:^[^ ][^ ]* *0x0003 *0x0{0,3}([^ ][^ ]*) *0x{0,3}*([^ ][^ ]*).*:\1/\2/* | \\:' \
|
|
|
|
|
|
$(PKG_BUILD_DIR)/30-libhid-ups.middle |
|
|
|
|
|
tail -n+2 $(PKG_BUILD_DIR)/30-libhid-ups.middle >>$(1)/etc/hotplug.d/usb/30-libhid-ups |
|
|
|
|
|
cat ./files/30-libhid-ups.tail >>$(1)/etc/hotplug.d/usb/30-libhid-ups |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-common |
|
|
define Package/nut-common |
|
@ -87,8 +97,7 @@ define Package/nut-common |
|
|
DEPENDS:= nut \
|
|
|
DEPENDS:= nut \
|
|
|
+NUT_DRIVER_SNMP:libnetsnmp \
|
|
|
+NUT_DRIVER_SNMP:libnetsnmp \
|
|
|
+NUT_DRIVER_USB:libusb-compat \
|
|
|
+NUT_DRIVER_USB:libusb-compat \
|
|
|
+NUT_SSL:libopenssl \
|
|
|
|
|
|
+PACKAGE_libwrap:libwrap |
|
|
|
|
|
|
|
|
+NUT_SSL:libopenssl |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-common/description |
|
|
define Package/nut-common/description |
|
@ -96,6 +105,10 @@ $(call Package/nut/description/Default) |
|
|
This package contains the common files. |
|
|
This package contains the common files. |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
|
|
|
define Package/nut-common/conffiles |
|
|
|
|
|
/etc/nut/nut.conf |
|
|
|
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-common/install |
|
|
define Package/nut-common/install |
|
|
$(INSTALL_DIR) $(1)/etc/nut |
|
|
$(INSTALL_DIR) $(1)/etc/nut |
|
|
$(INSTALL_DIR) $(1)/usr/lib |
|
|
$(INSTALL_DIR) $(1)/usr/lib |
|
@ -107,6 +120,7 @@ define Package/nut-server |
|
|
$(call Package/nut/Default) |
|
|
$(call Package/nut/Default) |
|
|
TITLE+= (server) |
|
|
TITLE+= (server) |
|
|
DEPENDS:=nut +nut-common |
|
|
DEPENDS:=nut +nut-common |
|
|
|
|
|
USERID:=nut=113:nut=113 |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-server/description |
|
|
define Package/nut-server/description |
|
@ -120,13 +134,16 @@ endef |
|
|
|
|
|
|
|
|
define Package/nut-server/conffiles |
|
|
define Package/nut-server/conffiles |
|
|
/etc/config/nut_server |
|
|
/etc/config/nut_server |
|
|
|
|
|
/etc/nut/upsd.conf |
|
|
|
|
|
/etc/nut/upsd.users |
|
|
|
|
|
/etc/nut/ups.conf |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-upsmon |
|
|
define Package/nut-upsmon |
|
|
$(call Package/nut/Default) |
|
|
$(call Package/nut/Default) |
|
|
TITLE+= (monitor) |
|
|
TITLE+= (monitor) |
|
|
DEPENDS:=nut +nut-common |
|
|
DEPENDS:=nut +nut-common |
|
|
USERID:=nut=113:nut=113 |
|
|
|
|
|
|
|
|
USERID:=nutmon=114:nutmon=114 |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-upsmon/description |
|
|
define Package/nut-upsmon/description |
|
@ -141,6 +158,7 @@ endef |
|
|
|
|
|
|
|
|
define Package/nut-upsmon/conffiles |
|
|
define Package/nut-upsmon/conffiles |
|
|
/etc/config/nut_monitor |
|
|
/etc/config/nut_monitor |
|
|
|
|
|
/etc/nut/upsmon.conf |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-upsmon/install |
|
|
define Package/nut-upsmon/install |
|
@ -149,6 +167,7 @@ define Package/nut-upsmon/install |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_BIN) ./files/nut-monitor.init $(1)/etc/init.d/nut-monitor |
|
|
$(INSTALL_BIN) ./files/nut-monitor.init $(1)/etc/init.d/nut-monitor |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/ |
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/ |
|
|
|
|
|
$(INSTALL_BIN) ./files/nutshutdown $(1)/usr/sbin/nutshutdown |
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_CONF) ./files/nut_monitor $(1)/etc/config/nut_monitor |
|
|
$(INSTALL_CONF) ./files/nut_monitor $(1)/etc/config/nut_monitor |
|
|
ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf |
|
|
ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf |
|
@ -182,7 +201,7 @@ define Package/nut-upsc/description |
|
|
$(call Package/nut/description/Default) |
|
|
$(call Package/nut/description/Default) |
|
|
upsc is provided as a quick way to poll the status of a UPS server. It |
|
|
upsc is provided as a quick way to poll the status of a UPS server. It |
|
|
can be used inside shell scripts and other programs that need UPS data |
|
|
can be used inside shell scripts and other programs that need UPS data |
|
|
but don not want to include the full interface. |
|
|
|
|
|
|
|
|
but do not want to include the full interface. |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-upsc/install |
|
|
define Package/nut-upsc/install |
|
@ -308,12 +327,15 @@ define Package/nut-web-cgi/install |
|
|
$(INSTALL_CONF) ./files/add_nut_httpd_conf $(1)/etc/uci-defaults/add_nut_httpd_conf |
|
|
$(INSTALL_CONF) ./files/add_nut_httpd_conf $(1)/etc/uci-defaults/add_nut_httpd_conf |
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html |
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html |
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html |
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html |
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf |
|
|
|
|
|
|
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.disable |
|
|
|
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.enable |
|
|
|
|
|
$(SED) 's/### \?//' $(1)/etc/nut/upsset.conf.enable |
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_DIR) $(1)/etc/config |
|
|
$(INSTALL_CONF) ./files/nut_cgi $(1)/etc/config/nut_cgi |
|
|
$(INSTALL_CONF) ./files/nut_cgi $(1)/etc/config/nut_cgi |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_DIR) $(1)/etc/init.d |
|
|
$(INSTALL_BIN) ./files/nut-cgi.init $(1)/etc/init.d/nut-cgi |
|
|
$(INSTALL_BIN) ./files/nut-cgi.init $(1)/etc/init.d/nut-cgi |
|
|
ln -sf /var/etc/nut/hosts.conf $(1)/etc/nut/hosts.conf |
|
|
ln -sf /var/etc/nut/hosts.conf $(1)/etc/nut/hosts.conf |
|
|
|
|
|
ln -sf /var/etc/nut/upsset.conf $(1)/etc/nut/upsset.conf |
|
|
endef |
|
|
endef |
|
|
|
|
|
|
|
|
define Package/nut-avahi-service |
|
|
define Package/nut-avahi-service |
|
@ -342,7 +364,7 @@ define DriverPackage |
|
|
define Package/nut-driver-$(2) |
|
|
define Package/nut-driver-$(2) |
|
|
$(call Package/nut/Default) |
|
|
$(call Package/nut/Default) |
|
|
TITLE:=$(2) (NUT $(1) driver) |
|
|
TITLE:=$(2) (NUT $(1) driver) |
|
|
DEPENDS:=nut +nut-common |
|
|
|
|
|
|
|
|
DEPENDS:=nut +nut-server |
|
|
$(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP) |
|
|
$(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP) |
|
|
$(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB) |
|
|
$(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB) |
|
|
$(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL) |
|
|
$(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL) |
|
@ -502,9 +524,11 @@ CONFIGURE_ARGS += \ |
|
|
--without-avahi \
|
|
|
--without-avahi \
|
|
|
--$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
|
|
|
--$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
|
|
|
--$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
|
|
|
--$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
|
|
|
|
|
|
--without-doc \
|
|
|
--without-neon \
|
|
|
--without-neon \
|
|
|
--without-powerman \
|
|
|
--without-powerman \
|
|
|
--without-wrap \
|
|
|
--without-wrap \
|
|
|
|
|
|
--with-hotplug-dir=/etc/hotplug \
|
|
|
--with-cgi \
|
|
|
--with-cgi \
|
|
|
--without-ipmi \
|
|
|
--without-ipmi \
|
|
|
--without-freeipmi \
|
|
|
--without-freeipmi \
|
|
|