|
@@ -0,0 +1,279 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2006 OpenWrt.org
|
|
3
|
+#
|
|
4
|
+# This is free software, licensed under the GNU General Public License v2.
|
|
5
|
+# See /LICENSE for more information.
|
|
6
|
+#
|
|
7
|
+
|
|
8
|
+include $(TOPDIR)/rules.mk
|
|
9
|
+
|
|
10
|
+PKG_NAME:=nut
|
|
11
|
+PKG_VERSION:=2.7.2
|
|
12
|
+PKG_RELEASE:=1
|
|
13
|
+
|
|
14
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
15
|
+PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
|
|
16
|
+PKG_MD5SUM:=c3568b42e058cfc385b46d25140dced4
|
|
17
|
+PKG_MAINTAINER:=Martin Rowe <cyanidium@users.noreply.github.com>
|
|
18
|
+PKG_LICENSE:=GPL-2.0
|
|
19
|
+PKG_LICENSE_FILES:=LICENSE-GPL2
|
|
20
|
+
|
|
21
|
+PKG_BUILD_DIR:=$(BUILD_DIR)/nut-$(PKG_VERSION)
|
|
22
|
+PKG_INSTALL:=1
|
|
23
|
+
|
|
24
|
+include $(INCLUDE_DIR)/package.mk
|
|
25
|
+
|
|
26
|
+define Package/nut/Default
|
|
27
|
+ SECTION:=net
|
|
28
|
+ CATEGORY:=Network
|
|
29
|
+ URL:=http://www.networkupstools.org/
|
|
30
|
+ DEPENDS:=nut
|
|
31
|
+endef
|
|
32
|
+
|
|
33
|
+define Package/nut/description
|
|
34
|
+Network UPS Tools (NUT) is a client/server monitoring system that
|
|
35
|
+allows computers to share uninterruptible power supply (UPS) and
|
|
36
|
+power distribution unit (PDU) hardware. Clients access the hardware
|
|
37
|
+through the server, and are notified whenever the power status
|
|
38
|
+changes.
|
|
39
|
+endef
|
|
40
|
+
|
|
41
|
+define Package/nut
|
|
42
|
+ $(call Package/nut/Default)
|
|
43
|
+ TITLE:=Network UPS Tools
|
|
44
|
+ DEPENDS:= \
|
|
45
|
+ +NUT_DRIVER_SNMP:libnetsnmp \
|
|
46
|
+ +NUT_DRIVER_USB:libusb-compat \
|
|
47
|
+ +NUT_SSL:libopenssl
|
|
48
|
+ MENU:=1
|
|
49
|
+endef
|
|
50
|
+
|
|
51
|
+define Package/nut/config
|
|
52
|
+ source "$(SOURCE)/Config.in"
|
|
53
|
+endef
|
|
54
|
+
|
|
55
|
+define Package/nut/conffiles
|
|
56
|
+ /etc/nut/nut.conf
|
|
57
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSMON),/etc/nut/upsmon.conf)
|
|
58
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),/etc/nut/upssched.conf)
|
|
59
|
+ $(if $(CONFIG_NUT_SERVER),/etc/nut/ups.conf)
|
|
60
|
+ $(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.conf)
|
|
61
|
+ $(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.users)
|
|
62
|
+endef
|
|
63
|
+
|
|
64
|
+define Package/nut/install
|
|
65
|
+ $(INSTALL_DIR) $(1)/etc/nut
|
|
66
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
67
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
68
|
+ $(INSTALL_DIR) $(1)/usr/lib
|
|
69
|
+ $(INSTALL_DIR) $(1)/usr/sbin
|
|
70
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/nut.conf.sample $(1)/etc/nut/nut.conf
|
|
71
|
+ $(if $(or $(CONFIG_NUT_CLIENTS_UPSC),\
|
|
72
|
+ $(CONFIG_NUT_CLIENTS_UPSCMD),\
|
|
73
|
+ $(CONFIG_NUT_CLIENTS_LOG),\
|
|
74
|
+ $(CONFIG_NUT_CLIENTS_UPSRW),\
|
|
75
|
+ $(CONFIG_NUT_CLIENTS_UPSMON),\
|
|
76
|
+ $(CONFIG_NUT_CLIENTS_UPSSCHED)),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/)
|
|
77
|
+ $(if $(or $(CONFIG_NUT_SERVER),\
|
|
78
|
+ $(CONFIG_NUT_CLIENTS_UPSMON)),$(INSTALL_DIR) $(1)/etc/init.d)
|
|
79
|
+ $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/lib/nut)
|
|
80
|
+ $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/usr/share/nut)
|
|
81
|
+ $(if $(CONFIG_NUT_SERVER),$(CP) ./files/nut-server.init $(1)/etc/init.d/)
|
|
82
|
+ $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin)
|
|
83
|
+ $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin)
|
|
84
|
+ $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/)
|
|
85
|
+ $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/)
|
|
86
|
+ $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/ups.conf.sample $(1)/etc/nut/ups.conf)
|
|
87
|
+ $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.conf.sample $(1)/etc/nut/upsd.conf)
|
|
88
|
+ $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.users.sample $(1)/etc/nut/upsd.users)
|
|
89
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSC),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin/)
|
|
90
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSCMD),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/)
|
|
91
|
+ $(if $(CONFIG_NUT_CLIENTS_LOG),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/)
|
|
92
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSRW),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/)
|
|
93
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) ./files/nut-monitor.init $(1)/etc/init.d/)
|
|
94
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/)
|
|
95
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsmon.conf.sample $(1)/etc/nut/upsmon.conf)
|
|
96
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upssched-cmd $(1)/usr/bin/)
|
|
97
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin/)
|
|
98
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf)
|
|
99
|
+endef
|
|
100
|
+
|
|
101
|
+# Dealing with all of the drivers is very repetitive, but the previous
|
|
102
|
+# maintainer had a neat solution which just needed some tweaking.
|
|
103
|
+define DriverPackage
|
|
104
|
+ define Package/nut-driver-$(2)
|
|
105
|
+ $(call Package/nut/Default)
|
|
106
|
+ TITLE:=$(2) (NUT $(1) driver)
|
|
107
|
+ $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
|
|
108
|
+ $(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
|
|
109
|
+ $(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
|
|
110
|
+ endef
|
|
111
|
+ # Deliberately empty description in order to trigger a build failure.
|
|
112
|
+ # It should be overridden by the list below, and when updating to a
|
|
113
|
+ # new version of nut we will need to provide descriptions for any new
|
|
114
|
+ # drivers.
|
|
115
|
+ define Package/nut-driver-$(2)/description
|
|
116
|
+
|
|
117
|
+ endef
|
|
118
|
+ define Package/nut-driver-$(2)/install
|
|
119
|
+ $(INSTALL_DIR) $$(1)/lib/nut
|
|
120
|
+ $(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2) $$(1)/lib/nut/
|
|
121
|
+ $(if $(filter $(2),clone),$(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2)-outlet $$(1)/lib/nut/)
|
|
122
|
+ endef
|
|
123
|
+endef
|
|
124
|
+define DriverDescription
|
|
125
|
+ define Package/nut-driver-$(2)/description
|
|
126
|
+ $(3)
|
|
127
|
+ endef
|
|
128
|
+endef
|
|
129
|
+# These lists are lifted *directly* from drivers/Makefile.am in the nut
|
|
130
|
+# source tree. This it to make it simpler to keep in sync when updating
|
|
131
|
+# to a newer version of nut. Do not edit this manually.
|
|
132
|
+#
|
|
133
|
+# DO NOT EDIT (except to update with a fresh cut/paste)!
|
|
134
|
+SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
|
|
135
|
+ bestfortress bestuferrups bestups dummy-ups etapro everups \
|
|
136
|
+ gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys \
|
|
137
|
+ oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino \
|
|
138
|
+ safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel \
|
|
139
|
+ blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old apcupsd-ups riello_ser \
|
|
140
|
+ nutdrv_qx
|
|
141
|
+SNMP_DRIVERLIST = snmp-ups
|
|
142
|
+USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
|
|
143
|
+ blazer_usb richcomm_usb riello_usb \
|
|
144
|
+ nutdrv_atcl_usb \
|
|
145
|
+ nutdrv_qx
|
|
146
|
+# END: DO NOT EDIT!
|
|
147
|
+SERIAL_DRIVERLIST_IGNORE:=skel clone-outlet nutdrv_qx
|
|
148
|
+# nutdrv_qx can be either USB or serial. Given most routers have USB
|
|
149
|
+# instead of serial ports, and not wanting two identical packages with
|
|
150
|
+# different names that conflict with each other, only the option for the
|
|
151
|
+# driver with USB bindings is provided. If you really want to save that
|
|
152
|
+# tiny bit of space and build it without USB support, remove nutdrv_qx
|
|
153
|
+# from the previous line.
|
|
154
|
+
|
|
155
|
+$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call DriverPackage,serial,$(d))))
|
|
156
|
+$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call DriverPackage,snmp,$(d))))
|
|
157
|
+$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call DriverPackage,usb,$(d))))
|
|
158
|
+
|
|
159
|
+$(eval $(call DriverDescription,serial,al175,\
|
|
160
|
+ Driver for Eltek UPS models with AL175 alarm module))
|
|
161
|
+$(eval $(call DriverDescription,serial,bcmxcp,\
|
|
162
|
+ Driver for UPSes supporting the serial BCM/XCP protocol))
|
|
163
|
+$(eval $(call DriverDescription,serial,belkin,\
|
|
164
|
+ Driver for Belkin serial UPS equipment))
|
|
165
|
+$(eval $(call DriverDescription,serial,belkinunv,\
|
|
166
|
+ Driver for Belkin "Universal UPS" and compatible))
|
|
167
|
+$(eval $(call DriverDescription,serial,bestfcom,\
|
|
168
|
+ Driver for Best Power Fortress/Ferrups))
|
|
169
|
+$(eval $(call DriverDescription,serial,bestfortress,\
|
|
170
|
+ Driver for old Best Fortress UPS equipment))
|
|
171
|
+$(eval $(call DriverDescription,serial,bestuferrups,\
|
|
172
|
+ Driver for Best Power Micro-Ferrups))
|
|
173
|
+$(eval $(call DriverDescription,serial,bestups,\
|
|
174
|
+ Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment))
|
|
175
|
+$(eval $(call DriverDescription,serial,dummy-ups,\
|
|
176
|
+ Driver for multi-purpose UPS emulation))
|
|
177
|
+$(eval $(call DriverDescription,serial,etapro,\
|
|
178
|
+ Driver for ETA UPS equipment))
|
|
179
|
+$(eval $(call DriverDescription,serial,everups,\
|
|
180
|
+ Driver for Ever UPS models))
|
|
181
|
+$(eval $(call DriverDescription,serial,gamatronic,\
|
|
182
|
+ Driver for Gamatronic UPS equipment))
|
|
183
|
+$(eval $(call DriverDescription,serial,genericups,\
|
|
184
|
+ Driver for contact-closure UPS equipment))
|
|
185
|
+$(eval $(call DriverDescription,serial,isbmex,\
|
|
186
|
+ Driver for ISBMEX UPS equipment))
|
|
187
|
+$(eval $(call DriverDescription,serial,liebert,\
|
|
188
|
+ Driver for Liebert contact-closure UPS equipment))
|
|
189
|
+$(eval $(call DriverDescription,serial,liebert-esp2,\
|
|
190
|
+ Driver for Liebert UPS, using the ESP-II serial protocol))
|
|
191
|
+$(eval $(call DriverDescription,serial,masterguard,\
|
|
192
|
+ Driver for Masterguard UPS equipment))
|
|
193
|
+$(eval $(call DriverDescription,serial,metasys,\
|
|
194
|
+ Driver for Meta System UPS equipment))
|
|
195
|
+$(eval $(call DriverDescription,serial,oldmge-shut,\
|
|
196
|
+ Driver for SHUT Protocol UPS equipment, deprecated, use mge-shut))
|
|
197
|
+$(eval $(call DriverDescription,serial,mge-utalk,\
|
|
198
|
+ Driver for MGE UPS SYSTEMS UTalk protocol equipment))
|
|
199
|
+$(eval $(call DriverDescription,serial,microdowell,\
|
|
200
|
+ Driver for Microdowell Enterprise UPS series))
|
|
201
|
+$(eval $(call DriverDescription,serial,mge-shut,\
|
|
202
|
+ Driver for SHUT Protocol UPS equipment))
|
|
203
|
+$(eval $(call DriverDescription,serial,oneac,\
|
|
204
|
+ Driver for Oneac UPS equipment))
|
|
205
|
+$(eval $(call DriverDescription,serial,optiups,\
|
|
206
|
+ Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment))
|
|
207
|
+$(eval $(call DriverDescription,serial,powercom,\
|
|
208
|
+ Driver for serial Powercom/Trust/Advice UPS equipment))
|
|
209
|
+$(eval $(call DriverDescription,serial,rhino,\
|
|
210
|
+ Driver for Brazilian Microsol RHINO UPS equipment))
|
|
211
|
+$(eval $(call DriverDescription,serial,safenet,\
|
|
212
|
+ Driver for SafeNet compatible UPS equipment))
|
|
213
|
+$(eval $(call DriverDescription,serial,solis,\
|
|
214
|
+ Driver for Brazilian Microsol SOLIS UPS equipment))
|
|
215
|
+$(eval $(call DriverDescription,serial,tripplite,\
|
|
216
|
+ Driver for Tripp-Lite SmartPro UPS equipment))
|
|
217
|
+$(eval $(call DriverDescription,serial,tripplitesu,\
|
|
218
|
+ Driver for Tripp-Lite SmartOnline (SU) UPS equipment))
|
|
219
|
+$(eval $(call DriverDescription,serial,upscode2,\
|
|
220
|
+ Driver for UPScode II compatible UPS equipment))
|
|
221
|
+$(eval $(call DriverDescription,serial,victronups,\
|
|
222
|
+ Driver for IMV/Victron UPS unit Match, Match Lite, NetUps))
|
|
223
|
+$(eval $(call DriverDescription,serial,powerpanel,\
|
|
224
|
+ Driver for PowerPanel Plus compatible UPS equipment))
|
|
225
|
+$(eval $(call DriverDescription,serial,blazer_ser,\
|
|
226
|
+ Driver for Megatec/Q1 protocol serial based UPS equipment))
|
|
227
|
+$(eval $(call DriverDescription,serial,clone,\
|
|
228
|
+ UPS driver clone))
|
|
229
|
+$(eval $(call DriverDescription,serial,ivtscd,\
|
|
230
|
+ Driver for the IVT Solar Controller Device))
|
|
231
|
+$(eval $(call DriverDescription,serial,apcsmart,\
|
|
232
|
+ Driver for American Power Conversion Smart Protocol UPS equipment))
|
|
233
|
+$(eval $(call DriverDescription,serial,apcsmart-old,\
|
|
234
|
+ Driver for American Power Conversion Smart Protocol UPS equipment))
|
|
235
|
+$(eval $(call DriverDescription,serial,apcupsd-ups,\
|
|
236
|
+ Driver for apcupsd client access))
|
|
237
|
+$(eval $(call DriverDescription,serial,riello_ser,\
|
|
238
|
+ Driver for Riello UPS Protocol UPS equipment))
|
|
239
|
+$(eval $(call DriverDescription,snmp,snmp-ups,\
|
|
240
|
+ Multi-MIB Driver for SNMP UPS equipment))
|
|
241
|
+$(eval $(call DriverDescription,usb,usbhid-ups,\
|
|
242
|
+ Driver for USB/HID UPS equipment))
|
|
243
|
+$(eval $(call DriverDescription,usb,bcmxcp_usb,\
|
|
244
|
+ Experimental driver for UPSes supporting the BCM/XCP protocol over USB))
|
|
245
|
+$(eval $(call DriverDescription,usb,tripplite_usb,\
|
|
246
|
+ Driver for older Tripp Lite USB UPSes (not PDC HID)))
|
|
247
|
+$(eval $(call DriverDescription,usb,blazer_usb,\
|
|
248
|
+ Driver for Megatec/Q1 protocol USB based UPS equipment))
|
|
249
|
+$(eval $(call DriverDescription,usb,richcomm_usb,\
|
|
250
|
+ Driver for UPS equipment using Richcomm dry-contact to USB solution))
|
|
251
|
+$(eval $(call DriverDescription,usb,riello_usb,\
|
|
252
|
+ Driver for Riello UPS Protocol UPS equipment via USB))
|
|
253
|
+$(eval $(call DriverDescription,usb,nutdrv_atcl_usb,\
|
|
254
|
+ Driver for ATCL FOR UPS equipment))
|
|
255
|
+$(eval $(call DriverDescription,usb,nutdrv_qx,\
|
|
256
|
+ Driver for Q* protocol serial and USB based UPS equipment))
|
|
257
|
+
|
|
258
|
+CONFIGURE_ARGS += \
|
|
259
|
+ --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
|
|
260
|
+ --$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
|
|
261
|
+ --$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
|
|
262
|
+ --without-neon \
|
|
263
|
+ --without-powerman \
|
|
264
|
+ --without-ipmi \
|
|
265
|
+ --without-freeipmi \
|
|
266
|
+ --$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
|
|
267
|
+ --without-avahi \
|
|
268
|
+ --without-libltdl \
|
|
269
|
+ --with-user=root \
|
|
270
|
+ --with-group=root \
|
|
271
|
+ --sysconfdir=/etc/nut \
|
|
272
|
+ --with-drvpath=/lib/nut \
|
|
273
|
+ --with-statepath=/var/run \
|
|
274
|
+ --datadir=/usr/share/nut
|
|
275
|
+
|
|
276
|
+$(eval $(call BuildPackage,nut))
|
|
277
|
+$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
|
|
278
|
+$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
|
|
279
|
+$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
|