Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] sane: update to 1.0.32, add libcurl for escl backend, add runit service
@ 2021-07-08  9:45 amak79
  2021-07-08 10:07 ` [PR PATCH] [Updated] " amak79
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: amak79 @ 2021-07-08  9:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4689 bytes --]

There is a new pull request by amak79 against master on the void-packages repository

https://github.com/amak79/void-packages sane
https://github.com/void-linux/void-packages/pull/31851

sane: update to 1.0.32, add libcurl for escl backend, add runit service
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->
Changes

* Update SANE to 1.0.32
* Make Avahi support optional
* Add libcurl for eSCL (AirScan) backend when Avahi is enabled
* Add `_saned` user/group
* Add a runit service for `saned`

There is an issue with the runit service when SANE is built with Avahi support. `saned` will spawn a second process (pid 1429) which can be seen below:
```
$ ps
1428 _saned   _saned    0.0  0.0  16164  6088 ?        S    18:57:06 00:00:00 saned -l -u _saned -d128
1429 _saned   _saned    0.0  0.0  16164   548 ?        S    18:57:06 00:00:00 saned -l -u _saned -d128
```
```
$ svlogtail
2021-07-08T08:57:06.35901 daemon.debug: Jul  8 18:57:06 saned[1428]: read_config: searching for config file
2021-07-08T08:57:06.35906 daemon.debug: Jul  8 18:57:06 saned[1428]: read_config: done reading config
2021-07-08T08:57:06.35909 daemon.debug: Jul  8 18:57:06 saned[1428]: saned (AF-indep+IPv6) from sane-backends 1.0.32 starting up
2021-07-08T08:57:06.35911 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: trying to get port for service "sane-port" (getaddrinfo)
2021-07-08T08:57:06.36066 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] socket () using IPv6
2021-07-08T08:57:06.36069 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] setsockopt ()
2021-07-08T08:57:06.36066 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] socket () using IPv6
2021-07-08T08:57:06.36069 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] setsockopt ()
2021-07-08T08:57:06.36070 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] bind () to port 6566
2021-07-08T08:57:06.36072 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] listen ()
2021-07-08T08:57:06.36076 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] socket () using IPv4
2021-07-08T08:57:06.36077 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] setsockopt ()
2021-07-08T08:57:06.36079 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] bind () to port 6566
2021-07-08T08:57:06.36080 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] bind failed: Address already in use
2021-07-08T08:57:06.36083 daemon.debug: Jul  8 18:57:06 saned[1428]: Dropped privileges to uid 993 gid 990
2021-07-08T08:57:06.36084 daemon.debug: Jul  8 18:57:06 saned[1428]: run_standalone: spawning Avahi process
2021-07-08T08:57:06.36101 daemon.debug: Jul  8 18:57:06 saned[1428]: run_standalone: waiting for control connection
2021-07-08T08:57:06.36204 daemon.debug: Jul  8 18:57:06 saned[1429]: saned_avahi_callback: AVAHI_CLIENT_CONNECTING
```
The second process is related to Avahi functionality. `sv` will stop the main process (pid 1428) but the second process remains. This doesn’t occur when SANE is built without Avahi support. This is why I made Avahi support optional.

I don't know how to properly fix this other than to have a `./finish` script clean up any lingering `saned` processes, but I’m not sure how safe that is. If there is no acceptable solution I can drop the runit service from this PR.

A patch file from https://github.com/void-linux/void-packages/pull/31851.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sane-31851.patch --]
[-- Type: text/x-diff, Size: 3288 bytes --]

From 480f56a2b7e10b67ed5b1bb6325f45f5455857eb Mon Sep 17 00:00:00 2001
From: amak <amak.git@outlook.com>
Date: Thu, 8 Jul 2021 18:42:06 +1000
Subject: [PATCH] sane: update to 1.0.32, add libcurl for escl backend, add
 runit service

---
 srcpkgs/sane/files/saned/log/run |  2 ++
 srcpkgs/sane/files/saned/run     |  3 +++
 srcpkgs/sane/template            | 29 +++++++++++++++++++++--------
 3 files changed, 26 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/sane/files/saned/log/run
 create mode 100644 srcpkgs/sane/files/saned/run

diff --git a/srcpkgs/sane/files/saned/log/run b/srcpkgs/sane/files/saned/log/run
new file mode 100644
index 000000000000..103a945feb70
--- /dev/null
+++ b/srcpkgs/sane/files/saned/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec vlogger -t saned
diff --git a/srcpkgs/sane/files/saned/run b/srcpkgs/sane/files/saned/run
new file mode 100644
index 000000000000..85e8d1d0ae12
--- /dev/null
+++ b/srcpkgs/sane/files/saned/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec saned ${OPTS:- -l -u _saned}
diff --git a/srcpkgs/sane/template b/srcpkgs/sane/template
index 35dac1cc846a..13362b252ae1 100644
--- a/srcpkgs/sane/template
+++ b/srcpkgs/sane/template
@@ -1,28 +1,39 @@
 # Template file for 'sane'
 pkgname=sane
-_gitlab_release_hash=8bf1cae2e1803aefab9e5331550e5d5d
-version=1.0.31
-revision=3
+_gitlab_release_hash=104f09c07d35519cc8e72e604f11643f
+version=1.0.32
+revision=1
 wrksrc="sane-backends-${version}"
 build_style=gnu-configure
 configure_args="--disable-locking --enable-ipv6 --enable-pthread
  --with-usb --docdir=/usr/share/doc/sane ac_cv_func_mmap_fixed_mapped=yes
  $(vopt_with snmp)"
 hostmakedepends="pkg-config"
-makedepends="avahi-libs-devel libjpeg-turbo-devel tiff-devel libgphoto2-devel
- v4l-utils-devel libusb-devel openssl-devel libxml2-devel
- $(vopt_if snmp net-snmp-devel)"
+makedepends="libjpeg-turbo-devel tiff-devel libgphoto2-devel v4l-utils-devel
+ libusb-devel openssl-devel libxml2-devel $(vopt_if snmp net-snmp-devel)
+ $(vopt_if avahi avahi-libs-devel)"
 depends="$(vopt_if snmp net-snmp)"
 conf_files="/etc/sane.d/*.conf"
 short_desc="Scanner Access Now Easy"
 maintainer="Piraty <piraty1@inbox.ru>"
 license="GPL-2.0-or-later, SANE-exception"
 homepage="http://www.sane-project.org/"
+changelog="https://gitlab.com/sane-project/backends/-/raw/master/NEWS"
 distfiles="https://gitlab.com/sane-project/backends/uploads/${_gitlab_release_hash}/sane-backends-${version}.tar.gz"
-checksum=4a3b10fcb398ed854777d979498645edfe66fcac2f2fd2b9117a79ff45e2a5aa
+checksum=3a28c237c0a72767086202379f6dc92dbb63ec08dfbab22312cba80e238bb114
 noshlibprovides="avoid false detection of device drivers"
 
-build_options="snmp"
+# supplementary group 'lp' required to access some all-in-one devices
+system_accounts="_saned"
+_saned_groups="lp,scanner"
+
+build_options="avahi snmp"
+build_options_default="avahi"
+
+# enable support for escl (airscan) backend
+if [ "$build_option_avahi" ]; then
+	makedepends+=" libcurl-devel"
+fi
 
 post_build() {
 	# generate udev file
@@ -40,6 +51,8 @@ post_install() {
 	vlicense LICENSE # License clarification
 	vlicense COPYING # GPL-2.0
 	sed -n "1,43 p" "${wrksrc}/backend/dll.c" > "${DESTDIR}/usr/share/licenses/sane/SANE-EXCEPTION"
+
+	vsv saned
 }
 
 libsane_package() {

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

end of thread, other threads:[~2021-10-28  4:20 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  9:45 [PR PATCH] sane: update to 1.0.32, add libcurl for escl backend, add runit service amak79
2021-07-08 10:07 ` [PR PATCH] [Updated] " amak79
2021-07-08 11:24 ` amak79
2021-07-09 20:47 ` [PR REVIEW] " Piraty
2021-07-09 20:54 ` Piraty
2021-07-10  0:45 ` [PR PATCH] [Updated] " amak79
2021-07-14  5:30 ` amak79
2021-07-17  4:04 ` ericonr
2021-07-17  7:29 ` amak79
2021-07-18  2:38 ` [PR PATCH] [Updated] " amak79
2021-07-20 19:20 ` [PR REVIEW] " ericonr
2021-07-20 19:20 ` ericonr
2021-07-21  0:56 ` [PR PATCH] [Updated] " amak79
2021-07-21 21:27 ` ericonr
2021-07-22  3:36 ` amak79
2021-07-22 18:53 ` ericonr
2021-07-23  1:58 ` [PR PATCH] [Updated] " amak79
2021-07-23  2:06 ` amak79
2021-07-23 13:13 ` [PR PATCH] [Updated] " amak79
2021-08-13  2:27 ` amak79
2021-08-13  2:29 ` amak79
2021-08-24  8:01 ` [PR PATCH] [Updated] " amak79
2021-10-26  9:49 ` amak79
2021-10-28  4:20 ` [PR PATCH] [Merged]: sane: " ericonr
2021-10-28  4:20 ` ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).