From nobody Mon Jun 26 23:28:06 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QqkY25J5Bz4kL7f; Mon, 26 Jun 2023 23:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QqkY24Cpdz3vKV; Mon, 26 Jun 2023 23:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687822086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UAThFW9WjJ7MpHC6Bc/hyNxgO3c0bzBmzMcXgYqHyXE=; b=PHOdf0Hx/m5xs1RV7D0vP8iykSxCzsFW646ycdf7X57c+QB689Y8W53kLx7ThiFew11rw3 FF8EO2WlnZo+1EmqetIwd/80CoHpLSM1Zq/U3ie/U/DHYEAqeCpMvTZgusGoGlfM/4ZnEu FaM9ZcFwoW6XN9E/LIBG9vUnAhlccp4zppNDqZx8VQmubVDgn+/9JaFSgtsmEb55wZcR+v Gyg29jULY+8nDCzNVkMV1UlQl3hvjzjpyYLWrRhyEHcR11Z+wAVOG+VwROaCOzkla7NC8T 8vHYMrNPiyahWLJ/zomUFmADJPdFchbnPyUjiMnklMQwWXBY94K6kcLXBcbiqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687822086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UAThFW9WjJ7MpHC6Bc/hyNxgO3c0bzBmzMcXgYqHyXE=; b=QA21hvsOs1YCFZIsaXak2nu/puLqniQC+2TfBCYpHVR6W3fQzGjVymeLVvTFQ3E3wnobuV 6vl3LqQaJrIITP08PvUOiajmqRu8miiHgLhhkVyLFTxokEsLEip6VCDHBpGejK63Dv/Uva e40XaaYOvkuggyoLvLWA5Er+9aJtgE3h9o0JS2NYV9PEhiS2WKIVJjU265Q3u1jsJSQ7qw Mpsw6PpYpcZEamXaBJ15snmFV0j+9mvTdp9W8d7AT2e/KCBGS/1O2XNfXAXPrQ+o0MYiF0 J5MGN5416uJQU+4G+ZQqi3rq9zM6FwwrD16qNy56WelvLTWY+vuMXFpTri7/ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687822086; a=rsa-sha256; cv=none; b=LC/0LA9QZmBnlO/52GIfjvSzl4kkkNpDWlcvdi9NGQccejiyx1LEVB06AlkIZsjkUQ6vSE uRw/Tz7m9AyvZHLf41vF2B89kFqG948oWN6HuEbw3s3nAct8k2H0eAHVW0ZqqVyGnHbC6B V/yC92S9iXji27g4b5nQVS7XAVQD+cE5KVBsDlWCaW44mC2aALYaaiYF7SnN+UvVTBFYO+ q0XWbbq+ns7v7gc2road6/83s3Z/sX+c+j+4fOYlRW6UAAgNqg5rLfxQOkzlXdR+lyjDsx qpkFNhLEbwH5P2O/Q8VvB1q6zCtMtU2w6NPNfH8GjaFDMxvWU0B1p97/+guy1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QqkY239F4zVJk; Mon, 26 Jun 2023 23:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35QNS6bO016264; Mon, 26 Jun 2023 23:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35QNS6pw016263; Mon, 26 Jun 2023 23:28:06 GMT (envelope-from git) Date: Mon, 26 Jun 2023 23:28:06 GMT Message-Id: <202306262328.35QNS6pw016263@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: ff2941686756 - main - sysutils/scanbd: Make the port better behaved. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff2941686756eeffa63a57949cf6a2150bc5d5fb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=ff2941686756eeffa63a57949cf6a2150bc5d5fb commit ff2941686756eeffa63a57949cf6a2150bc5d5fb Author: Trenton Schulz AuthorDate: 2023-06-18 09:40:06 +0000 Commit: Robert Clausecker CommitDate: 2023-06-26 22:58:23 +0000 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 --- sysutils/scanbd/Makefile | 12 +++++++-- sysutils/scanbd/files/patch-conf_scanbd.conf | 38 ++++++++++++++++++++++++++++ sysutils/scanbd/files/scanbd.in | 24 ++++++++++++++---- sysutils/scanbd/pkg-plist | 12 ++++----- 4 files changed, 73 insertions(+), 13 deletions(-) diff --git a/sysutils/scanbd/Makefile b/sysutils/scanbd/Makefile index 9ee2ef19027b..d94376c62c37 100644 --- a/sysutils/scanbd/Makefile +++ b/sysutils/scanbd/Makefile @@ -1,5 +1,6 @@ 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 diff --git a/sysutils/scanbd/files/patch-conf_scanbd.conf b/sysutils/scanbd/files/patch-conf_scanbd.conf new file mode 100644 index 000000000000..7c786843d6ee --- /dev/null +++ b/sysutils/scanbd/files/patch-conf_scanbd.conf @@ -0,0 +1,38 @@ +--- 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 /etc/scanbd/scripts. + # scriptdir = /some/path + # sets scriptdir to the specified absolute path +- # Default scriptdir is /etc/scanbd, this is normally appropriate +- scriptdir = /etc/scanbd/scripts ++ # Default scriptdir is /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 diff --git a/sysutils/scanbd/files/scanbd.in b/sysutils/scanbd/files/scanbd.in index e2924b9c6f9b..cbee8687e477 100755 --- a/sysutils/scanbd/files/scanbd.in +++ b/sysutils/scanbd/files/scanbd.in @@ -1,16 +1,30 @@ #!/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" diff --git a/sysutils/scanbd/pkg-plist b/sysutils/scanbd/pkg-plist index 11a68ee236ce..8bd096a4e0a7 100644 --- a/sysutils/scanbd/pkg-plist +++ b/sysutils/scanbd/pkg-plist @@ -1,9 +1,9 @@ -%%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