delays are minimal. This program is essential, and must be running at
all times to actually make any use out of the drivers and clients.
default y
-
+
config NUT_CLIENTS_UPSC
depends on PACKAGE_nut
bool "Include command line client (upsc)"
can be used inside shell scripts and other programs that need UPS data
but don't want to include the full interface.
default y
-
+
config NUT_CLIENTS_UPSLOG
depends on PACKAGE_nut
bool "Include logging client (upslog)"
upslog is a daemon that will poll a UPS at periodic intervals, fetch the
variables that interest you, format them, and write them to a file.
default n
-
+
config NUT_CLIENTS_UPSCMD
depends on PACKAGE_nut
bool "Include UPS controller (upscmd)"
this program to start and stop battery tests, invoke a front panel test
(beep!), turn the load on or off, and more.
default n
-
+
config NUT_CLIENTS_UPSRW
depends on PACKAGE_nut
bool "Include UPS variable editor (upsrw)"
models support this feature. Typically, cheaper hardware does not
support any of them.
default n
-
+
config NUT_CLIENTS_UPSMON
depends on PACKAGE_nut
bool "Include monitor and shutdown controller (upsmon)"
process. Every UPS that is defined in the upsmon.conf configuration file
is assigned a power value and a type (slave or master).
default y
-
+
config NUT_CLIENTS_UPSSCHED
depends on NUT_CLIENTS_UPSMON
bool "Include helper for triggering events from upsmon (upssched)"
other uses that are possible.
You can alternatively write your own script and save some space.
default n
-
+
+ config NUT_CLIENTS_CGI
+ depends on PACKAGE_nut
+ bool "Include web cgi interface"
+ help
+ The CGI programs are clients that run through your web server.
+ They allow you to see UPS status and perform certain administrative
+ commands from any web browser. Javascript and cookies are not required.
+ default n
+
config NUT_SSL
depends on PACKAGE_nut
bool "Build with support for OpenSSL"
are happy with using passwords to authenticate clients, you can save
some space and build NUT without SSL support.
default n
-
+
config NUT_DRIVER_SERIAL
depends on PACKAGE_nut
bool "Build with support for serial drivers"
help
If you have a UPS connected via serial, select this.
default n
-
+
config NUT_DRIVER_USB
depends on PACKAGE_nut
bool "Build with support for USB drivers"
help
If you have a UPS connected via USB, select this.
default y
-
+
config NUT_DRIVER_SNMP
depends on PACKAGE_nut
bool "Build with support for SNMP drivers"
help
If you have a UPS you can connect to via SNMP, select this.
default n
-
CONFIG_NUT_CLIENTS_UPSMON \
CONFIG_NUT_CLIENTS_UPSRW \
CONFIG_NUT_CLIENTS_UPSSCHED \
+ CONFIG_NUT_CLIENTS_CGI \
CONFIG_NUT_DRIVER_SERIAL \
CONFIG_NUT_DRIVER_SNMP \
CONFIG_NUT_DRIVER_USB \
DEPENDS:= \
+NUT_DRIVER_SNMP:libnetsnmp \
+NUT_DRIVER_USB:libusb-compat \
- +NUT_SSL:libopenssl
+ +NUT_SSL:libopenssl \
+ +NUT_CLIENTS_CGI:libgd
MENU:=1
endef
$(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf)
endef
+define Package/nut-web-cgi
+ $(call Package/nut/Default)
+ TITLE:=Web CGI interface
+endef
+
+define Package/nut-web-cgi/description
+The CGI programs are clients that run through your web server.
+They allow you to see UPS status and perform certain administrative
+commands from any web browser. Javascript and cookies are not required.
+endef
+
+define Package/nut-web-cgi/conffiles
+ /etc/nut/hosts.conf
+ /etc/nut/upsset.conf
+ /etc/nut/upsstats.html
+ /etc/nut/upsstats-single.html
+endef
+
+define Package/nut-web-cgi/install
+ $(INSTALL_DIR) $(1)/etc/nut
+ $(INSTALL_DIR) $(1)/usr/share/www/cgi-bin
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/hosts.conf.sample $(1)/etc/nut/hosts.conf
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/www/nut $(1)/usr/share/www/
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/www/cgi-bin/nut $(1)/usr/share/www/cgi-bin/
+endef
+
# Dealing with all of the drivers is very repetitive, but the previous
# maintainer had a neat solution which just needed some tweaking.
define DriverPackage
# new version of nut we will need to provide descriptions for any new
# drivers.
define Package/nut-driver-$(2)/description
-
+
endef
define Package/nut-driver-$(2)/install
$(INSTALL_DIR) $$(1)/lib/nut
--sysconfdir=/etc/nut \
--with-drvpath=/lib/nut \
--with-statepath=/var/run \
- --datadir=/usr/share/nut
+ --datadir=/usr/share/nut \
+ --$(if $(CONFIG_NUT_CLIENTS_CGI),with,without)-cgi \
+ --with-htmlpath=/usr/share/www/nut \
+ --with-cgipath=/usr/share/www/cgi-bin/nut
$(eval $(call BuildPackage,nut))
+$(eval $(call BuildPackage,nut-web-cgi))
$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))