aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/rxtx
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/rxtx')
-rw-r--r--recipes-extended/rxtx/files/kfreebsd_libpthread.patch17
-rw-r--r--recipes-extended/rxtx/files/kfreebsd_port.patch309
-rw-r--r--recipes-extended/rxtx/files/multiple_property_dirs.patch168
-rw-r--r--recipes-extended/rxtx/files/original_debian_changes.patch117
-rw-r--r--recipes-extended/rxtx/files/port_to_hurd.patch16
-rw-r--r--recipes-extended/rxtx/files/sys_io_h_check.patch35
-rw-r--r--recipes-extended/rxtx/files/ttyACM_port.patch28
-rw-r--r--recipes-extended/rxtx/files/uninstall_target.patch18
-rw-r--r--recipes-extended/rxtx/files/zsystem_init_exception.patch19
-rw-r--r--recipes-extended/rxtx/rxtx_2.2.0.bb48
10 files changed, 775 insertions, 0 deletions
diff --git a/recipes-extended/rxtx/files/kfreebsd_libpthread.patch b/recipes-extended/rxtx/files/kfreebsd_libpthread.patch
new file mode 100644
index 0000000..19040d2
--- /dev/null
+++ b/recipes-extended/rxtx/files/kfreebsd_libpthread.patch
@@ -0,0 +1,17 @@
+Description: libc_r is not available, use libpthread
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089
+Author: Scott Howard <showard@debian.org>
+
+Index: rxtx/configure.in
+===================================================================
+--- rxtx.orig/configure.in 2011-02-06 11:13:16.151426139 -0500
++++ rxtx/configure.in 2011-02-06 11:13:58.820020857 -0500
+@@ -575,7 +575,7 @@
+ ;;
+
+ *BSD)
+- LDFLAGS=$LDFLAGS" -lc_r"
++ LDFLAGS=$LDFLAGS" -lpthread"
+ JHOME=$JPATH/"lib"
+ CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
+ TARGETLIB="\$(target_triplet)/librxtxSerial.la \
diff --git a/recipes-extended/rxtx/files/kfreebsd_port.patch b/recipes-extended/rxtx/files/kfreebsd_port.patch
new file mode 100644
index 0000000..b5fa172
--- /dev/null
+++ b/recipes-extended/rxtx/files/kfreebsd_port.patch
@@ -0,0 +1,309 @@
+Description: Defines FreeBSD for kFreeBSD systems, also makes sure kfreeBSD is set to use FHS
+#grep -r -H "__FreeBSD" . -m 1 --exclude=*.patch --exclude-dir=.git | cut -d: -f1 | xargs sed -i s/__FreeBSD__/__FreeBSD_kernel__/
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089
+Author: Scott Howard <showard@debian.org>
+
+Index: rxtx/src/RS485Imp.c
+===================================================================
+--- rxtx.orig/src/RS485Imp.c 2011-02-23 22:53:43.393378664 -0500
++++ rxtx/src/RS485Imp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -120,11 +120,11 @@
+ threads, because it slows things down. Go figure. */
+
+ /* POSIX signal handling functions */
+-#if !defined(__FreeBSD___)
++#if !defined(__FreeBSD_kernel___)
+ struct sigaction handler;
+ sigaction( SIGIO, NULL, &handler );
+ if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
+-#endif /* !__FreeBSD__ */
++#endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
+ if (uname (&name) == -1)
+@@ -178,7 +178,7 @@
+ ttyset.c_cc[ VMIN ] = 0;
+ ttyset.c_cc[ VTIME ] = 0;
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
+@@ -238,7 +238,7 @@
+ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_cflag in darwin is unsigned long */
+ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_cflag in darwin is unsigned long */
+ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_cflag in darwin is unsigned long */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
+@@ -1290,7 +1290,7 @@
+ return(JNI_FALSE);
+ }
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
+ !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
+ !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
+Index: rxtx/src/RawImp.c
+===================================================================
+--- rxtx.orig/src/RawImp.c 2011-02-23 22:53:43.413378002 -0500
++++ rxtx/src/RawImp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -265,11 +265,11 @@
+ threads, because it slows things down. Go figure. */
+
+ /* POSIX signal handling functions */
+-#if !defined(__FreeBSD___)
++#if !defined(__FreeBSD_kernel___)
+ struct sigaction handler;
+ sigaction( SIGIO, NULL, &handler );
+ if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
+-#endif /* !__FreeBSD__ */
++#endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
+ if (uname (&name) == -1)
+@@ -307,7 +307,7 @@
+ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_flag darwin unsigned long */
+ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_flag darwin unsigned long */
+ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_flag darwin unsigned long */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
+@@ -1289,7 +1289,7 @@
+ return(JNI_FALSE);
+ }
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
+ !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
+ !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
+Index: rxtx/src/SerialImp.h
+===================================================================
+--- rxtx.orig/src/SerialImp.h 2011-02-23 22:53:43.423377671 -0500
++++ rxtx/src/SerialImp.h 2011-02-23 22:55:45.573475048 -0500
+@@ -97,7 +97,7 @@
+
+ /* glue for unsupported linux speeds see also win32termios.h */
+
+-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */
++#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */
+ /* this is now handled in SerialImp.c
+ #define B14400 1010001
+ #define B28800 1010002
+@@ -147,7 +147,7 @@
+ };
+
+ /* Ports known on the OS */
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ /*
+ This is a small hack to get mark and space parity working on older systems
+ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533
+Index: rxtx/src/SerialImp.c
+===================================================================
+--- rxtx.orig/src/SerialImp.c 2011-02-23 22:53:43.443377009 -0500
++++ rxtx/src/SerialImp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -423,7 +423,7 @@
+ ttyset.c_cc[ VMIN ] = 0;
+ ttyset.c_cc[ VTIME ] = 0;
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
+@@ -844,13 +844,13 @@
+ return(1);
+ }
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, cspeed ) < 0 )
+ {
+ report( "set_port_params: Cannot Set Speed\n" );
+ return( 1 );
+ }
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD_kernel__ */
+ if( !cspeed )
+ {
+ /* hang up the modem aka drop DTR */
+@@ -4705,7 +4705,7 @@
+ stat(teststring,&mystat);
+ #endif /* __sun__ */
+ /* XXX the following hoses freebsd when it tries to open the port later on */
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ if(S_ISCHR(mystat.st_mode)){
+ fd=OPEN(teststring,O_RDONLY|O_NONBLOCK);
+ if (fd>0){
+Index: rxtx/src/ParallelImp.c
+===================================================================
+--- rxtx.orig/src/ParallelImp.c 2011-02-23 22:53:43.463376347 -0500
++++ rxtx/src/ParallelImp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -111,7 +111,7 @@
+ #if defined(__linux__)
+ # include <linux/lp.h>
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ /* # include <machine/lpt.h> ? is this changed or wrong */
+ # include <dev/ppbus/lpt.h>
+ #endif
+@@ -265,7 +265,7 @@
+ #if defined(__linux__)
+ return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE );
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ return( status & EBUSY ? JNI_TRUE : JNI_FALSE );
+ #endif
+ return(JNI_FALSE);
+@@ -341,7 +341,7 @@
+ ioctl(fd, LPGETSTATUS, &status);
+ return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE );
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ printf("ParallelImp.c LPGETSTATUS not defined\n");
+ /*
+ return( status & EBUSY ? JNI_TRUE : JNI_FALSE );
+Index: rxtx/src/I2CImp.c
+===================================================================
+--- rxtx.orig/src/I2CImp.c 2011-02-23 22:53:43.483375685 -0500
++++ rxtx/src/I2CImp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -120,11 +120,11 @@
+ threads, because it slows things down. Go figure. */
+
+ /* POSIX signal handling functions */
+-#if !defined(__FreeBSD___)
++#if !defined(__FreeBSD_kernel___)
+ struct sigaction handler;
+ sigaction( SIGIO, NULL, &handler );
+ if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
+-#endif /* !__FreeBSD__ */
++#endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
+ if (uname (&name) == -1)
+@@ -178,7 +178,7 @@
+ ttyset.c_cc[ VMIN ] = 0;
+ ttyset.c_cc[ VTIME ] = 0;
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
+@@ -238,7 +238,7 @@
+ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima darwin defime c_cflag as unsigned long */
+ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima darwin defime c_cflag as unsigned long */
+ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima darwin defime c_cflag as unsigned long */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
+@@ -1220,7 +1220,7 @@
+ return(JNI_FALSE);
+ }
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
+ !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
+ !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
+Index: rxtx/src/SerialImp.cpp
+===================================================================
+--- rxtx.orig/src/SerialImp.cpp 2011-02-23 22:53:43.503375023 -0500
++++ rxtx/src/SerialImp.cpp 2011-02-23 22:53:52.663072550 -0500
+@@ -135,11 +135,11 @@
+ threads, because it slows things down. Go figure. */
+
+ /* POSIX signal handling functions */
+-#if !defined(__FreeBSD___)
++#if !defined(__FreeBSD_kernel___)
+ struct sigaction handler;
+ sigaction( SIGIO, NULL, &handler );
+ if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
+-#endif /* !__FreeBSD__ */
++#endif /* !__FreeBSD_kernel__ */
+ #ifdef DEBUG
+ /* Lets let people who upgraded kernels know they may have problems */
+ if (uname (&name) == -1)
+Index: rxtx/CNI/SerialImp.h
+===================================================================
+--- rxtx.orig/CNI/SerialImp.h 2011-02-23 22:53:43.523374359 -0500
++++ rxtx/CNI/SerialImp.h 2011-02-23 22:53:52.663072550 -0500
+@@ -97,7 +97,7 @@
+
+ /* glue for unsupported linux speeds see also win32termios.h */
+
+-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */
++#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */
+ /* this is now handled in SerialImp.c
+ #define B14400 1010001
+ #define B28800 1010002
+@@ -165,7 +165,7 @@
+ # define LOCKFILEPREFIX "LK."
+ # define UUCP
+ #endif /* __sgi__ || sgi */
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ # define DEVICEDIR "/dev/"
+ # define LOCKDIR "/var/spool/uucp"
+ # define LOCKFILEPREFIX "LK."
+@@ -176,7 +176,7 @@
+ # define LOCKDIR "/var/spool/uucp"
+ # define LOCKFILEPREFIX "LK."
+ # define UUCP
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD_kernel__ */
+ #if defined(__NetBSD__)
+ # define DEVICEDIR "/dev/"
+ # define LOCKDIR "/usr/spool/uucp"
+Index: rxtx/CNI/SerialImp.c
+===================================================================
+--- rxtx.orig/CNI/SerialImp.c 2011-02-23 22:53:43.543373697 -0500
++++ rxtx/CNI/SerialImp.c 2011-02-23 22:53:52.663072550 -0500
+@@ -382,7 +382,7 @@
+ ttyset.c_cc[ VMIN ] = 0;
+ ttyset.c_cc[ VTIME ] = 0;
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
+ #else
+ if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
+@@ -686,13 +686,13 @@
+ return(1);
+ }
+
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ if( cfsetspeed( &ttyset, cspeed ) < 0 )
+ {
+ report( "set_port_params: Cannot Set Speed\n" );
+ return( 1 );
+ }
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD_kernel__ */
+ if( !cspeed )
+ {
+ /* hang up the modem aka drop DTR */
+@@ -4257,7 +4257,7 @@
+ stat(teststring,&mystat);
+ #endif /* __sun__ */
+ /* XXX the following hoses freebsd when it tries to open the port later on */
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ if(S_ISCHR(mystat.st_mode)){
+ fd=::OPEN(teststring,O_RDONLY|O_NONBLOCK);
+ if (fd>0){
diff --git a/recipes-extended/rxtx/files/multiple_property_dirs.patch b/recipes-extended/rxtx/files/multiple_property_dirs.patch
new file mode 100644
index 0000000..6664966
--- /dev/null
+++ b/recipes-extended/rxtx/files/multiple_property_dirs.patch
@@ -0,0 +1,168 @@
+Description: Handles the case when "java.ext.dirs" system property contains
+ more than one directory.
+Author: Philip Ashmore <contact@philipashmore.com>
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069
+Index: rxtx/src/gnu/io/RXTXCommDriver.java
+===================================================================
+--- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.046717064 -0400
++++ rxtx/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.186717068 -0400
+@@ -356,7 +356,7 @@
+ First try to register ports specified in the properties
+ file. If that doesn't exist, then scan for ports.
+ */
+- for (int PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PARALLEL;PortType++) {
++ for (int PortType=CommPortIdentifier.PORT_SERIAL; PortType<=CommPortIdentifier.PORT_PARALLEL; PortType++) {
+ if (!registerSpecifiedPorts(PortType)) {
+ if (!registerKnownPorts(PortType)) {
+ registerScannedPorts(PortType);
+@@ -375,10 +375,18 @@
+ while (tok.hasMoreElements())
+ {
+ String PortName = tok.nextToken();
+-
+- if (testRead(PortName, PortType))
++ if(debug)
++ System.out.println("Trying " + PortName + ".");
++ if (testRead(PortName, PortType)) {
+ CommPortIdentifier.addPortName(PortName,
+ PortType, this);
++ if(debug)
++ System.out.println("Success: Read from " + PortName + ".");
++ }else{
++ if(debug)
++ System.out.println("Fail: Cannot read from " + PortName
++ + ".");
++ }
+ }
+ }
+
+@@ -402,26 +410,39 @@
+ private boolean registerSpecifiedPorts(int PortType)
+ {
+ String val = null;
+- Properties origp = System.getProperties();//save system properties
+-
+- try
+- {
++ Properties origp = System.getProperties(); // save system properties
+
+- String ext_dir=System.getProperty("java.ext.dirs")+System.getProperty("file.separator");
+- FileInputStream rxtx_prop=new FileInputStream(ext_dir+"gnu.io.rxtx.properties");
+- Properties p=new Properties();
+- p.load(rxtx_prop);
+- System.setProperties(p);
+- for (Iterator it = p.keySet().iterator(); it.hasNext();) {
+- String key = (String) it.next();
+- System.setProperty(key, p.getProperty(key));
+- }
+- }catch(Exception e){
+- if (debug){
+- System.out.println("The file: gnu.io.rxtx.properties doesn't exists.");
+- System.out.println(e.toString());
+- }//end if
++ String [] ext_dirs = System.getProperty("java.ext.dirs").split(":");
++ String fs = System.getProperty("file.separator");
++ for (int n = 0; n < ext_dirs.length; ++n) {
++ String ext_file = "?";
++ try{
++ ext_file = ext_dirs[n] + fs + "gnu.io.rxtx.properties";
++ FileInputStream rxtx_prop = new FileInputStream(ext_file);
++ Properties p=new Properties();
++ p.load(rxtx_prop);
++ System.setProperties(p);
++ for (Iterator it = p.keySet().iterator(); it.hasNext();) {
++ String key = (String) it.next();
++ String value = p.getProperty(key);
++ if(debug) {
++ System.out.println(key + " -> " + value);
++ }
++ System.setProperty(key, value);
++ }
++ }catch(Exception e){
++ if (debug){
++ System.out.println("The file \"" + ext_file
++ + "\" doesn't exist.");
++ System.out.println(e.toString());
++ }//end if
++ continue;
+ }//end catch
++ if (debug){
++ System.out.println("Read properties from \"" + ext_file
++ + "\".");
++ }//end if
++ }//end for
+
+ if (debug)
+ System.out.println("checking for system-known ports of type "+PortType);
+Index: rxtx/src/SerialImp.c
+===================================================================
+--- rxtx.orig/src/SerialImp.c 2011-10-28 13:02:43.078717065 -0400
++++ rxtx/src/SerialImp.c 2011-10-28 13:02:43.190717067 -0400
+@@ -4359,7 +4359,11 @@
+
+ if( fd < 0 )
+ {
+- report_verbose( "testRead() open failed\n" );
++ report_verbose( "testRead() open \"" );
++ report_verbose( name );
++ report_verbose( "\" failed: " );
++ report_verbose( strerror(errno) );
++ report_verbose( "\n" );
+ ret = JNI_FALSE;
+ goto END;
+ }
+@@ -5095,7 +5099,7 @@
+ exceptions: none
+ comments:
+ ----------------------------------------------------------*/
+-void report_warning(char *msg)
++void report_warning(const char *msg)
+ {
+ #ifndef DEBUG_MW
+ fprintf(stderr, msg);
+@@ -5113,7 +5117,7 @@
+ exceptions: none
+ comments:
+ ----------------------------------------------------------*/
+-void report_verbose(char *msg)
++void report_verbose(const char *msg)
+ {
+ #ifdef DEBUG_VERBOSE
+ #ifdef DEBUG_MW
+@@ -5132,7 +5136,7 @@
+ exceptions: none
+ comments:
+ ----------------------------------------------------------*/
+-void report_error(char *msg)
++void report_error(const char *msg)
+ {
+ #ifndef DEBUG_MW
+ fprintf(stderr, msg);
+@@ -5150,7 +5154,7 @@
+ exceptions: none
+ comments:
+ ----------------------------------------------------------*/
+-void report(char *msg)
++void report(const char *msg)
+ {
+ #ifdef DEBUG
+ # ifndef DEBUG_MW
+Index: rxtx/src/SerialImp.h
+===================================================================
+--- rxtx.orig/src/SerialImp.h 2011-10-28 13:02:43.162717067 -0400
++++ rxtx/src/SerialImp.h 2011-10-28 13:02:43.194717067 -0400
+@@ -467,10 +467,10 @@
+ jboolean is_interrupted( struct event_info_struct * );
+ int send_event(struct event_info_struct *, jint, int );
+ void dump_termios(char *,struct termios *);
+-void report_verbose(char *);
+-void report_error(char *);
+-void report_warning(char *);
+-void report(char *);
++void report_verbose(const char *);
++void report_error(const char *);
++void report_warning(const char *);
++void report(const char *);
+ void throw_java_exception( JNIEnv *, char *, char *, char * );
+ int lock_device( const char * );
+ void unlock_device( const char * );
diff --git a/recipes-extended/rxtx/files/original_debian_changes.patch b/recipes-extended/rxtx/files/original_debian_changes.patch
new file mode 100644
index 0000000..32e9913
--- /dev/null
+++ b/recipes-extended/rxtx/files/original_debian_changes.patch
@@ -0,0 +1,117 @@
+Description: Removes makefile install of RXTXcomm.jar, silences an unnecessary compiling error
+Origin: Mario Joussen <joussen@debian.org>, edited by Scott Howard <showard314@gmail.com> <2010-06-03>
+
+Index: rxtx/src/RS485Imp.c
+===================================================================
+--- rxtx.orig/src/RS485Imp.c 2011-10-31 02:58:18.280985274 -0400
++++ rxtx/src/RS485Imp.c 2011-10-31 02:58:21.300985346 -0400
+@@ -127,6 +127,7 @@
+ #endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
++ /*
+ if (uname (&name) == -1)
+ {
+ fprintf(stderr,"RXTX WARNING: cannot get system name\n");
+@@ -137,6 +138,7 @@
+ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
+ getchar();
+ }
++ */
+ #endif /* __linux__ */
+ #endif /* WIN32 */
+ }
+Index: rxtx/src/RawImp.c
+===================================================================
+--- rxtx.orig/src/RawImp.c 2011-10-31 02:58:18.280985274 -0400
++++ rxtx/src/RawImp.c 2011-10-31 02:58:21.300985346 -0400
+@@ -272,6 +272,7 @@
+ #endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
++ /*
+ if (uname (&name) == -1)
+ {
+ fprintf(stderr,"RXTX WARNING: cannot get system name\n");
+@@ -282,6 +283,7 @@
+ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
+ getchar();
+ }
++ */
+ #endif /* __linux__ */
+ #endif /* WIN32 */
+ }
+Index: rxtx/src/SerialImp.c
+===================================================================
+--- rxtx.orig/src/SerialImp.c 2011-10-31 02:58:18.284985274 -0400
++++ rxtx/src/SerialImp.c 2011-10-31 02:58:21.304985346 -0400
+@@ -320,6 +320,7 @@
+ #endif /* DEBUG_TIMING */
+ #if defined(DEBUG) && defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
++ /*
+ if (uname (&name) == -1)
+ {
+ report( "RXTX WARNING: cannot get system name\n" );
+@@ -333,6 +334,7 @@
+ report( message );
+ getchar();
+ }
++ */
+ LEAVE( "RXTXPort:Initialize" );
+ #endif /* DEBUG && __linux__ */
+ }
+Index: rxtx/src/I2CImp.c
+===================================================================
+--- rxtx.orig/src/I2CImp.c 2011-10-31 02:58:18.284985274 -0400
++++ rxtx/src/I2CImp.c 2011-10-31 02:58:21.304985346 -0400
+@@ -127,6 +127,7 @@
+ #endif /* !__FreeBSD_kernel__ */
+ #if defined(__linux__)
+ /* Lets let people who upgraded kernels know they may have problems */
++ /*
+ if (uname (&name) == -1)
+ {
+ fprintf(stderr,"RXTX WARNING: cannot get system name\n");
+@@ -137,6 +138,7 @@
+ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
+ getchar();
+ }
++ */
+ #endif /* __linux__ */
+ #endif /* WIN32 */
+ }
+Index: rxtx/src/SerialImp.cpp
+===================================================================
+--- rxtx.orig/src/SerialImp.cpp 2011-10-31 02:58:18.284985274 -0400
++++ rxtx/src/SerialImp.cpp 2011-10-31 02:58:21.304985346 -0400
+@@ -142,6 +142,7 @@
+ #endif /* !__FreeBSD_kernel__ */
+ #ifdef DEBUG
+ /* Lets let people who upgraded kernels know they may have problems */
++ /*
+ if (uname (&name) == -1)
+ {
+ report("RXTX WARNING: cannot get system name\n");
+@@ -153,6 +154,7 @@
+ name.release);
+ getchar();
+ }
++ */
+ #endif /* DEBUG */
+ #endif /* __BEOS__ */
+ #endif /* WIN32 */
+Index: rxtx/Makefile.am
+===================================================================
+--- rxtx.orig/Makefile.am 2011-10-31 02:55:54.600981860 -0400
++++ rxtx/Makefile.am 2011-10-31 02:58:21.304985346 -0400
+@@ -137,7 +137,8 @@
+
+ # create the javadoc files.
+ docs: $(CLASSES)
+- $(JAVADOC) $(javafiles)
++ mkdir api
++ cd api && $(JAVADOC) $(javafiles)
+
+ ################ WIN32 CrossCompiling from here down #######################
+
diff --git a/recipes-extended/rxtx/files/port_to_hurd.patch b/recipes-extended/rxtx/files/port_to_hurd.patch
new file mode 100644
index 0000000..80ae705
--- /dev/null
+++ b/recipes-extended/rxtx/files/port_to_hurd.patch
@@ -0,0 +1,16 @@
+Description: Defines __GNU__ to use the FHS
+Author: Scott Howard <showard@debian.org>
+
+Index: rxtx/src/SerialImp.h
+===================================================================
+--- rxtx.orig/src/SerialImp.h 2011-02-23 23:26:14.955993397 -0500
++++ rxtx/src/SerialImp.h 2011-02-23 23:26:52.684023837 -0500
+@@ -147,7 +147,7 @@
+ };
+
+ /* Ports known on the OS */
+-#if defined(__linux__) || defined(__FreeBSD_kernel__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+ /*
+ This is a small hack to get mark and space parity working on older systems
+ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533
diff --git a/recipes-extended/rxtx/files/sys_io_h_check.patch b/recipes-extended/rxtx/files/sys_io_h_check.patch
new file mode 100644
index 0000000..5072f1d
--- /dev/null
+++ b/recipes-extended/rxtx/files/sys_io_h_check.patch
@@ -0,0 +1,35 @@
+Description: sys/io.h does not exist on all systems
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609152
+Author: Scott Howard <showard@debian.org>
+
+Index: rxtx/configure.in
+===================================================================
+--- rxtx.orig/configure.in 2011-02-23 23:01:09.596613286 -0500
++++ rxtx/configure.in 2011-02-23 23:02:41.269525630 -0500
+@@ -71,6 +71,7 @@
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_CHECK_HEADERS(sys/signal.h)
+ AC_CHECK_HEADERS(signal.h)
++AC_CHECK_HEADERS(sys/io.h)
+ AC_CHECK_HEADERS(termios.h)
+ AC_CHECK_HEADERS(grp.h)
+ AC_CHECK_HEADERS(pwd.h)
+Index: rxtx/src/RawImp.c
+===================================================================
+--- rxtx.orig/src/RawImp.c 2011-02-23 23:04:29.641932242 -0500
++++ rxtx/src/RawImp.c 2011-02-23 23:05:40.487353587 -0500
+@@ -99,11 +99,9 @@
+ # include <linux/serial.h>
+ # include <linux/version.h>
+ #endif
+-#ifndef __APPLE__ /* dima */
+-#ifndef PPC
+-#include <sys/io.h>
+-#endif /* PPC */
+-#endif /* dima */
++#ifdef HAVE_SYS_IO_H
++# include <sys/io.h>
++#endif
+
+ extern int errno;
+ #include "I2CImp.h"
diff --git a/recipes-extended/rxtx/files/ttyACM_port.patch b/recipes-extended/rxtx/files/ttyACM_port.patch
new file mode 100644
index 0000000..da133c9
--- /dev/null
+++ b/recipes-extended/rxtx/files/ttyACM_port.patch
@@ -0,0 +1,28 @@
+Description: Allows for the enumeration of many additional ports, including ttyACM for Arduino Unos
+Author: Scott Howard <showard314@gmail.com>
+
+Index: rxtx/src/gnu/io/RXTXCommDriver.java
+===================================================================
+--- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:14:47.236148507 -0400
++++ rxtx/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:18:56.976108303 -0400
+@@ -574,20 +574,7 @@
+ if(osName.equals("Linux"))
+ {
+ String[] Temp = {
+- "ttyS", // linux Serial Ports
+ "ttySA", // for the IPAQs
+- "ttyUSB", // for USB frobs
+- "rfcomm", // bluetooth serial device
+- "ttyircomm", // linux IrCommdevices (IrDA serial emu)
+- };
+- CandidatePortPrefixes=Temp;
+- }
+- else if(osName.equals("Linux-all-ports"))
+- {
+- /* if you want to enumerate all ports ~5000
+- possible, then replace the above with this
+- */
+- String[] Temp = {
+ "comx", // linux COMMX synchronous serial card
+ "holter", // custom card for heart monitoring
+ "modem", // linux symbolic link to modem.
diff --git a/recipes-extended/rxtx/files/uninstall_target.patch b/recipes-extended/rxtx/files/uninstall_target.patch
new file mode 100644
index 0000000..a0e8c55
--- /dev/null
+++ b/recipes-extended/rxtx/files/uninstall_target.patch
@@ -0,0 +1,18 @@
+Description: adds uninstall target to Makefile
+Author: Scott Howard <showard@debian.org>
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069
+Index: rxtx/Makefile.am
+===================================================================
+--- rxtx.orig/Makefile.am 2011-10-31 02:43:21.532963961 -0400
++++ rxtx/Makefile.am 2011-10-31 02:46:03.348967808 -0400
+@@ -129,6 +129,10 @@
+ done` $(RXTX_PATH)
+ $(INSTALL_PROGRAM) $(JARTARGET) $(JHOME)/
+
++uninstall:
++ cd $(RXTX_PATH) && $(RM) librxtx*
++ $(RM) $(JHOME)/$(JARTARGET)
++
+ clean-generic:
+ rm -rf $(DEST) $(TOP)/$(CLASSTOP)
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
diff --git a/recipes-extended/rxtx/files/zsystem_init_exception.patch b/recipes-extended/rxtx/files/zsystem_init_exception.patch
new file mode 100644
index 0000000..6421574
--- /dev/null
+++ b/recipes-extended/rxtx/files/zsystem_init_exception.patch
@@ -0,0 +1,19 @@
+Description: print exception if initialization fails
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053
+Author: Jan Niehusmann <jan@gondor.com>
+
+Index: rxtx/src/gnu/io/RXTXPort.java
+===================================================================
+--- rxtx.orig/src/gnu/io/RXTXPort.java 2011-02-03 20:48:21.824924891 -0500
++++ rxtx/src/gnu/io/RXTXPort.java 2011-02-03 20:50:04.058464228 -0500
+@@ -86,7 +86,9 @@
+ {
+ try {
+ z = new Zystem();
+- } catch ( Exception e ) {}
++ } catch ( Exception e ) {
++ throw new Error(e.toString());
++ }
+
+ if(debug )
+ z.reportln( "RXTXPort {}");
diff --git a/recipes-extended/rxtx/rxtx_2.2.0.bb b/recipes-extended/rxtx/rxtx_2.2.0.bb
new file mode 100644
index 0000000..28603e3
--- /dev/null
+++ b/recipes-extended/rxtx/rxtx_2.2.0.bb
@@ -0,0 +1,48 @@
+DESCRIPTION = "Full Java CommAPI implementation"
+DEPENDS = "fastjar-native"
+LICENSE = "RXTXv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32303a23463f90b12a7d1dafb8deabf4"
+PR = "r2"
+
+SRC_URI = "http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2.zip \
+ file://zsystem_init_exception.patch \
+ file://kfreebsd_port.patch \
+ file://ttyACM_port.patch \
+ file://original_debian_changes.patch \
+ file://kfreebsd_libpthread.patch \
+ file://sys_io_h_check.patch \
+ file://port_to_hurd.patch \
+ file://multiple_property_dirs.patch \
+ file://uninstall_target.patch"
+
+SRC_URI[md5sum] = "7eedb18e3f33a427e2b0e9be8ce3f94c"
+SRC_URI[sha256sum] = "3c30373e760f444def3650c76c5a00ae12fb1d860ec008750d084f4880495b03"
+
+S = "${WORKDIR}/rxtx-2.2pre2"
+
+INSANE_SKIP_${PN} += "dev-so"
+
+inherit autotools java-library
+
+JARFILENAME = "RXTXcomm.jar"
+EXTRA_OEMAKE += "RXTX_PATH=${D}${libdir_jni} \
+ JHOME=${D}${datadir_java}/ext"
+
+do_configure_prepend() {
+ # Ugly but don't complain to me, but upstream ;-)
+ sed -e 's,bin/javah,bin/gjavah,g' \
+ -e 's,bin/jar,bin/fastjar,g' \
+ -e 's,\$(TOP)/libtool,\$(TOP)/\${host_alias}-libtool,g' -i ${S}/configure.in
+ rm -f ${S}/acinclude.m4 \
+ ${S}/aclocal.m4 \
+ ${S}/ltconfig \
+ ${S}/ltmain.sh
+}
+
+do_install_prepend() {
+ install -d ${D}${libdir_jni}
+ install -d ${D}${datadir_java}/ext
+}
+
+FILES_${PN} += "${libdir_jni}"
+FILES_${PN}-dbg += "${libdir_jni}/.debug"