From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Apr 6 01:20:17 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 465DC16A400 for ; Thu, 6 Apr 2006 01:20:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9555C43D45 for ; Thu, 6 Apr 2006 01:20:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k361KGKd066403 for ; Thu, 6 Apr 2006 01:20:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k361KG7v066397; Thu, 6 Apr 2006 01:20:16 GMT (envelope-from gnats) Resent-Date: Thu, 6 Apr 2006 01:20:16 GMT Resent-Message-Id: <200604060120.k361KG7v066397@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Daniel Thiele Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A377A16A424 for ; Thu, 6 Apr 2006 01:15:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B722643D53 for ; Thu, 6 Apr 2006 01:15:04 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k361F4X5076327 for ; Thu, 6 Apr 2006 01:15:04 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k361F4LW076326; Thu, 6 Apr 2006 01:15:04 GMT (envelope-from nobody) Message-Id: <200604060115.k361F4LW076326@www.freebsd.org> Date: Thu, 6 Apr 2006 01:15:04 GMT From: Daniel Thiele To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/95386: [NEW PORT] sysutils/scanbuttond: A daemon to monitor and configure modern scanner's buttons X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2006 01:20:17 -0000 >Number: 95386 >Category: ports >Synopsis: [NEW PORT] sysutils/scanbuttond: A daemon to monitor and configure modern scanner's buttons >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 06 01:20:15 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Daniel Thiele >Release: 6.1-PRERELEASE i386 >Organization: none >Environment: FreeBSD iridium.vnws.lan 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Thu Mar 30 21:54:07 CEST 2006 root@iridium.vnws.lan:/usr/obj/usr/src/sys/kernel_v0_6_0_44bsd_nosnd_ich_s3 i386 >Description: This is the port of scanbuttond, an utility to monitor the various buttons found on many modern scanners which are intended to trigger certain actions like copying, faxing or mailing the scanned document. This daemon queries the scanner button state several times per second via libusb and if it detects that a button is pressed it runs a shell script with the button number as an argument. The supported scanner backends currently are: epson, niash, plustek, snapscan Author: Bernhard Stiftner WWW: http://scanbuttond.sourceforge.net/ >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # scanbuttond # scanbuttond/files # scanbuttond/files/patch-lib-loader.c # scanbuttond/files/patch-scanbuttond.c # scanbuttond/files/patch-scripts-initscanner.sh # scanbuttond/Makefile # scanbuttond/distinfo # scanbuttond/pkg-descr # scanbuttond/pkg-plist # scanbuttond/pkg-message # echo c - scanbuttond mkdir -p scanbuttond > /dev/null 2>&1 echo c - scanbuttond/files mkdir -p scanbuttond/files > /dev/null 2>&1 echo x - scanbuttond/files/patch-lib-loader.c sed 's/^X//' >scanbuttond/files/patch-lib-loader.c << 'END-of-scanbuttond/files/patch-lib-loader.c' X--- lib/loader.c.orig Wed Feb 15 18:00:12 2006 X+++ lib/loader.c Fri Mar 31 10:35:41 2006 X@@ -27,7 +27,7 @@ X X backend_t* load_backend(const char* filename) X { X- char* error; X+ const char* error; X void* dll_handle = dlopen(filename, RTLD_NOW|RTLD_LOCAL); X if (!dll_handle) { X syslog(LOG_ERR, "loader: failed to load \"%s\". Error message: \"%s\"", END-of-scanbuttond/files/patch-lib-loader.c echo x - scanbuttond/files/patch-scanbuttond.c sed 's/^X//' >scanbuttond/files/patch-scanbuttond.c << 'END-of-scanbuttond/files/patch-scanbuttond.c' X--- scanbuttond.c.orig Fri Feb 17 00:23:53 2006 X+++ scanbuttond.c Thu Apr 6 00:52:29 2006 X@@ -223,8 +223,15 @@ X exit(EXIT_FAILURE); X } X X+ openlog(NULL, 0, LOG_DAEMON); X+ X // daemonize X if (daemonize) { X+ if (daemon(0, 0) != 0) { X+ syslog(LOG_ERR, "daemon() failed."); X+ } X+ } X+/* X pid = fork(); X if (pid < 0) { X printf("Can't fork!\n"); X@@ -259,6 +266,7 @@ X close(STDOUT_FILENO); X close(STDERR_FILENO); X } X+*/ X X // setup the environment X char* oldpath = getenv("PATH"); X@@ -292,7 +300,7 @@ X signal(SIGHUP, &sighandler); X signal(SIGINT, &sighandler); X signal(SIGSEGV, &sighandler); X- signal(SIGCLD, SIG_IGN); X+ signal(SIGCHLD, SIG_IGN); X X syslog(LOG_INFO, "scanbuttond started"); X END-of-scanbuttond/files/patch-scanbuttond.c echo x - scanbuttond/files/patch-scripts-initscanner.sh sed 's/^X//' >scanbuttond/files/patch-scripts-initscanner.sh << 'END-of-scanbuttond/files/patch-scripts-initscanner.sh' X--- scripts/initscanner.sh.orig Sat Jun 4 12:37:24 2005 X+++ scripts/initscanner.sh Fri Mar 31 01:46:29 2006 X@@ -9,5 +9,5 @@ X # Example: X # scanimage -n X # or X-# sane-find-scanners X+# sane-find-scanner > /dev/null 2> /dev/null X END-of-scanbuttond/files/patch-scripts-initscanner.sh echo x - scanbuttond/Makefile sed 's/^X//' >scanbuttond/Makefile << 'END-of-scanbuttond/Makefile' X# New ports collection makefile for: scanbuttond X# Date created: 31 March 2006 X# Whom: Daniel Thiele X# X# $FreeBSD$ X# X XPORTNAME= scanbuttond XPORTVERSION= 0.2.3 XCATEGORIES= sysutils XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X XMAINTAINER= dthiele@gmx.net XCOMMENT= A daemon to monitor and configure modern scanner's buttons X XLIB_DEPENDS= usb-0.1.8:${PORTSDIR}/devel/libusb X XGNU_CONFIGURE= yes XCONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" \ X LDFLAGS="-L${LOCALBASE}/lib" XCONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} XINSTALLS_SHLIB= yes X X.include X Xpre-configure: X @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} \ X ${REINPLACE_CMD} -e 's|-ldl||g' Xpost-install: X @${CAT} ${PKGMESSAGE} | ${SED} -e 's|%%PREFIX%%|${PREFIX}|g' X X.include END-of-scanbuttond/Makefile echo x - scanbuttond/distinfo sed 's/^X//' >scanbuttond/distinfo << 'END-of-scanbuttond/distinfo' XMD5 (scanbuttond-0.2.3.tar.gz) = 548e6451b398bd95d14f008b4d39ca79 XSHA256 (scanbuttond-0.2.3.tar.gz) = 93b060a363fef069548a49cb151da53ac6071dc0569f9a07d68751a28dffebee XSIZE (scanbuttond-0.2.3.tar.gz) = 333743 END-of-scanbuttond/distinfo echo x - scanbuttond/pkg-descr sed 's/^X//' >scanbuttond/pkg-descr << 'END-of-scanbuttond/pkg-descr' XThis is the port of scanbuttond, an utility to monitor the various buttons Xfound on many modern scanners which are intended to trigger certain actions Xlike copying, faxing or mailing the scanned document. XThis daemon queries the scanner button state several times per second via Xlibusb and if it detects that a button is pressed it runs a shell script with Xthe button number as an argument. X XThe supported scanner backends currently are: epson, niash, plustek, snapscan X X XAuthor: Bernhard Stiftner XWWW: http://scanbuttond.sourceforge.net/ END-of-scanbuttond/pkg-descr echo x - scanbuttond/pkg-plist sed 's/^X//' >scanbuttond/pkg-plist << 'END-of-scanbuttond/pkg-plist' Xbin/scanbuttond Xetc/scanbuttond/buttonpressed.sh Xetc/scanbuttond/initscanner.sh Xetc/scanbuttond/meta.conf Xlib/libscanbtnd-backend_epson.la Xlib/libscanbtnd-backend_epson.so Xlib/libscanbtnd-backend_epson.so.1 Xlib/libscanbtnd-backend_meta.la Xlib/libscanbtnd-backend_meta.so Xlib/libscanbtnd-backend_meta.so.1 Xlib/libscanbtnd-backend_mustek.la Xlib/libscanbtnd-backend_mustek.so Xlib/libscanbtnd-backend_mustek.so.1 Xlib/libscanbtnd-backend_niash.la Xlib/libscanbtnd-backend_niash.so Xlib/libscanbtnd-backend_niash.so.1 Xlib/libscanbtnd-backend_plustek.la Xlib/libscanbtnd-backend_plustek.so Xlib/libscanbtnd-backend_plustek.so.1 Xlib/libscanbtnd-backend_plustek_umax.la Xlib/libscanbtnd-backend_plustek_umax.so Xlib/libscanbtnd-backend_plustek_umax.so.1 Xlib/libscanbtnd-backend_snapscan.la Xlib/libscanbtnd-backend_snapscan.so Xlib/libscanbtnd-backend_snapscan.so.1 Xlib/libscanbtnd-interface_usb.la Xlib/libscanbtnd-interface_usb.so Xlib/libscanbtnd-interface_usb.so.1 X@dirrm etc/scanbuttond END-of-scanbuttond/pkg-plist echo x - scanbuttond/pkg-message sed 's/^X//' >scanbuttond/pkg-message << 'END-of-scanbuttond/pkg-message' X------------------------------------------------------------------------------- Xscanbuttond has been installed, but is not quite ready to be used yet. X XTo make scanbuttond actually do something you have to edit X%%PREFIX%%/etc/scanbuttond/buttonpressed.sh and change it to your needs. X XIf you are having trouble getting your scanner detected try uncommenting one Xof the following lines in %%PREFIX%%/etc/scanbuttond/initscanner.sh: X Xscanimage -n Xor Xsane-find-scanner > /dev/null 2> /dev/null X XIf your scanner is connected via a hot-plug capable technology (e.g. USB) Xyou can conveniently enable scanbuttond every time you attach you scanner by Xusing devd. In order to do so you may add the following lines to your X/etc/devd.conf and restart devd after you are done. X(Make sure to replace device-name, vendor, product and back-end name to Xsomething that matches your environment) X Xattach 20 { X device-name "ugen[0-9]+"; X match "vendor" "0x04a9"; X match "product" "0x220e"; X action "%%PREFIX%%/bin/scanbuttond \ X -s %%PREFIX%%/etc/scanbuttond/buttonpressed.sh \ X -S %%PREFIX%%/etc/scanbuttond/initscanner.sh \ X -b %%PREFIX%%/lib/libscanbtnd-backend_plustek.so"; X}; X Xdetach 20 { X device-name "ugen[0-9]+"; X match "vendor" "0x04a9"; X match "product" "0x220e"; X action "/usr/bin/killall scanbuttond"; X}; X------------------------------------------------------------------------------- END-of-scanbuttond/pkg-message exit >Release-Note: >Audit-Trail: >Unformatted: