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.

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