All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/apcupsd: new package
@ 2020-04-13 22:29 James Hilliard
  2020-04-18 16:30 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: James Hilliard @ 2020-04-13 22:29 UTC (permalink / raw)
  To: buildroot

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>
---
 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

diff --git a/DEVELOPERS b/DEVELOPERS
index cea4a18cd9..e89297a708 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1169,6 +1169,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/
diff --git a/package/Config.in b/package/Config.in
index e2868dd1b5..6d6b5146ce 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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
index 0000000000..d8bf07e1fa
--- /dev/null
+++ b/package/apcupsd/Config.in
@@ -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/
diff --git a/package/apcupsd/apcupsd.hash b/package/apcupsd/apcupsd.hash
new file mode 100644
index 0000000000..6795560f62
--- /dev/null
+++ b/package/apcupsd/apcupsd.hash
@@ -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
index 0000000000..13dbd14c4f
--- /dev/null
+++ b/package/apcupsd/apcupsd.mk
@@ -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))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] package/apcupsd: new package
  2020-04-13 22:29 [Buildroot] [PATCH 1/1] package/apcupsd: new package James Hilliard
@ 2020-04-18 16:30 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-04-18 16:30 UTC (permalink / raw)
  To: buildroot

Hello James,

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

On Mon, 13 Apr 2020 16:29:30 -0600
James Hilliard <james.hilliard1@gmail.com> wrote:

> diff --git a/package/apcupsd/Config.in b/package/apcupsd/Config.in
> new file mode 100644
> index 0000000000..d8bf07e1fa
> --- /dev/null
> +++ b/package/apcupsd/Config.in
> @@ -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.

> +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

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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-18 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 22:29 [Buildroot] [PATCH 1/1] package/apcupsd: new package James Hilliard
2020-04-18 16:30 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.