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