package/apcupsd: new package
authorJames Hilliard <james.hilliard1@gmail.com>
Sun, 19 Apr 2020 00:39:53 +0000 (18:39 -0600)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 19 Apr 2020 08:27:46 +0000 (10:27 +0200)
Apcupsd is a UPS control system that permits orderly shutdown of your
computer in the event of a power failure.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
DEVELOPERS
package/Config.in
package/apcupsd/Config.in [new file with mode: 0644]
package/apcupsd/apcupsd.hash [new file with mode: 0644]
package/apcupsd/apcupsd.mk [new file with mode: 0644]

index c831d9d2d1d635c589bfe8eba038f2f92f72f664..67456d0c4b71222a6b18718ae3531e7d2511f57b 100644 (file)
@@ -1171,6 +1171,7 @@ F:        configs/pine64_defconfig
 F:     configs/pine64_sopine_defconfig
 
 N:     James Hilliard <james.hilliard1@gmail.com>
+F:     package/apcupsd/
 F:     package/gensio/
 F:     package/lua-std-debug/
 F:     package/lua-std-normalize/
index ccf54f2417ac2c2e1fd35162f0dbfa1718f3d2de..7a0ff1716dcc0de25d8117d4264f23386fdfa5ad 100644 (file)
@@ -415,6 +415,7 @@ endmenu
        source "package/aer-inject/Config.in"
        source "package/am335x-pru-package/Config.in"
        source "package/amd-catalyst/Config.in"
+       source "package/apcupsd/Config.in"
        source "package/avrdude/Config.in"
        source "package/bcache-tools/Config.in"
        source "package/biosdevname/Config.in"
diff --git a/package/apcupsd/Config.in b/package/apcupsd/Config.in
new file mode 100644 (file)
index 0000000..fc77e7c
--- /dev/null
@@ -0,0 +1,64 @@
+config BR2_PACKAGE_APCUPSD
+       bool "apcupsd"
+       depends on BR2_INSTALL_LIBSTDCPP
+       help
+         A daemon for controlling APC UPSes.
+
+         http://www.apcupsd.org/
+
+if BR2_PACKAGE_APCUPSD
+
+config BR2_PACKAGE_APCUPSD_APCSMART
+       bool "apcsmart"
+       help
+         Compile APC SmartUPS serial driver
+
+config BR2_PACKAGE_APCUPSD_DUMB
+       bool "dumb"
+       help
+         Compile dumb UPS driver
+
+config BR2_PACKAGE_APCUPSD_MODBUS
+       bool "modbus"
+       help
+         Compile MODBUS driver code
+
+config BR2_PACKAGE_APCUPSD_MODBUS_USB
+       bool "modbus usb"
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       select BR2_PACKAGE_LIBUSB_COMPAT
+       select BR2_PACKAGE_APCUPSD_MODBUS
+       help
+         Compile MODBUS/USB driver code
+
+comment "modbus usb support needs a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_APCUPSD_NET
+       bool "net"
+       help
+         Compile networking driver for slaves
+
+config BR2_PACKAGE_APCUPSD_PCNET
+       bool "pcnet"
+       help
+         Compile PCNET driver code
+
+config BR2_PACKAGE_APCUPSD_SNMP
+       bool "snmp"
+       help
+         Compile SNMP driver
+
+config BR2_PACKAGE_APCUPSD_USB
+       bool "usb"
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       select BR2_PACKAGE_LIBUSB_COMPAT
+       help
+         Compile USB UPS code
+
+comment "usb support needs a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+endif
diff --git a/package/apcupsd/apcupsd.hash b/package/apcupsd/apcupsd.hash
new file mode 100644 (file)
index 0000000..6795560
--- /dev/null
@@ -0,0 +1,6 @@
+# From https://sourceforge.net/projects/apcupsd/files/apcupsd%20-%20Stable/3.14.14/
+md5  cc8f5ced77f38906a274787acb9bc980  apcupsd-3.14.14.tar.gz
+sha1  f027fa141c929371fe860443b6d911ef3a3606fb  apcupsd-3.14.14.tar.gz
+# Locally computed:
+sha256  db7748559b6b4c3784f9856561ef6ac6199ef7bd019b3edcd7e0a647bf8f9867  apcupsd-3.14.14.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/apcupsd/apcupsd.mk b/package/apcupsd/apcupsd.mk
new file mode 100644 (file)
index 0000000..e750657
--- /dev/null
@@ -0,0 +1,67 @@
+################################################################################
+#
+# apcupsd
+#
+################################################################################
+
+APCUPSD_VERSION = 3.14.14
+APCUPSD_SITE = http://downloads.sourceforge.net/project/apcupsd/apcupsd%20-%20Stable/$(APCUPSD_VERSION)
+APCUPSD_LICENSE = GPL-2.0
+APCUPSD_LICENSE_FILES = COPYING
+APCUPSD_CONF_OPTS = --disable-test
+
+ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
+APCUPSD_CONF_ENV = ac_cv_path_usbcfg=$(STAGING_DIR)/usr/bin/libusb-config
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_APCSMART),y)
+APCUPSD_CONF_OPTS += --enable-apcsmart
+else
+APCUPSD_CONF_OPTS += --disable-apcsmart
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_DUMB),y)
+APCUPSD_CONF_OPTS += --enable-dumb
+else
+APCUPSD_CONF_OPTS += --disable-dumb
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_MODBUS_USB),y)
+APCUPSD_CONF_OPTS += --enable-modbus-usb
+APCUPSD_DEPENDENCIES = libusb libusb-compat
+else
+APCUPSD_CONF_OPTS += --disable-modbus-usb
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_MODBUS),y)
+APCUPSD_CONF_OPTS += --enable-modbus
+else
+APCUPSD_CONF_OPTS += --disable-modbus
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_NET),y)
+APCUPSD_CONF_OPTS += --enable-net
+else
+APCUPSD_CONF_OPTS += --disable-net
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_PCNET),y)
+APCUPSD_CONF_OPTS += --enable-pcnet
+else
+APCUPSD_CONF_OPTS += --disable-pcnet
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_SNMP),y)
+APCUPSD_CONF_OPTS += --enable-snmp
+else
+APCUPSD_CONF_OPTS += --disable-snmp
+endif
+
+ifeq ($(BR2_PACKAGE_APCUPSD_USB),y)
+APCUPSD_CONF_OPTS += --enable-usb
+APCUPSD_DEPENDENCIES = libusb libusb-compat
+else
+APCUPSD_CONF_OPTS += --disable-usb
+endif
+
+$(eval $(autotools-package))