Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2023 22:08:40 GMT
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 2705e09bd8c2 - main - sysutils/scanbd: correct file placement and robustness fix
Message-ID:  <202307112208.36BM8ef2004985@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2705e09bd8c207f8158639d3dbbc47e547ddf115

commit 2705e09bd8c207f8158639d3dbbc47e547ddf115
Author:     Trenton Schulz <trenton@norwegianrockcat.com>
AuthorDate: 2023-07-07 16:58:35 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-11 22:07:21 +0000

    sysutils/scanbd: correct file placement and robustness fix
    
    These are additional revisions based on discussion on bug #272066.
    There, the placement for the sample scripts wasn't correct. So, we now
    move the sample scripts to $LOCALBASE/etc/scanbd/scripts as samples, but
    they aren't marked as samples in the plist. There is also a pkg-message
    that explains this.
    
    This should be the last revision I can see in the immediate future until
    a new release comes out.
    
    PR:             272419
    See also:       272066
---
 sysutils/scanbd/Makefile                     | 14 +++++++++-----
 sysutils/scanbd/files/patch-conf_scanbd.conf |  8 ++++----
 sysutils/scanbd/files/pkg-message.in         | 11 +++++++++++
 sysutils/scanbd/pkg-plist                    | 10 +++++-----
 4 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/sysutils/scanbd/Makefile b/sysutils/scanbd/Makefile
index d94376c62c37..298b444f37af 100644
--- a/sysutils/scanbd/Makefile
+++ b/sysutils/scanbd/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	scanbd
 DISTVERSION=	1.5.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 
 MAINTAINER=	trueos@norwegianrockcat.com
@@ -31,15 +31,19 @@ SHEBANG_GLOB=	*.script
 
 USE_RC_SUBR=	scanbd
 
-SUB_FILES=	scanbd
+SUB_FILES=	pkg-message \
+		scanbd
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/conf/scanbd.conf
+	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/conf/scanbd.conf
 
 post-install:
 	${MV} ${STAGEDIR}${ETCDIR}/scanbd.conf ${STAGEDIR}${ETCDIR}/scanbd.conf.sample
-	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
-	${MV} ${STAGEDIR}${ETCDIR}/scripts ${STAGEDIR}${EXAMPLESDIR}
+	${MV} ${STAGEDIR}${ETCDIR}/scripts/action.script ${STAGEDIR}${ETCDIR}/scripts/action.script.sample
+	${MV} ${STAGEDIR}${ETCDIR}/scripts/example.script ${STAGEDIR}${ETCDIR}/scripts/example.script.sample
+	${MV} ${STAGEDIR}${ETCDIR}/scripts/insert.script ${STAGEDIR}${ETCDIR}/scripts/insert.script.sample
+	${MV} ${STAGEDIR}${ETCDIR}/scripts/scanadf.script ${STAGEDIR}${ETCDIR}/scripts/scanadf.script.sample
+	${MV} ${STAGEDIR}${ETCDIR}/scripts/test.script ${STAGEDIR}${ETCDIR}/scripts/test.script.sample
 	${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d
 	${INSTALL_SCRIPT} ${WRKDIR}/scanbd ${STAGEDIR}${PREFIX}/etc/rc.d/scanbd
 
diff --git a/sysutils/scanbd/files/patch-conf_scanbd.conf b/sysutils/scanbd/files/patch-conf_scanbd.conf
index 7c786843d6ee..f08c92a6a4d3 100644
--- a/sysutils/scanbd/files/patch-conf_scanbd.conf
+++ b/sysutils/scanbd/files/patch-conf_scanbd.conf
@@ -1,4 +1,4 @@
---- conf/scanbd.conf.orig	2023-06-18 13:49:49 UTC
+--- conf/scanbd.conf.orig	2017-08-25 06:29:18 UTC
 +++ conf/scanbd.conf
 @@ -30,7 +30,7 @@ global {
  
@@ -18,10 +18,10 @@
  
          # the saned executable for manager-mode
 -        saned   = "/usr/sbin/saned"
-+        saned   = "/usr/local/sbin/saned"
++        saned   = "%%PREFIX%%/sbin/saned"
          saned_opt  = {} # string-list
 -		saned_env  = { "SANE_CONFIG_DIR=/etc/scanbd" } # list of environment vars for saned
-+		saned_env  = { "SANE_CONFIG_DIR=/usr/local/etc/scanbd" } # list of environment vars for saned
++	saned_env  = { "SANE_CONFIG_DIR=%%PREFIX%%/etc/scanbd" } # list of environment vars for saned
  
          # Scriptdir specifies where scanbd normally looks for scripts.
          # The scriptdir option can be defined as: 
@@ -32,7 +32,7 @@
 -        # Default scriptdir is <path>/etc/scanbd, this is normally appropriate
 -		scriptdir = /etc/scanbd/scripts
 +        # Default scriptdir is <path>/etc/scanbd, this is normally
-+        scriptdir = /usr/local/share/examples/scanbd/scripts
++        scriptdir = %%PREFIX%%/etc/scanbd/scripts
          
          # Scripts to execute upon device insertion/removal.
          # It can be necessary to load firmware into the device when it is first
diff --git a/sysutils/scanbd/files/pkg-message.in b/sysutils/scanbd/files/pkg-message.in
new file mode 100644
index 000000000000..773c4d4aae87
--- /dev/null
+++ b/sysutils/scanbd/files/pkg-message.in
@@ -0,0 +1,11 @@
+[
+{ type: install
+  message: <<EOM
+Sample scripts that scanbd can use are included in
+%%PREFIX%%/etc/scanbd/scripts as <script>.sample. Copy and modify
+these to suit your needs (or start from scratch). For details, see
+%%PREFIX%%/etc/scanbd/scanbd.conf
+
+EOM
+}
+]
diff --git a/sysutils/scanbd/pkg-plist b/sysutils/scanbd/pkg-plist
index 8bd096a4e0a7..a5cf7d0bfcf4 100644
--- a/sysutils/scanbd/pkg-plist
+++ b/sysutils/scanbd/pkg-plist
@@ -1,8 +1,8 @@
-%%EXAMPLESDIR%%/scripts/action.script
-%%EXAMPLESDIR%%/scripts/example.script
-%%EXAMPLESDIR%%/scripts/insert.script
-%%EXAMPLESDIR%%/scripts/scanadf.script
-%%EXAMPLESDIR%%/scripts/test.script
+%%ETCDIR%%/scripts/action.script.sample
+%%ETCDIR%%/scripts/example.script.sample
+%%ETCDIR%%/scripts/insert.script.sample
+%%ETCDIR%%/scripts/scanadf.script.sample
+%%ETCDIR%%/scripts/test.script.sample
 @sample %%ETCDIR%%/scanbd.conf.sample
 %%ETCDIR%%/scanner.d/avision.conf
 %%ETCDIR%%/scanner.d/canon.conf



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307112208.36BM8ef2004985>