summaryrefslogtreecommitdiff
path: root/misc/cuecat
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2001-02-13 13:55:42 +0000
committerwiz <wiz@pkgsrc.org>2001-02-13 13:55:42 +0000
commit27707d4ac9c40c8616cce59205fc67558678ca2f (patch)
tree2cc42a813a4f3298c483c8140bf77772b7ed5aa3 /misc/cuecat
parent88c2a995bbc05f723751bc1a39072d057f41eb43 (diff)
downloadpkgsrc-27707d4ac9c40c8616cce59205fc67558678ca2f.tar.gz
Initial import of cuecat, a package to support reading and parsing
the output of the CueCat barcode reader under NetBSD.
Diffstat (limited to 'misc/cuecat')
-rw-r--r--misc/cuecat/Makefile24
-rw-r--r--misc/cuecat/files/md53
-rw-r--r--misc/cuecat/files/patch-sum4
-rw-r--r--misc/cuecat/patches/patch-aa16
-rw-r--r--misc/cuecat/patches/patch-ab161
-rw-r--r--misc/cuecat/pkg/COMMENT1
-rw-r--r--misc/cuecat/pkg/DESCR5
-rw-r--r--misc/cuecat/pkg/MESSAGE10
-rw-r--r--misc/cuecat/pkg/PLIST4
9 files changed, 228 insertions, 0 deletions
diff --git a/misc/cuecat/Makefile b/misc/cuecat/Makefile
new file mode 100644
index 00000000000..2fd5b3e1626
--- /dev/null
+++ b/misc/cuecat/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+#
+
+DISTNAME= cuecat-0.2.1
+CATEGORIES= misc
+MASTER_SITES= ftp://opensource.lineo.com/drivers/ \
+ http://www.flyingbuttmonkeys.com/mirrors/oss.lineo.com/drivers/
+
+MAINTAINER= wiz@netbsd.org
+HOMEPAGE= http://opensource.lineo.com/cuecat/cuecat_driver/
+
+NO_SOURCE_ON_FTP= Hardware manufacturer claims intellectual property infringement.
+NO_SOURCE_ON_CDROM= ${NO_SOURCE_ON_FTP}
+NO_BIN_ON_FTP= ${NO_SOURCE_ON_FTP}
+NO_BIN_ON_FTP= ${NO_SOURCE_ON_FTP}
+
+USE_GMAKE= yes
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/read_cuecat ${PREFIX}/bin
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/cuecat
+ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/cuecat
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/misc/cuecat/files/md5 b/misc/cuecat/files/md5
new file mode 100644
index 00000000000..9fb486fcb4d
--- /dev/null
+++ b/misc/cuecat/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+
+MD5 (cuecat-0.2.1.tar.gz) = 828c4d693863b98ee6cc5d5d84647dd5
diff --git a/misc/cuecat/files/patch-sum b/misc/cuecat/files/patch-sum
new file mode 100644
index 00000000000..e7c2989e3a2
--- /dev/null
+++ b/misc/cuecat/files/patch-sum
@@ -0,0 +1,4 @@
+$NetBSD: patch-sum,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+
+MD5 (patch-aa) = a4a411d768c22099c791f906653d0577
+MD5 (patch-ab) = 5682df3e3b9d3630c4870d5ae96e982c
diff --git a/misc/cuecat/patches/patch-aa b/misc/cuecat/patches/patch-aa
new file mode 100644
index 00000000000..b32e53c4baf
--- /dev/null
+++ b/misc/cuecat/patches/patch-aa
@@ -0,0 +1,16 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+
+--- Makefile.orig Mon Sep 18 19:26:03 2000
++++ Makefile
+@@ -1,8 +1,9 @@
+ RM=/bin/rm
+-CC=gcc
++#CC=gcc
+ AR=ar
+-CFLAGS=-Wall -Wstrict-prototypes -O2
++CFLAGS+=-Wall -Wstrict-prototypes
+
++all: read_cuecat
+
+
+ read_cuecat: read_cuecat.o \
diff --git a/misc/cuecat/patches/patch-ab b/misc/cuecat/patches/patch-ab
new file mode 100644
index 00000000000..7fd7bc6c13b
--- /dev/null
+++ b/misc/cuecat/patches/patch-ab
@@ -0,0 +1,161 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+
+--- read_cuecat.c.orig Wed Sep 20 22:13:46 2000
++++ read_cuecat.c
+@@ -4,8 +4,8 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
+-#include <linux/kd.h>
+-#include <linux/serial.h>
++#include <sys/time.h>
++#include <dev/wscons/wsconsio.h>
+ #include <sys/ioctl.h>
+ #include "cuecat_lib.h"
+ #include "cuecat_at2xt.h"
+@@ -24,8 +24,6 @@
+ int previous_kbd_mode;
+ struct termios old_term_settings;
+ struct termios new_term_settings;
+-struct serial_struct old_serinfo;
+-struct serial_struct new_serinfo;
+ char serial_dev_filename[FILENAME_MAX]=DEFAULT_SERIAL_DEV_FILE;
+ char serial;
+ char help;
+@@ -55,6 +53,7 @@
+ char barcode_type[CUECAT_BARCODE_TYPE_LEN+1];
+ char barcode[256];
+ int user_abort=0;
++ int ioctl_arg;
+
+ /* Parse the command line parameters */
+ if((invalid_parameter=parse_cmdline(argc,argv)))
+@@ -83,7 +82,7 @@
+ }
+
+ /* Get a console or serial port descriptor */
+- fd=getfd();
++ fd=0;
+
+ /* Did the user want to use a serial pod ? */
+ if(!serial)
+@@ -92,9 +91,9 @@
+ printf("Press ESC to end the program ...\n\n");
+
+ /* Get the current state of the keyboard */
+- if (ioctl(fd, KDGKBMODE, &previous_kbd_mode))
++ if (ioctl(fd, WSKBDIO_GETMODE, &previous_kbd_mode))
+ {
+- perror("KDGKBMODE");
++ perror("WSKBDIO_GETMODE");
+ close(fd);
+ exit(1);
+ }
+@@ -103,11 +102,9 @@
+ printf("The keyboard was in ");
+ switch(previous_kbd_mode)
+ {
+- case K_RAW: printf("raw") ;break;
+- case K_XLATE: printf("xlate") ;break;
+- case K_MEDIUMRAW: printf("mediumraw");break;
+- case K_UNICODE: printf("unicode") ;break;
+- default: printf("unknown") ;break;
++ case WSKBD_TRANSLATED: printf("translated"); break;
++ case WSKBD_RAW: printf("raw"); break;
++ default: printf("unknown(%d)",previous_kbd_mode); break;
+ }
+ printf(" state.\n\n");
+
+@@ -139,9 +136,10 @@
+ close(fd);
+ exit(1);
+ }
+- if (ioctl(fd,KDSKBMODE,K_RAW))
++ ioctl_arg = WSKBD_RAW;
++ if (ioctl(fd,WSKBDIO_SETMODE,&ioctl_arg))
+ {
+- perror("KDSKBMODE");
++ perror("WSKBDIO_SETMODE");
+ close(fd);
+ exit(1);
+ }
+@@ -151,13 +149,6 @@
+ /* Give a quick word of advise */
+ printf("Press CTRL-C to end the program ...\n\n");
+
+- /* Get the current state of the serial port */
+- if(ioctl(fd,TIOCGSERIAL,&old_serinfo))
+- {
+- perror("TIOCGSERIAL");
+- close(fd);
+- exit(1);
+- }
+ if(tcgetattr(fd,&old_term_settings)==-1)
+ {
+ perror("tcgetattr");
+@@ -165,28 +156,12 @@
+ exit(1);
+ }
+
+- new_serinfo=old_serinfo;
+ new_term_settings=old_term_settings;
+
+ /* Setup the signal handler to trap any signal that might kill us before
+ we can restore the serial port as it was before */
+ setup_signal_handlers();
+
+- /* set SPD_CUST and divisor */
+- new_serinfo.flags&=~ASYNC_SPD_MASK;
+- new_serinfo.flags|=ASYNC_SPD_CUST;
+-
+- /* we measured the cuecat's baudrate to be about 8000 the closest we can
+- get to this with a basebaud of 115200 is to use a divisor of 14 */
+- new_serinfo.custom_divisor=14;
+-
+- if (ioctl(fd,TIOCSSERIAL,&new_serinfo))
+- {
+- perror("TIOCSSERIAL");
+- close(fd);
+- exit(1);
+- }
+-
+ cfmakeraw(&new_term_settings);
+ cfsetospeed(&new_term_settings, B38400);
+
+@@ -268,9 +243,9 @@
+ /* Restore the keyboard and console as they where when we started */
+ void restore_console()
+ {
+- if(ioctl(fd,KDSKBMODE,previous_kbd_mode))
++ if(ioctl(fd,WSKBDIO_SETMODE,&previous_kbd_mode))
+ {
+- perror("KDSKBMODE");
++ perror("WSKBDIO_SETMODE");
+ close(fd);
+ exit(1);
+ }
+@@ -288,12 +263,6 @@
+ /* Restore the keyboard and console as they where when we started */
+ void restore_serial_port()
+ {
+- if(ioctl(fd,TIOCSSERIAL,&old_serinfo)==-1)
+- {
+- perror("TIOCSSERIAL");
+- close(fd);
+- exit(1);
+- }
+ close(fd);
+ }
+
+@@ -361,8 +330,11 @@
+ char arg;
+
+ arg=0;
++ return 1;
++#if 0
+ return(ioctl(fd,KDGKBTYPE,&arg)==0
+ && ((arg==KB_101) || (arg==KB_84)));
++#endif
+ }
+
+
diff --git a/misc/cuecat/pkg/COMMENT b/misc/cuecat/pkg/COMMENT
new file mode 100644
index 00000000000..4f5cd03b4ef
--- /dev/null
+++ b/misc/cuecat/pkg/COMMENT
@@ -0,0 +1 @@
+read and parse barcodes from your CueCat barcode reader
diff --git a/misc/cuecat/pkg/DESCR b/misc/cuecat/pkg/DESCR
new file mode 100644
index 00000000000..c865fab7d39
--- /dev/null
+++ b/misc/cuecat/pkg/DESCR
@@ -0,0 +1,5 @@
+This package contains a hacked version of the Linux program for
+the CueCat (a barcode reader distributed for free in the USA by
+e.g. Radio Shack). This package only works on a console with
+the wscons keyboard driver, and only supports the original CueCat
+(neither the serial nor the USB hack).
diff --git a/misc/cuecat/pkg/MESSAGE b/misc/cuecat/pkg/MESSAGE
new file mode 100644
index 00000000000..ebf09e2838e
--- /dev/null
+++ b/misc/cuecat/pkg/MESSAGE
@@ -0,0 +1,10 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+
+Please note that you can only use the executable "read_cuecat"
+on the console.
+
+(The startup error "WSKBDIO_GETMODE: Inappropriate ioctl for device"
+will remind you if you forget.)
+
+===========================================================================
diff --git a/misc/cuecat/pkg/PLIST b/misc/cuecat/pkg/PLIST
new file mode 100644
index 00000000000..7a55da6d95d
--- /dev/null
+++ b/misc/cuecat/pkg/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/02/13 13:55:42 wiz Exp $
+bin/read_cuecat
+share/doc/cuecat/README
+@dirrm share/doc/cuecat