Skip to contentSkip to conversation

package/apcupsd: new package

PATCH Superseded James Hilliard 2 participants 2 messages Apr 13, 2020 – Apr 18, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/apcupsd: new package

Apcupsd is a UPS control system that permits orderly shutdown of your computer in the event of a power failure.

---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/apcupsd/Config.in    |  9 +++++++++
 package/apcupsd/apcupsd.hash |  6 ++++++
 package/apcupsd/apcupsd.mk   | 23 +++++++++++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 package/apcupsd/Config.in
 create mode 100644 package/apcupsd/apcupsd.hash
 create mode 100644 package/apcupsd/apcupsd.mk
DEVELOPERS +1 -0
index cea4a18cd9..e89297a708 100644
@@ -1169,6 +1169,7 @@ F:	configs/pine64_defconfig
 F:	configs/pine64_sopine_defconfig
 
 N:	James Hilliard <[email protected]>
+F:	package/apcupsd/
 F:	package/gensio/
 F:	package/lua-std-debug/
 F:	package/lua-std-normalize/
package/Config.in +1 -0
index e2868dd1b5..6d6b5146ce 100644
@@ -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"
package/apcupsd/Config.in new file +9 -0
new file mode 100644
index 0000000000..d8bf07e1fa
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_APCUPSD
+	bool "apcupsd"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+	select BR2_PACKAGE_LIBUSB
+	select BR2_PACKAGE_LIBUSB_COMPAT
+	help
+	  A daemon for controlling APC UPSes.
+
+	  http://www.apcupsd.org/
package/apcupsd/apcupsd.hash new file +6 -0
new file mode 100644
index 0000000000..6795560f62
@@ -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
package/apcupsd/apcupsd.mk new file +23 -0
new file mode 100644
index 0000000000..13dbd14c4f
@@ -0,0 +1,23 @@
+################################################################################
+#
+# 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_DEPENDENCIES = libusb libusb-compat
+APCUPSD_CONF_OPTS = \
+	  --enable-apcsmart \
+	  --enable-dumb \
+	  --enable-usb \
+	  --enable-net \
+	  --enable-snmp \
+	  --disable-test \
+	  --enable-pcnet \
+	  --enable-modbus-usb \
+	  --enable-modbus
+
+$(eval $(autotools-package))
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/apcupsd: new package

Hello James,

Thanks for this new package. I have a number of comments, see below.

package/apcupsd/Config.in line 5

Quoted 11 lines · On Mon, 13 Apr 2020 16:29:30 -0600 James Hilliard <[email protected]>…
package/apcupsd/Config.in new file +5 -0
new file mode 100644
index 0000000000..d8bf07e1fa
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_APCUPSD
+	bool "apcupsd"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+	select BR2_PACKAGE_LIBUSB
+	select BR2_PACKAGE_LIBUSB_COMPAT

I think we don't want to make libusb a mandatory dependency, see below.

Quoted 5 lines
package/apcupsd/Config.in new file +5 -0
+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_DEPENDENCIES = libusb libusb-compat

package/apcupsd/Config.in

Quoted 10 lines
package/apcupsd/Config.in new file +10 -0
+APCUPSD_CONF_OPTS = \
+	  --enable-apcsmart \
+	  --enable-dumb \
+	  --enable-usb \
+	  --enable-net \
+	  --enable-snmp \
+	  --disable-test \
+	  --enable-pcnet \
+	  --enable-modbus-usb \
+	  --enable-modbus

I think we need to be more flexible, and keep the libusb dependency optional, because it really is optional. Could you add a bunch of sub-options to BR2_PACKAGE_APCUPSD to enable/disable the most relevant features? apcsmart, usb, net, snmp, pcnet, modbus, modbus-usb seem quite logical to have. Only select libusb/libusb-compat when needed.

Also, you will need to feed in the autoconf variable cache the path to libusb-config, otherwise it might end up using the libusb-config from the host machine if it exists.

Could you have a look at improving the package in these directions?

Thanks a lot,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com