Merge pull request #6909 from neheb/patch-34
[feed/packages.git] / net / nut / Makefile
1
2 # Copyright (C) 2006-2016 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.4
12 PKG_RELEASE:=8
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
16 PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7
17 PKG_MAINTAINER:=Daniel Dickinson <cshored@thecshore.com>
18 PKG_LICENSE:=GPL-2.0+ GPL-3.0+ GPL-1.0+ Artistic-1.0-Perl
19 PKG_LICENSE_FILES:=LICENSE-GPL2 LICENSE-GPL3 COPYING
20 PKG_FIXUP:=autoreconf
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
23 PKG_INSTALL:=1
24
25 PKG_CONFIG_DEPENDS:= \
26 CONFIG_NUT_DRIVER_SNMP \
27 CONFIG_NUT_DRIVER_USB \
28 CONFIG_NUT_DRIVER_SERIAL \
29 CONFIG_NUT_SSL
30
31 include $(INCLUDE_DIR)/package.mk
32
33 define Package/nut/Default
34 SECTION:=net
35 CATEGORY:=Network
36 URL:=http://www.networkupstools.org/
37 TITLE:=Network UPS Tools (NUT)
38 endef
39
40 define Package/nut/description/Default
41 Network UPS Tools (NUT) is a client/server monitoring system that
42 allows computers to share uninterruptible power supply (UPS) and
43 power distribution unit (PDU) hardware. Clients access the hardware
44 through the server, and are notified whenever the power status
45 changes.
46 endef
47
48 define Package/nut
49 $(call Package/nut/Default)
50 MENU:=1
51 endef
52
53 define Package/nut/description
54 $(call Package/nut/description/Default)
55 endef
56
57 define Package/nut/config
58 source "$(SOURCE)/Config.in"
59 endef
60
61 define Package/nut/install
62 true
63 endef
64
65 define Package/nut-server/install
66 # Server portion
67 $(INSTALL_DIR) $(1)/etc/nut
68 $(INSTALL_DIR) $(1)/usr/sbin
69 $(INSTALL_DIR) $(1)/etc/init.d
70 $(INSTALL_DIR) $(1)/usr/share/nut
71 $(INSTALL_BIN) ./files/nut-server.init $(1)/etc/init.d/nut-server
72 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin
73 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/
74 $(INSTALL_DIR) $(1)/etc/config
75 $(INSTALL_CONF) ./files/nut_server $(1)/etc/config/nut_server
76 ln -sf /var/etc/nut/upsd.users $(1)/etc/nut/upsd.users
77 ln -sf /var/etc/nut/upsd.conf $(1)/etc/nut/upsd.conf
78 # Driver common portion
79 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/
81 ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf
82 # Mangle libhid.usermap into a format (hotplug shell script) useful for OpenWrt
83 $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
84 $(INSTALL_BIN) ./files/30-libhid-ups.head $(1)/etc/hotplug.d/usb/30-libhid-ups
85 $(CP) $(PKG_INSTALL_DIR)/etc/hotplug/usb/libhid.usermap $(PKG_BUILD_DIR)/30-libhid-ups.middle
86 $(SED) '/^$$$$/d' \
87 -e '/^#/d' \
88 -E -e 's:^[^ ][^ ]* *0x0003 *0x0{0,3}([^ ][^ ]*) *0x{0,3}*([^ ][^ ]*).*:\1/\2/* | \\:' \
89 $(PKG_BUILD_DIR)/30-libhid-ups.middle
90 tail -n+2 $(PKG_BUILD_DIR)/30-libhid-ups.middle >>$(1)/etc/hotplug.d/usb/30-libhid-ups
91 cat ./files/30-libhid-ups.tail >>$(1)/etc/hotplug.d/usb/30-libhid-ups
92 endef
93
94 define Package/nut-common
95 $(call Package/nut/Default)
96 TITLE+= (common)
97 DEPENDS:= nut \
98 +NUT_DRIVER_SNMP:libnetsnmp \
99 +NUT_DRIVER_USB:libusb-compat \
100 +NUT_SSL:libopenssl
101 endef
102
103 define Package/nut-common/description
104 $(call Package/nut/description/Default)
105 This package contains the common files.
106 endef
107
108 define Package/nut-common/conffiles
109 /etc/nut/nut.conf
110 endef
111
112 define Package/nut-common/install
113 $(INSTALL_DIR) $(1)/etc/nut
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/
116 ln -sf /var/etc/nut/nut.conf $(1)/etc/nut/nut.conf
117 endef
118
119 define Package/nut-server
120 $(call Package/nut/Default)
121 TITLE+= (server)
122 DEPENDS:=nut +nut-common
123 USERID:=nut=113:nut=113
124 endef
125
126 define Package/nut-server/description
127 $(call Package/nut/description/Default)
128 upsd is responsible for serving the data from the drivers to the
129 clients. It connects to each driver and maintains a local cache of the
130 current state. Queries from the clients are served from this cache, so
131 delays are minimal. This program is essential, and must be running at
132 all times to actually make any use out of the drivers and clients.
133 endef
134
135 define Package/nut-server/conffiles
136 /etc/config/nut_server
137 /etc/nut/upsd.conf
138 /etc/nut/upsd.users
139 /etc/nut/ups.conf
140 endef
141
142 define Package/nut-upsmon
143 $(call Package/nut/Default)
144 TITLE+= (monitor)
145 DEPENDS:=nut +nut-common
146 USERID:=nutmon=114:nutmon=114
147 endef
148
149 define Package/nut-upsmon/description
150 $(call Package/nut/description/Default)
151 upsmon is the client process that is responsible for the most important
152 part of UPS monitoring--shutting down the system when the power goes
153 out. It can call out to other helper programs for notification purposes
154 during power events. upsmon can monitor multiple systems using a single
155 process. Every UPS that is defined in the upsmon.conf configuration file
156 is assigned a power value and a type (slave or master).
157 endef
158
159 define Package/nut-upsmon/conffiles
160 /etc/config/nut_monitor
161 /etc/nut/upsmon.conf
162 endef
163
164 define Package/nut-upsmon/install
165 $(INSTALL_DIR) $(1)/etc/nut
166 $(INSTALL_DIR) $(1)/usr/sbin
167 $(INSTALL_DIR) $(1)/etc/init.d
168 $(INSTALL_BIN) ./files/nut-monitor.init $(1)/etc/init.d/nut-monitor
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/
170 $(INSTALL_BIN) ./files/nutshutdown $(1)/usr/sbin/nutshutdown
171 $(INSTALL_DIR) $(1)/etc/config
172 $(INSTALL_CONF) ./files/nut_monitor $(1)/etc/config/nut_monitor
173 ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf
174 endef
175
176 define Package/nut-upsmon-sendmail-notify
177 $(call Package/nut/Default)
178 TITLE+= (upsmon with notifications via sendmail)
179 DEPENDS:=nut +nut-upsmon
180 CONFLICTS:=nut-upssched
181 endef
182
183 define Package/nut-upsmon-sendmail-notify/description
184 $(call Package/nut/description/Default)
185 upsmon with default notification via sendmail
186 endef
187
188 define Package/nut-upsmon-sendmail-notify/install
189 $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/uci-defaults
190 $(INSTALL_BIN) ./files/nut-sendmail-notify $(1)/usr/bin/
191 $(INSTALL_DATA) ./files/nut-sendmail-notify.default $(1)/etc/uci-defaults/nut-sendmail-notify
192 endef
193
194 define Package/nut-upsc
195 $(call Package/nut/Default)
196 TITLE+= (upsc command)
197 DEPENDS:=nut +nut-common
198 endef
199
200 define Package/nut-upsc/description
201 $(call Package/nut/description/Default)
202 upsc is provided as a quick way to poll the status of a UPS server. It
203 can be used inside shell scripts and other programs that need UPS data
204 but do not want to include the full interface.
205 endef
206
207 define Package/nut-upsc/install
208 $(INSTALL_DIR) $(1)/usr/bin
209 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin
210 endef
211
212 define Package/nut-upslog
213 $(call Package/nut/Default)
214 TITLE+= (logging client)
215 DEPENDS:=nut +nut-common
216 endef
217
218 define Package/nut-upslog/description
219 $(call Package/nut/description/Default)
220 upslog is a daemon that will poll a UPS at periodic intervals, fetch the
221 variables that interest you, format them, and write them to a file.
222 endef
223
224 define Package/nut-upslog/install
225 $(INSTALL_DIR) $(1)/usr/bin
226 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/
227 endef
228
229 define Package/nut-upscmd
230 $(call Package/nut/Default)
231 TITLE+= (controller)
232 DEPENDS:=nut +nut-common
233 endef
234
235 define Package/nut-upscmd/description
236 $(call Package/nut/description/Default)
237 upscmd allows you to invoke "instant commands" in your UPS hardware. Not
238 all hardware supports this, so check the list with -l to see if anything
239 will work on your equipment. On hardware that supports it, you can use
240 this program to start and stop battery tests, invoke a front panel test
241 (beep!), turn the load on or off, and more.
242 endef
243
244 define Package/nut-upscmd/install
245 $(INSTALL_DIR) $(1)/usr/bin
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/
247 endef
248
249 define Package/nut-upsrw
250 $(call Package/nut/Default)
251 TITLE+= (variable editor)
252 DEPENDS:=nut +nut-common
253 endef
254
255 define Package/nut-upsrw/description
256 $(call Package/nut/description/Default)
257 upsrw allows you to view and change the read/write variables inside your
258 UPS. It sends commands via the upsd to your driver, which configures the
259 hardware for you. The list of variables that allow you to change their
260 values is based on the capabilities of your UPS equipment. Not all
261 models support this feature. Typically, cheaper hardware does not
262 support any of them.
263 endef
264
265 define Package/nut-upsrw/install
266 $(INSTALL_DIR) $(1)/usr/bin
267 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/
268 endef
269
270 define Package/nut-upssched
271 $(call Package/nut/Default)
272 TITLE+= (helper for triggering events from upsmon)
273 DEPENDS:=nut +nut-common +nut-upsmon
274 endef
275
276 define Package/nut-upssched/description
277 $(call Package/nut/description/Default)
278 upssched was created to allow users to execute programs at times relative
279 to events being monitored by upsmon. The original purpose was to allow
280 for a shutdown to occur after some fixed period on battery, but there are
281 other uses that are possible.
282 You can alternatively write your own script and save some space.
283 endef
284
285 define Package/nut-upssched/conffiles
286 /etc/nut/upssched.conf
287 endef
288
289 define Package/nut-upssched/install
290 $(INSTALL_DIR) $(1)/usr/bin
291 $(INSTALL_DIR) $(1)/usr/sbin
292 $(INSTALL_DIR) $(1)/etc/nut
293 $(INSTALL_DIR) $(1)/etc/uci-defaults
294 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upssched-cmd $(1)/usr/bin/
295 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin/
296 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf
297 $(INSTALL_DATA) ./files/nut-sched.default $(1)/etc/uci-defaults/nut-upssched
298 endef
299
300 define Package/nut-web-cgi
301 $(call Package/nut/Default)
302 TITLE+= Web CGI interface
303 DEPENDS:=nut +nut-common +libgd
304 endef
305
306 define Package/nut-web-cgi/description
307 The CGI programs are clients that run through your web server.
308 They allow you to see UPS status and perform certain administrative
309 commands from any web browser. Javascript and cookies are not required.
310 endef
311
312 define Package/nut-web-cgi/conffiles
313 /etc/nut/hosts.conf
314 /etc/nut/upsset.conf
315 /etc/nut/upsstats.html
316 /etc/nut/upsstats-single.html
317 /etc/config/nut_cgi
318 /etc/httpd.conf
319 endef
320
321 define Package/nut-web-cgi/install
322 $(INSTALL_DIR) $(1)/www/cgi-bin/nut $(1)/www/nut
323 $(INSTALL_DIR) $(1)/etc/nut
324 $(CP) $(PKG_INSTALL_DIR)/usr/html/* $(1)/www/nut/
325 $(INSTALL_DIR) $(1)/etc/uci-defaults
326 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/cgi-bin/* $(1)/www/cgi-bin/nut
327 $(INSTALL_CONF) ./files/add_nut_httpd_conf $(1)/etc/uci-defaults/add_nut_httpd_conf
328 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html
329 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html
330 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.disable
331 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.enable
332 $(SED) 's/### \?//' $(1)/etc/nut/upsset.conf.enable
333 $(INSTALL_DIR) $(1)/etc/config
334 $(INSTALL_CONF) ./files/nut_cgi $(1)/etc/config/nut_cgi
335 $(INSTALL_DIR) $(1)/etc/init.d
336 $(INSTALL_BIN) ./files/nut-cgi.init $(1)/etc/init.d/nut-cgi
337 ln -sf /var/etc/nut/hosts.conf $(1)/etc/nut/hosts.conf
338 ln -sf /var/etc/nut/upsset.conf $(1)/etc/nut/upsset.conf
339 endef
340
341 define Package/nut-avahi-service
342 $(call Package/nut/Default)
343 TITLE+= (Avahi service)
344 DEPENDS:=nut +avahi-daemon
345 endef
346
347 define Package/nut-avahi-service/description
348 This package contains the service definition for announcing the
349 attached UPS via mDNS/DNS-SD.
350 endef
351
352 define Package/nut-avahi-service/conffiles
353 /etc/avahi/services/nut.service
354 endef
355
356 define Package/nut-avahi-service/install
357 $(INSTALL_DIR) $(1)/etc/avahi/services
358 $(INSTALL_CONF) ./files/nut.service $(1)/etc/avahi/services/
359 endef
360
361 # Dealing with all of the drivers is very repetitive, but the previous
362 # maintainer had a neat solution which just needed some tweaking.
363 define DriverPackage
364 define Package/nut-driver-$(2)
365 $(call Package/nut/Default)
366 TITLE:=$(2) (NUT $(1) driver)
367 DEPENDS:=nut +nut-server
368 $(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
369 $(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
370 $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
371 endef
372 # Deliberately empty description in order to trigger a build failure.
373 # It should be overridden by the list below, and when updating to a
374 # new version of nut we will need to provide descriptions for any new
375 # drivers.
376 define Package/nut-driver-$(2)/description
377
378 endef
379 define Package/nut-driver-$(2)/install
380 $(INSTALL_DIR) $$(1)/lib/nut
381 $(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2) $$(1)/lib/nut/
382 $(if $(filter $(2),clone),$(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2)-outlet $$(1)/lib/nut/)
383 endef
384 endef
385 define DriverDescription
386 define Package/nut-driver-$(2)/description
387 $(3)
388 endef
389 endef
390 # These lists are lifted *directly* from drivers/Makefile.am in the nut
391 # source tree. This it to make it simpler to keep in sync when updating
392 # to a newer version of nut. Do not edit this manually.
393 #
394 # DO NOT EDIT (except to update with a fresh cut/paste)!
395 SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
396 bestfortress bestuferrups bestups dummy-ups etapro everups \
397 gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys \
398 oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino \
399 safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel \
400 blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old apcupsd-ups riello_ser \
401 nutdrv_qx
402 SNMP_DRIVERLIST = snmp-ups
403 USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
404 blazer_usb richcomm_usb riello_usb \
405 nutdrv_atcl_usb \
406 nutdrv_qx
407 # END: DO NOT EDIT!
408 SERIAL_DRIVERLIST_IGNORE:=skel clone-outlet nutdrv_qx
409 # nutdrv_qx can be either USB or serial. Given most routers have USB
410 # instead of serial ports, and not wanting two identical packages with
411 # different names that conflict with each other, only the option for the
412 # driver with USB bindings is provided. If you really want to save that
413 # tiny bit of space and build it without USB support, remove nutdrv_qx
414 # from the previous line.
415
416 $(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call DriverPackage,serial,$(d))))
417 $(foreach d,$(SNMP_DRIVERLIST),$(eval $(call DriverPackage,snmp,$(d))))
418 $(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call DriverPackage,usb,$(d))))
419
420 $(eval $(call DriverDescription,serial,al175,\
421 Driver for Eltek UPS models with AL175 alarm module))
422 $(eval $(call DriverDescription,serial,bcmxcp,\
423 Driver for UPSes supporting the serial BCM/XCP protocol))
424 $(eval $(call DriverDescription,serial,belkin,\
425 Driver for Belkin serial UPS equipment))
426 $(eval $(call DriverDescription,serial,belkinunv,\
427 Driver for Belkin "Universal UPS" and compatible))
428 $(eval $(call DriverDescription,serial,bestfcom,\
429 Driver for Best Power Fortress/Ferrups))
430 $(eval $(call DriverDescription,serial,bestfortress,\
431 Driver for old Best Fortress UPS equipment))
432 $(eval $(call DriverDescription,serial,bestuferrups,\
433 Driver for Best Power Micro-Ferrups))
434 $(eval $(call DriverDescription,serial,bestups,\
435 Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment))
436 $(eval $(call DriverDescription,serial,dummy-ups,\
437 Driver for multi-purpose UPS emulation))
438 $(eval $(call DriverDescription,serial,etapro,\
439 Driver for ETA UPS equipment))
440 $(eval $(call DriverDescription,serial,everups,\
441 Driver for Ever UPS models))
442 $(eval $(call DriverDescription,serial,gamatronic,\
443 Driver for Gamatronic UPS equipment))
444 $(eval $(call DriverDescription,serial,genericups,\
445 Driver for contact-closure UPS equipment))
446 $(eval $(call DriverDescription,serial,isbmex,\
447 Driver for ISBMEX UPS equipment))
448 $(eval $(call DriverDescription,serial,liebert,\
449 Driver for Liebert contact-closure UPS equipment))
450 $(eval $(call DriverDescription,serial,liebert-esp2,\
451 Driver for Liebert UPS, using the ESP-II serial protocol))
452 $(eval $(call DriverDescription,serial,masterguard,\
453 Driver for Masterguard UPS equipment))
454 $(eval $(call DriverDescription,serial,metasys,\
455 Driver for Meta System UPS equipment))
456 $(eval $(call DriverDescription,serial,oldmge-shut,\
457 Driver for SHUT Protocol UPS equipment, deprecated, use mge-shut))
458 $(eval $(call DriverDescription,serial,mge-utalk,\
459 Driver for MGE UPS SYSTEMS UTalk protocol equipment))
460 $(eval $(call DriverDescription,serial,microdowell,\
461 Driver for Microdowell Enterprise UPS series))
462 $(eval $(call DriverDescription,serial,mge-shut,\
463 Driver for SHUT Protocol UPS equipment))
464 $(eval $(call DriverDescription,serial,oneac,\
465 Driver for Oneac UPS equipment))
466 $(eval $(call DriverDescription,serial,optiups,\
467 Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment))
468 $(eval $(call DriverDescription,serial,powercom,\
469 Driver for serial Powercom/Trust/Advice UPS equipment))
470 $(eval $(call DriverDescription,serial,rhino,\
471 Driver for Brazilian Microsol RHINO UPS equipment))
472 $(eval $(call DriverDescription,serial,safenet,\
473 Driver for SafeNet compatible UPS equipment))
474 $(eval $(call DriverDescription,serial,solis,\
475 Driver for Brazilian Microsol SOLIS UPS equipment))
476 $(eval $(call DriverDescription,serial,tripplite,\
477 Driver for Tripp-Lite SmartPro UPS equipment))
478 $(eval $(call DriverDescription,serial,tripplitesu,\
479 Driver for Tripp-Lite SmartOnline (SU) UPS equipment))
480 $(eval $(call DriverDescription,serial,upscode2,\
481 Driver for UPScode II compatible UPS equipment))
482 $(eval $(call DriverDescription,serial,victronups,\
483 Driver for IMV/Victron UPS unit Match, Match Lite, NetUps))
484 $(eval $(call DriverDescription,serial,powerpanel,\
485 Driver for PowerPanel Plus compatible UPS equipment))
486 $(eval $(call DriverDescription,serial,blazer_ser,\
487 Driver for Megatec/Q1 protocol serial based UPS equipment))
488 $(eval $(call DriverDescription,serial,clone,\
489 UPS driver clone))
490 $(eval $(call DriverDescription,serial,ivtscd,\
491 Driver for the IVT Solar Controller Device))
492 $(eval $(call DriverDescription,serial,apcsmart,\
493 Driver for American Power Conversion Smart Protocol UPS equipment))
494 $(eval $(call DriverDescription,serial,apcsmart-old,\
495 Driver for American Power Conversion Smart Protocol UPS equipment))
496 $(eval $(call DriverDescription,serial,apcupsd-ups,\
497 Driver for apcupsd client access))
498 $(eval $(call DriverDescription,serial,riello_ser,\
499 Driver for Riello UPS Protocol UPS equipment))
500 $(eval $(call DriverDescription,snmp,snmp-ups,\
501 Multi-MIB Driver for SNMP UPS equipment))
502 $(eval $(call DriverDescription,usb,usbhid-ups,\
503 Driver for USB/HID UPS equipment))
504 $(eval $(call DriverDescription,usb,bcmxcp_usb,\
505 Experimental driver for UPSes supporting the BCM/XCP protocol over USB))
506 $(eval $(call DriverDescription,usb,tripplite_usb,\
507 Driver for older Tripp Lite USB UPSes (not PDC HID)))
508 $(eval $(call DriverDescription,usb,blazer_usb,\
509 Driver for Megatec/Q1 protocol USB based UPS equipment))
510 $(eval $(call DriverDescription,usb,richcomm_usb,\
511 Driver for UPS equipment using Richcomm dry-contact to USB solution))
512 $(eval $(call DriverDescription,usb,riello_usb,\
513 Driver for Riello UPS Protocol UPS equipment via USB))
514 $(eval $(call DriverDescription,usb,nutdrv_atcl_usb,\
515 Driver for ATCL FOR UPS equipment))
516 $(eval $(call DriverDescription,usb,nutdrv_qx,\
517 Driver for Q* protocol serial and USB based UPS equipment))
518
519 CONFIGURE_ARGS += \
520 --sysconfdir=/etc/nut \
521 --datadir=/usr/share/nut \
522 --with-dev \
523 --$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
524 --without-avahi \
525 --$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
526 --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
527 --without-doc \
528 --without-neon \
529 --without-powerman \
530 --without-wrap \
531 --with-hotplug-dir=/etc/hotplug \
532 --with-cgi \
533 --without-ipmi \
534 --without-freeipmi \
535 --$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
536 --without-libltdl \
537 --with-statepath=/var/run/nut \
538 --with-drvpath=/lib/nut \
539 --with-user=root \
540 --with-group=root
541
542 define Build/InstallDev
543 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
544 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
545 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
546 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
547 endef
548
549 $(eval $(call BuildPackage,nut))
550 $(eval $(call BuildPackage,nut-common))
551 $(eval $(call BuildPackage,nut-server))
552 $(eval $(call BuildPackage,nut-upsmon))
553 $(eval $(call BuildPackage,nut-upsmon-sendmail-notify))
554 $(eval $(call BuildPackage,nut-upsc))
555 $(eval $(call BuildPackage,nut-upscmd))
556 $(eval $(call BuildPackage,nut-upslog))
557 $(eval $(call BuildPackage,nut-upsrw))
558 $(eval $(call BuildPackage,nut-upssched))
559 $(eval $(call BuildPackage,nut-web-cgi))
560 $(eval $(call BuildPackage,nut-avahi-service))
561 $(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
562 $(foreach d,$(SNMP_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
563 $(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))