You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

567 lines
21 KiB

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