rpms/scanbuttond/devel buttonpressed.sh, NONE, 1.1 initscanner.sh, NONE, 1.1 scanbuttond-0.2.3.diff, NONE, 1.1 scanbuttond.init, NONE, 1.1 scanbuttond.spec, NONE, 1.1 sources, NONE, 1.1

Parag Ashok Nemade (paragn) fedora-extras-commits at redhat.com
Mon Oct 16 15:47:09 UTC 2006


Author: paragn

Update of /cvs/extras/rpms/scanbuttond/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28565/devel

Added Files:
	buttonpressed.sh initscanner.sh scanbuttond-0.2.3.diff 
	scanbuttond.init scanbuttond.spec sources 
Log Message:
auto-import scanbuttond-0.2.3-7 on branch devel from scanbuttond-0.2.3-7.src.rpm


--- NEW FILE buttonpressed.sh ---
#!/bin/sh

# This script is started by scanbuttond whenever a scanner button has been pressed.
# Scanbuttond passes the following parameters to us:
# $1 ... the button number
# $2 ... the scanner's SANE device name, which comes in handy if there are two or 
#        more scanners. In this case we can pass the device name to SANE programs 
#        like scanimage.

TMPFILE="/tmp/scan.tiff"
LOCKFILE="/tmp/copy.lock"

case $1 in
	1)
		echo "button 1 has been pressed on $2"
		
		# This example turns your scanner+printer into a photocopier.
		# Fine-tuned for the Epson Perfection 2400, the HP LaserJet 1200 and
		# ISO A4 paper size so that the scanned document matches the printer
		# output as closely as possible.
		#
		# if [ -f $LOCKFILE ]; then
		#   echo "Error: Another scanning operation is currently in progress"
		#   exit
		# fi
		# touch $LOCKFILE
		# rm -f $TMPFILE
		 scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
		 gimp /tmp/image.pnm
		# tiff2ps -z -w 8.27 -h 11.69 $TMPFILE | lpr
		# rm -f $LOCKFILE
		#
		;;
	2)
		echo "button 2 has been pressed on $2"
                 scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
		 lpr /tmp/image.pnm	
		;;
	3)
		echo "button 3 has been pressed on $2"
                 scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
	          evolution mailto:?attach=/tmp/image.pnm	
		;;
	4)
		echo "button 4 has been pressed on $2"
		;;
esac



--- NEW FILE initscanner.sh ---
#!/bin/sh

# This script is executed whenever scanbuttond
# finds new devices.
# If your scanner needs a firmware upload or any other kind
# of special action to be taken on initialization, put
# the apropriate command here.

# Example:
 scanimage -n
# or
# sane-find-scanners


scanbuttond-0.2.3.diff:

--- NEW FILE scanbuttond-0.2.3.diff ---
diff -uNr scanbuttond-0.2.3.orig/backends/meta.conf scanbuttond-0.2.3/backends/meta.conf
--- scanbuttond-0.2.3.orig/backends/meta.conf	2006-02-15 17:43:54.000000000 +0100
+++ scanbuttond-0.2.3/backends/meta.conf	2006-10-10 10:11:05.000000000 +0200
@@ -1,6 +1,6 @@
-libscanbtnd-backend_epson.so
-libscanbtnd-backend_plustek.so
-libscanbtnd-backend_plustek_umax.so
-libscanbtnd-backend_snapscan.so
-libscanbtnd-backend_niash.so
-libscanbtnd-backend_mustek.so
+libscanbtnd-backend_epson.so.1
+libscanbtnd-backend_plustek.so.1
+libscanbtnd-backend_plustek_umax.so.1
+libscanbtnd-backend_snapscan.so.1
+libscanbtnd-backend_niash.so.1
+libscanbtnd-backend_mustek.so.1
diff -uNr scanbuttond-0.2.3.orig/scanbuttond.c scanbuttond-0.2.3/scanbuttond.c
--- scanbuttond-0.2.3.orig/scanbuttond.c	2006-02-17 00:23:53.000000000 +0100
+++ scanbuttond-0.2.3/scanbuttond.c	2006-10-10 10:14:23.000000000 +0200
@@ -32,7 +32,7 @@
 #include "scanbuttond/scanbuttond.h"
 #include "scanbuttond/loader.h"
 
-#define DEF_BACKEND_FILENAME		STRINGIFY(LIB_DIR) "/libscanbtnd-backend_meta.so"
+#define DEF_BACKEND_FILENAME		STRINGIFY(LIB_DIR) "/libscanbtnd-backend_meta.so.1"
 #define DEF_BUTTONPRESSED_SCRIPT	STRINGIFY(CFG_DIR) "/buttonpressed.sh"
 #define DEF_INITSCANNER_SCRIPT		STRINGIFY(CFG_DIR) "/initscanner.sh"
 #define DEF_POLL_DELAY			333000L


--- NEW FILE scanbuttond.init ---
#!/bin/bash
#
# Startup script for Scanbuttond
#
# chkconfig: - 98 54
# description: LISa is a small daemon which is intended to run on \
#              end user systems. It provides something like a \
#              "network neighbourhood", but only relying on the TCP/IP \
#              protocol stack, no smb or whatever.\
#              The information about the hosts in your "neighbourhood" \
#              is provided via TCP port 7741.
# processname: scanbuttond
# config: /etc/scanbuttond

# Source function library.
. /etc/rc.d/init.d/functions

# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

# Some definitions.
scanbuttond=/usr/bin/scanbuttond
prog=scanbuttond
RETVAL=0

#
start() {
        echo -n $"Starting $prog: "
        daemon $scanbuttond $OPTIONS
        RETVAL=$?
        echo
        if [ $RETVAL = 0 ] ; then
           touch /var/lock/subsys/scanbuttond
        else
           RETVAL=1
        fi
        return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc $scanbuttond
	RETVAL=$?
	echo
	if [ $RETVAL = 0 ] ; then
           rm -f /var/lock/subsys/scanbuttond
        else
           RETVAL=1
        fi
        return $RETVAL
}

reload() {
	echo -n $"Reloading $prog: "
	killproc $scanbuttond -HUP
	RETVAL=$?
	echo
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status $scanbuttond
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  condrestart)
        [ -f /var/lock/subsys/scanbuttond ] && restart
        ;;
  *)
	echo $"Usage: $prog {start|stop|restart|status|condrestart}"
	exit 1
esac

exit $RETVAL


--- NEW FILE scanbuttond.spec ---
Name:            scanbuttond
Version:         0.2.3
Release:         7%{?dist}
Summary:         Scanner Button tools to SANE

Group:           System Environment/Libraries
License:         GPL
URL:             http://scanbuttond.sf.net
Source0:         http://easynews.dl.sourceforge.net/sourceforge/scanbuttond/%{name}-%{version}.tar.gz
Source1:         scanbuttond.init
Source2:         initscanner.sh
Source3:         buttonpressed.sh
Patch0:          scanbuttond-0.2.3.diff
BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post):  /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun):/sbin/service
Requires(post):  /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires:   libusb-devel
#Requires:       sane-backends evolution cups

%description
Modern scanners usually have several front panel buttons which are intended to
trigger certain actions like copying, faxing or mailing the scanned document.
This daemon monitors the scanner's buttons and runs a shell script whenever one
of these buttons has been pressed. Because it is accessing the scanner directly
via libusb, there should be no conflicts with SANE or other scanner drivers:
scanbuttond simply won't touch the scanner hardware while you are using SANE.

%prep
%setup -q
%patch0 -p1

%build
%configure --libdir=%{_libdir}/scanbuttond
make  %{?_smp_mflags}

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

rm -rf %{buildroot}%{_libdir}/scanbuttond/*.{la,so}
mkdir -p -m 755 %{buildroot}%{_initrddir}
install -c -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/scanbuttond
rm -rf %{buildroot}%{_sysconfdir}/scanbuttond/*.sh
install -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/scanbuttond/
install -m 755 %{SOURCE3} %{buildroot}%{_sysconfdir}/scanbuttond/

%clean
rm -rf %{buildroot}

%post
/sbin/chkconfig --add scanbuttond


%postun
if [ "$1" -ge "1" ]; then
    /sbin/service scanbuttond condrestart >/dev/null 2>&1 || :
fi

%preun
if [ $1 = 0 ]; then
 /sbin/service scanbuttond stop > /dev/null 2>&1 || :
 /sbin/chkconfig --del scanbuttond
fi

%files
%defattr(-,root,root)
%doc README COPYING AUTHORS ChangeLog
%{_bindir}/scanbuttond
%{_libdir}/scanbuttond
%config(noreplace) %{_sysconfdir}/scanbuttond/meta.conf
%{_sysconfdir}/scanbuttond
%{_initrddir}/scanbuttond


%changelog
* Tue Oct 12 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-7
- missing directory ownership Fixed

* Tue Oct 11 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-6
- Move libscanbtnd*so to %%{_libdir}/scanbuttond.
- Let the app dlopen *.so.1 instead of *.so.

* Tue Oct 10 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-5
- wrong preun call for ldconfig fix to postun

* Tue Oct 05 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-4
- Some SPEC file Fixes

* Tue Oct 03 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-3
- Chmod'd Source1-3 644, to avoid rpmlint error on SRPM
- Fixed error that installs Source1 *in* %%{_initrddir}/scannerbuttond/
- Renamed Source1 to scanbuttond.init

* Tue Oct 03 2006 Parag Nemade <panemade at gmail.com>- 0.2.3-2
- Initial Release


--- NEW FILE sources ---
548e6451b398bd95d14f008b4d39ca79  scanbuttond-0.2.3.tar.gz




More information about the fedora-extras-commits mailing list