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.

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