apcupsd: add driver modbus-usb
Signed-off-by: Othmar Truniger <github@truniger.ch>
This commit is contained in:
parent
715fadc7e5
commit
1ab82e2f30
3 changed files with 77 additions and 6 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=apcupsd
|
||||
PKG_VERSION:=3.14.13
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||
define Package/apcupsd
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libpthread
|
||||
DEPENDS:=+libpthread +libusb-compat
|
||||
TITLE:=UPS control software
|
||||
URL:=http://www.apcupsd.org/
|
||||
endef
|
||||
|
@ -46,6 +46,7 @@ define Build/Configure
|
|||
--sysconfdir=/etc/apcupsd \
|
||||
--enable-cgi \
|
||||
--enable-usb \
|
||||
--enable-modbus-usb \
|
||||
--without-x \
|
||||
)
|
||||
endef
|
||||
|
@ -78,13 +79,11 @@ endef
|
|||
|
||||
define Package/apcupsd-cgi/install
|
||||
$(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/multimon.cgi $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsfstats.cgi $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsimage.cgi $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsstats.cgi $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/*.cgi $(1)/www/cgi-bin/apcupsd
|
||||
$(INSTALL_DIR) $(1)/etc/apcupsd
|
||||
$(INSTALL_CONF) ./files/apcupsd.css $(1)/etc/apcupsd/
|
||||
$(INSTALL_CONF) ./files/hosts.conf $(1)/etc/apcupsd/
|
||||
$(INSTALL_CONF) ./files/multimon.conf $(1)/etc/apcupsd/
|
||||
endef
|
||||
|
||||
define Package/apcupsd/conffiles
|
||||
|
@ -100,6 +99,7 @@ endef
|
|||
define Package/apcupsd-cgi/conffiles
|
||||
/etc/apcupsd/apcupsd.css
|
||||
/etc/apcupsd/hosts.conf
|
||||
/etc/apcupsd/multimon.conf
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,apcupsd))
|
||||
|
|
63
net/apcupsd/files/multimon.conf
Normal file
63
net/apcupsd/files/multimon.conf
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Sample multimon configuration file
|
||||
#
|
||||
# This file is not required. Without it, multimon will use the default
|
||||
# field layout.
|
||||
#
|
||||
# Temperature selection
|
||||
#
|
||||
# Pick "TEMPC" for Celsius or "TEMPF" for Fahrenheit. This will override
|
||||
# the --enable-celsius setting from the compile. UPSTEMP (below) will
|
||||
# use this setting by default.
|
||||
|
||||
TEMPC
|
||||
|
||||
# Format:
|
||||
# FIELD <variable> "<field name>" "<field suffix>"
|
||||
#
|
||||
# <variable> is either a word from the UPS protocol like battchg (see the
|
||||
# table in src/cgi/upsfetch.c) or a special word in uppercase.
|
||||
#
|
||||
# Special words are:
|
||||
# MODEL - Show the model name for this system in cyan
|
||||
#
|
||||
# STATUS - Parse the status for this system using the appropriate color
|
||||
#
|
||||
# UPSTEMP and AMBTEMP use the default scale. This is set to C if you use
|
||||
# --enable-celsius at compile time *or* if you use "TEMPC" above.
|
||||
#
|
||||
# UPSTEMP - Show the UPS temperature in the default scale (suffix ignored)
|
||||
# AMBTEMP - Show the ambient temperature in the default scale (suffix ignored)
|
||||
#
|
||||
# UPSTEMPC - Show the UPS temperature in degrees C (suffix ignored)
|
||||
# UPSTEMPF - Show the UPS temperature in degrees F (suffix ignored)
|
||||
# AMBTEMPC - Show the ambient temperature in degrees C (suffix ignored)
|
||||
# AMBTEMPF - Show the ambient temperature in degrees F (suffix ignored)
|
||||
#
|
||||
# They're called "special" since they actually understand the content
|
||||
# being printed and do other things based on what's in there.
|
||||
#
|
||||
# <field name> is what you'd like this column to be called on the page.
|
||||
# Remember that this is HTML, so you can actually embed markup in here.
|
||||
# This means you can even include images here. You can include quotes
|
||||
# (and backslashes!) in the string by escaping them with a backslash (\).
|
||||
#
|
||||
# <field suffix> is typically something like % or VAC. It's useful if
|
||||
# you want to convey the units that apply to a value.
|
||||
#
|
||||
# Example config
|
||||
|
||||
FIELD SYSTEM "System" ""
|
||||
FIELD MODEL "Model" ""
|
||||
FIELD STATUS "Status" ""
|
||||
FIELD battpct "Battery Chg" "%"
|
||||
FIELD utility "Utility" "VAC"
|
||||
FIELD loadpct "UPS Load" "%"
|
||||
FIELD UPSTEMP "UPS Temp" ""
|
||||
FIELD runtime "Batt. Run Time" "min."
|
||||
FIELD DATA "Data" "All data"
|
||||
|
||||
# These are only useful if you have a Smart-UPS model with the Measure-UPS II
|
||||
# measurement card. No other models presently support these features.
|
||||
#
|
||||
# FIELD AMBTEMP "Ambient Temp" ""
|
||||
# FIELD HUMIDITY "Ambient Humidity" "%"
|
8
net/apcupsd/patches/010-fix-usb.patch
Normal file
8
net/apcupsd/patches/010-fix-usb.patch
Normal file
|
@ -0,0 +1,8 @@
|
|||
--- a/include/libusb.h.in.orig 2015-02-21 18:53:51.023682068 +0100
|
||||
+++ a/include/libusb.h.in 2015-02-21 18:54:14.722788757 +0100
|
||||
@@ -6,4 +6,4 @@
|
||||
* path at configure time and various apcupsd bits include this
|
||||
* when they need libusb's usb.h.
|
||||
*/
|
||||
-#include "@LIBUSBH@"
|
||||
+#include "usb.h"
|
Loading…
Reference in a new issue