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.

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