瀏覽代碼

apcupsd: add driver modbus-usb

Signed-off-by: Othmar Truniger <github@truniger.ch>
Othmar Truniger 10 年之前
父節點
當前提交
1ab82e2f30
共有 3 個檔案被更改,包括 77 行新增6 行删除
  1. 6
    6
      net/apcupsd/Makefile
  2. 63
    0
      net/apcupsd/files/multimon.conf
  3. 8
    0
      net/apcupsd/patches/010-fix-usb.patch

+ 6
- 6
net/apcupsd/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=apcupsd
11 11
 PKG_VERSION:=3.14.13
12
-PKG_RELEASE:=3
12
+PKG_RELEASE:=4
13 13
 
14 14
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
15 15
 PKG_LICENSE:=GPL-2.0
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
26 26
 define Package/apcupsd
27 27
   SECTION:=net
28 28
   CATEGORY:=Network
29
-  DEPENDS:=+libpthread
29
+  DEPENDS:=+libpthread +libusb-compat
30 30
   TITLE:=UPS control software
31 31
   URL:=http://www.apcupsd.org/
32 32
 endef
@@ -46,6 +46,7 @@ define Build/Configure
46 46
 		--sysconfdir=/etc/apcupsd \
47 47
 		--enable-cgi \
48 48
 		--enable-usb \
49
+		--enable-modbus-usb \
49 50
 		--without-x \
50 51
 	)
51 52
 endef
@@ -78,13 +79,11 @@ endef
78 79
 
79 80
 define Package/apcupsd-cgi/install
80 81
 	$(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd
81
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/multimon.cgi $(1)/www/cgi-bin/apcupsd
82
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsfstats.cgi $(1)/www/cgi-bin/apcupsd
83
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsimage.cgi $(1)/www/cgi-bin/apcupsd
84
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsstats.cgi $(1)/www/cgi-bin/apcupsd
82
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/*.cgi $(1)/www/cgi-bin/apcupsd
85 83
 	$(INSTALL_DIR) $(1)/etc/apcupsd
86 84
 	$(INSTALL_CONF) ./files/apcupsd.css $(1)/etc/apcupsd/
87 85
 	$(INSTALL_CONF) ./files/hosts.conf $(1)/etc/apcupsd/
86
+	$(INSTALL_CONF) ./files/multimon.conf $(1)/etc/apcupsd/
88 87
 endef
89 88
 
90 89
 define Package/apcupsd/conffiles
@@ -100,6 +99,7 @@ endef
100 99
 define Package/apcupsd-cgi/conffiles
101 100
 /etc/apcupsd/apcupsd.css
102 101
 /etc/apcupsd/hosts.conf
102
+/etc/apcupsd/multimon.conf
103 103
 endef
104 104
 
105 105
 $(eval $(call BuildPackage,apcupsd))

+ 63
- 0
net/apcupsd/files/multimon.conf 查看文件

@@ -0,0 +1,63 @@
1
+# Sample multimon configuration file
2
+#
3
+# This file is not required.  Without it, multimon will use the default
4
+# field layout.
5
+#
6
+# Temperature selection
7
+# 
8
+# Pick "TEMPC" for Celsius or "TEMPF" for Fahrenheit.  This will override
9
+# the --enable-celsius setting from the compile.  UPSTEMP (below) will 
10
+# use this setting by default.
11
+
12
+TEMPC
13
+
14
+# Format:
15
+# FIELD <variable> "<field name>" "<field suffix>"
16
+#
17
+# <variable> is either a word from the UPS protocol like battchg (see the
18
+# table in src/cgi/upsfetch.c) or a special word in uppercase.  
19
+#
20
+# Special words are:
21
+# MODEL    - Show the model name for this system in cyan
22
+#
23
+# STATUS   - Parse the status for this system using the appropriate color
24
+#
25
+# UPSTEMP and AMBTEMP use the default scale.  This is set to C if you use
26
+# --enable-celsius at compile time *or* if you use "TEMPC" above.
27
+#
28
+# UPSTEMP  - Show the UPS temperature in the default scale (suffix ignored)
29
+# AMBTEMP  - Show the ambient temperature in the default scale (suffix ignored)
30
+#
31
+# UPSTEMPC - Show the UPS temperature in degrees C (suffix ignored)
32
+# UPSTEMPF - Show the UPS temperature in degrees F (suffix ignored)
33
+# AMBTEMPC - Show the ambient temperature in degrees C (suffix ignored)
34
+# AMBTEMPF - Show the ambient temperature in degrees F (suffix ignored)
35
+# 
36
+# They're called "special" since they actually understand the content
37
+# being printed and do other things based on what's in there.
38
+# 
39
+# <field name> is what you'd like this column to be called on the page.
40
+# Remember that this is HTML, so you can actually embed markup in here.
41
+# This means you can even include images here.  You can include quotes
42
+# (and backslashes!) in the string by escaping them with a backslash (\).
43
+# 
44
+# <field suffix> is typically something like % or VAC.  It's useful if
45
+# you want to convey the units that apply to a value.
46
+#
47
+# Example config
48
+
49
+FIELD SYSTEM "System" ""
50
+FIELD MODEL "Model" ""
51
+FIELD STATUS "Status" ""
52
+FIELD battpct "Battery Chg" "%"
53
+FIELD utility "Utility" "VAC"
54
+FIELD loadpct "UPS Load" "%"
55
+FIELD UPSTEMP "UPS Temp" ""
56
+FIELD runtime "Batt. Run Time" "min."
57
+FIELD DATA   "Data" "All data"
58
+
59
+# These are only useful if you have a Smart-UPS model with the Measure-UPS II
60
+# measurement card.  No other models presently support these features.
61
+# 
62
+# FIELD AMBTEMP "Ambient Temp" ""
63
+# FIELD HUMIDITY "Ambient Humidity" "%"

+ 8
- 0
net/apcupsd/patches/010-fix-usb.patch 查看文件

@@ -0,0 +1,8 @@
1
+--- a/include/libusb.h.in.orig	2015-02-21 18:53:51.023682068 +0100
2
++++ a/include/libusb.h.in	2015-02-21 18:54:14.722788757 +0100
3
+@@ -6,4 +6,4 @@
4
+  * path at configure time and various apcupsd bits include this
5
+  * when they need libusb's usb.h.
6
+  */
7
+-#include "@LIBUSBH@"
8
++#include "usb.h"