Subject: [PATCH] main/apcupsd: add libusb dependency

From: Wolf <[email-masked]>
Date: Thu, 25 Nov 2021 02:42:54 +0100

---

Under 3.15 apcupsd fails to start unless libusb package is manually
installed:

# rc-service apcupsd start
 * Starting APC UPS daemon ...
/sbin/apcupsd: error while loading libusb-1.0.so.0 from libusb-0.1.so.4: Error loading shared library libusb-1.0.so.0: No such file or directory
 * start-stop-daemon: failed to start `/sbin/apcupsd'                                                                                                                                    [ !! ]
 * ERROR: apcupsd failed to start

This should probably be backported to 3.15 as well. No idea how to send
patches against that.

 main/apcupsd/APKBUILD | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main/apcupsd/APKBUILD b/main/apcupsd/APKBUILD
index fda125aa29..dbf8562b24 100644
--- a/main/apcupsd/APKBUILD
+++ b/main/apcupsd/APKBUILD
@@ -1,13 +1,13 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=apcupsd
 pkgver=3.14.14
-pkgrel=2
+pkgrel=3
 pkgdesc="A Daemon to control APC UPSes"
 subpackages="$pkgname-doc $pkgname-webif $pkgname-openrc"
 url="http://www.apcupsd.org"
 arch="all"
 license="GPL-2.0-only"
-depends="util-linux"
+depends="util-linux libusb"
 makedepends="net-snmp-dev linux-headers gd-dev libusb-compat-dev"
 options="!check" # no test suite included
 source="https://sourceforge.net/projects/apcupsd/files/apcupsd%20-%20Stable/$pkgver/apcupsd-$pkgver.tar.gz
-- 
2.33.1

---

From: Henrik Riomar <[email-masked]>
Date: Thu, 25 Nov 2021 06:24:21 -0000

does requirement on usb not depend on the config file? i.e. only the system handling the actual ups needs this not all slave systems connecting over the network? also serial ups's does not need usb.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_194247

---

From: mailinglist-bot <[email-masked]>
Date: Thu, 25 Nov 2021 10:20:16 -0000

Wolf <[email-masked]> replied via email:

```
Hi,

On 2021-11-25 06:24:21 -0000, Henrik Riomar wrote:
> does requirement on usb not depend on the config file? i.e. only the
> system handling the actual ups needs this not all slave systems
> connecting over the network? also serial ups's does not need usb.

I've changed my configuration file to use net instead and it still
refused to start. So I think this is actually necessary, unless I've
overlooked something in the configuration file (I mean, that is always a
possibility).

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

```

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_194282

---

From: Wolf <[email-masked]>
Date: Thu, 25 Nov 2021 11:20:09 +0100

Hi,

W.

---

From: Henrik Riomar <[email-masked]>
Date: Thu, 25 Nov 2021 15:17:11 -0000

tested installation on v3.14 of `apcupsd`, the following is pulled
```
    Package changes:
    +apcupsd-3.14.14-r1
    +apcupsd-openrc-3.14.14-r1
    +blkid-2.37-r0
    +cfdisk-2.37-r0
    +findmnt-2.37-r0
    +flock-2.37-r0
    +hexdump-2.37-r0
    +libeconf-0.3.8-r1
    +libfdisk-2.37-r0
    +libusb-1.0.24-r2
    +libusb-compat-0.1.5-r4
    +logger-2.37-r0
    +mcookie-2.37-r0
    +partx-2.37-r0
    +setpriv-2.37-r0
    +sfdisk-2.37-r0
    +util-linux-2.37-r0
    +util-linux-openrc-2.37-r0
    +uuidgen-2.37-r0
```

`libusb-compat` depends on `libusb` on 3.14:
https://pkgs.alpinelinux.org/package/v3.14/main/x86_64/libusb-compat

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_194344

---

From: Wolf <[email-masked]>
Date: Thu, 25 Nov 2021 16:30:44 +0100

> https://pkgs.alpinelinux.org/package/v3.14/main/x86_64/libusb-compat

It does not in 3.15:

https://pkgs.alpinelinux.org/package/v3.15/main/x86_64/libusb-compat

So it should probably fixed there, but I'm not sure what the cause is.

---

From: mailinglist-bot <[email-masked]>
Date: Thu, 25 Nov 2021 15:30:50 -0000

```

It does not in 3.15:

```

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_194357

---

From: mailinglist-bot <[email-masked]>
Date: Sat, 27 Nov 2021 23:15:14 -0000

```
> So it should probably fixed there, but I'm not sure what the cause is.

This patch can be dropped, I've sent separate one against
libusb-compact.

W.

```

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_194945

---

From: Henrik Riomar <[email-masked]>
Date: Sun, 28 Nov 2021 13:48:02 -0000

Replaced by !27859

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27747#note_195039

---

From: Wolf <[email-masked]>
Date: Sun, 28 Nov 2021 00:15:07 +0100

W.