Skip to content
Snippets Groups Projects
Commit ff294168 authored by Trenton Schulz's avatar Trenton Schulz Committed by Robert Clausecker
Browse files

sysutils/scanbd: Make the port better behaved.

- Address issues in rclint, portlint and the port test tool.
- make sure scanbd.conf is a sample file.

PR:		272066
parent 658a65e0
No related branches found
No related tags found
No related merge requests found
PORTNAME= scanbd
DISTVERSION= 1.5.1
PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= trueos@norwegianrockcat.com
......@@ -24,15 +25,22 @@ GL_COMMIT= 4503640d202c06510f21848a684e221f613f324b
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-user --with-group
CONFIGURE_ARGS+= --with-user=saned --with-group=saned
SHEBANG_GLOB= *.script
SHEBANG_GLOB= *.script
USE_RC_SUBR= scanbd
SUB_FILES= scanbd
post-patch:
@${REINPLACE_CMD} -e 's|/usr/local|${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}
${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d
${INSTALL_SCRIPT} ${WRKDIR}/scanbd ${STAGEDIR}${PREFIX}/etc/rc.d/scanbd
.include <bsd.port.mk>
--- conf/scanbd.conf.orig 2023-06-18 13:49:49 UTC
+++ conf/scanbd.conf
@@ -30,7 +30,7 @@ global {
# debug logging
# 1=error, 2=warn, 3=info, 4-7=debug
- debug-level = 7
+ debug-level = 2
# drop priviliges to this user
#=============================
@@ -52,12 +52,12 @@ global {
# *BSD (no group lp here, use daemon instead)
# group = daemon # root
#
- group = lp
+ group = saned
# the saned executable for manager-mode
- saned = "/usr/sbin/saned"
+ saned = "/usr/local/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
# Scriptdir specifies where scanbd normally looks for scripts.
# The scriptdir option can be defined as:
@@ -68,8 +68,8 @@ global {
# sets scriptdir to <path>/etc/scanbd/scripts.
# scriptdir = /some/path
# sets scriptdir to the specified absolute path
- # 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
# Scripts to execute upon device insertion/removal.
# It can be necessary to load firmware into the device when it is first
#!/bin/sh
# PROVIDE: scanbd
# REQUIRE: DAEMON FILESYSTEMS dbus
# KEYWORD:
# REQUIRE: DAEMON FILESYSTEMS LOGIN dbus
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable the service
# scanbd_enable (bool): Set to NO by default.
# Set to YES to enable scanbd.
# scanbd_config (path): set to %%PREFIX%%/etc/scanbd/scanbd.conf
# by default
. /etc/rc.subr
name=scanbd
# scanbd_user=saned # Fix this
desc="Scanbd: Scan button Daemon"
rcvar=scanbd_enable
command_args=""
command="%%PREFIX%%/sbin/${name}"
load_rc_config $name
: ${scanbd_enable:=NO}
: ${scanbd_config="%%PREFIX%%/etc/scanbd/scanbd.conf"}
command_args="-c $scanbd_config"
command="%%PREFIX%%/sbin/${name}"
run_rc_command "$1"
%%ETCDIR%%/scripts/action.script
%%ETCDIR%%/scripts/example.script
%%ETCDIR%%/scripts/insert.script
%%ETCDIR%%/scripts/scanadf.script
%%ETCDIR%%/scripts/test.script
%%ETCDIR%%/scanbd.conf
%%EXAMPLESDIR%%/scripts/action.script
%%EXAMPLESDIR%%/scripts/example.script
%%EXAMPLESDIR%%/scripts/insert.script
%%EXAMPLESDIR%%/scripts/scanadf.script
%%EXAMPLESDIR%%/scripts/test.script
@sample %%ETCDIR%%/scanbd.conf.sample
%%ETCDIR%%/scanner.d/avision.conf
%%ETCDIR%%/scanner.d/canon.conf
%%ETCDIR%%/scanner.d/fujitsu.conf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment