summaryrefslogtreecommitdiff
path: root/sysutils/scanbuttond/files
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/scanbuttond/files')
-rw-r--r--sysutils/scanbuttond/files/patch-lib-loader.c11
-rw-r--r--sysutils/scanbuttond/files/patch-scanbuttond.c35
-rw-r--r--sysutils/scanbuttond/files/patch-scripts-initscanner.sh9
-rw-r--r--sysutils/scanbuttond/files/pkg-message.in37
4 files changed, 92 insertions, 0 deletions
diff --git a/sysutils/scanbuttond/files/patch-lib-loader.c b/sysutils/scanbuttond/files/patch-lib-loader.c
new file mode 100644
index 000000000000..f9d9c50db6b8
--- /dev/null
+++ b/sysutils/scanbuttond/files/patch-lib-loader.c
@@ -0,0 +1,11 @@
+--- lib/loader.c.orig Wed Feb 15 18:00:12 2006
++++ lib/loader.c Fri Mar 31 10:35:41 2006
+@@ -27,7 +27,7 @@
+
+ backend_t* load_backend(const char* filename)
+ {
+- char* error;
++ const char* error;
+ void* dll_handle = dlopen(filename, RTLD_NOW|RTLD_LOCAL);
+ if (!dll_handle) {
+ syslog(LOG_ERR, "loader: failed to load \"%s\". Error message: \"%s\"",
diff --git a/sysutils/scanbuttond/files/patch-scanbuttond.c b/sysutils/scanbuttond/files/patch-scanbuttond.c
new file mode 100644
index 000000000000..a405affbb82a
--- /dev/null
+++ b/sysutils/scanbuttond/files/patch-scanbuttond.c
@@ -0,0 +1,35 @@
+--- scanbuttond.c.orig Fri Feb 17 00:23:53 2006
++++ scanbuttond.c Thu Apr 6 00:52:29 2006
+@@ -223,8 +223,15 @@
+ exit(EXIT_FAILURE);
+ }
+
++ openlog(NULL, 0, LOG_DAEMON);
++
+ // daemonize
+ if (daemonize) {
++ if (daemon(0, 0) != 0) {
++ syslog(LOG_ERR, "daemon() failed.");
++ }
++ }
++/*
+ pid = fork();
+ if (pid < 0) {
+ printf("Can't fork!\n");
+@@ -259,6 +266,7 @@
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+ }
++*/
+
+ // setup the environment
+ char* oldpath = getenv("PATH");
+@@ -292,7 +300,7 @@
+ signal(SIGHUP, &sighandler);
+ signal(SIGINT, &sighandler);
+ signal(SIGSEGV, &sighandler);
+- signal(SIGCLD, SIG_IGN);
++ signal(SIGCHLD, SIG_IGN);
+
+ syslog(LOG_INFO, "scanbuttond started");
+
diff --git a/sysutils/scanbuttond/files/patch-scripts-initscanner.sh b/sysutils/scanbuttond/files/patch-scripts-initscanner.sh
new file mode 100644
index 000000000000..95a283aa366e
--- /dev/null
+++ b/sysutils/scanbuttond/files/patch-scripts-initscanner.sh
@@ -0,0 +1,9 @@
+--- scripts/initscanner.sh.orig Sat Jun 4 12:37:24 2005
++++ scripts/initscanner.sh Fri Mar 31 01:46:29 2006
+@@ -9,5 +9,5 @@
+ # Example:
+ # scanimage -n
+ # or
+-# sane-find-scanners
++# sane-find-scanner > /dev/null 2> /dev/null
+
diff --git a/sysutils/scanbuttond/files/pkg-message.in b/sysutils/scanbuttond/files/pkg-message.in
new file mode 100644
index 000000000000..74e09a789b9b
--- /dev/null
+++ b/sysutils/scanbuttond/files/pkg-message.in
@@ -0,0 +1,37 @@
+-------------------------------------------------------------------------------
+scanbuttond has been installed, but is not quite ready to be used yet.
+
+To make scanbuttond actually do something you have to edit
+%%PREFIX%%/etc/scanbuttond/buttonpressed.sh and change it to your needs.
+
+If you are having trouble getting your scanner detected try uncommenting one
+of the following lines in %%PREFIX%%/etc/scanbuttond/initscanner.sh:
+
+scanimage -n
+or
+sane-find-scanner > /dev/null 2> /dev/null
+
+If your scanner is connected via a hot-plug capable technology (e.g. USB)
+you can conveniently enable scanbuttond every time you attach you scanner by
+using devd. In order to do so you may add the following lines to your
+/etc/devd.conf and restart devd after you are done.
+(Make sure to replace device-name, vendor, product and back-end name to
+something that matches your environment)
+
+attach 20 {
+ device-name "ugen[0-9]+";
+ match "vendor" "0x04a9";
+ match "product" "0x220e";
+ action "%%PREFIX%%/bin/scanbuttond \
+ -s %%PREFIX%%/etc/scanbuttond/buttonpressed.sh \
+ -S %%PREFIX%%/etc/scanbuttond/initscanner.sh \
+ -b %%PREFIX%%/lib/libscanbtnd-backend_plustek.so";
+};
+
+detach 20 {
+ device-name "ugen[0-9]+";
+ match "vendor" "0x04a9";
+ match "product" "0x220e";
+ action "/usr/bin/killall scanbuttond";
+};
+-------------------------------------------------------------------------------