aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--comms/Makefile1
-rw-r--r--comms/librs232/Makefile28
-rw-r--r--comms/librs232/distinfo2
-rw-r--r--comms/librs232/files/Makefile18
-rw-r--r--comms/librs232/files/patch-rs232.c71
-rw-r--r--comms/librs232/files/patch-rs232.h12
-rw-r--r--comms/librs232/pkg-descr4
-rw-r--r--comms/librs232/pkg-plist5
8 files changed, 141 insertions, 0 deletions
diff --git a/comms/Makefile b/comms/Makefile
index 235e74824c1c..ed63ad352e84 100644
--- a/comms/Makefile
+++ b/comms/Makefile
@@ -80,6 +80,7 @@
SUBDIR += libimobiledevice
SUBDIR += libirman
SUBDIR += libmodbus
+ SUBDIR += librs232
SUBDIR += libticables2
SUBDIR += libticalcs2
SUBDIR += libusbmuxd
diff --git a/comms/librs232/Makefile b/comms/librs232/Makefile
new file mode 100644
index 000000000000..e2a2d8c9e010
--- /dev/null
+++ b/comms/librs232/Makefile
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+PORTNAME= librs232
+PORTVERSION= 20140105
+CATEGORIES= comms
+DISTNAME= RS-232
+MASTER_SITES= http://www.teuniz.net/RS-232/
+
+MAINTAINER= kevlo@FreeBSD.org
+COMMENT= Simple serial library
+
+LICENSE= GPLv2
+
+WRKSRC= ${WRKDIR}
+
+OPTIONS_DEFINE= DOCS
+
+USES= uidfix
+USE_LDCONFIG= yes
+
+post-extract:
+ @${CP} ${FILESDIR}/${MAKEFILE} ${WRKSRC}
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc.txt ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/comms/librs232/distinfo b/comms/librs232/distinfo
new file mode 100644
index 000000000000..e9da4894b57f
--- /dev/null
+++ b/comms/librs232/distinfo
@@ -0,0 +1,2 @@
+SHA256 (RS-232.tar.gz) = 6d0800639c1b72411591e02b99269509e9916ddfda8d9fc4f2e385d44916240e
+SIZE (RS-232.tar.gz) = 11777
diff --git a/comms/librs232/files/Makefile b/comms/librs232/files/Makefile
new file mode 100644
index 000000000000..b642ce8fdefa
--- /dev/null
+++ b/comms/librs232/files/Makefile
@@ -0,0 +1,18 @@
+# BSD Makefile for librs232
+#
+# $FreeBSD$
+#
+
+SRCS= rs232.c
+
+# Includes
+INCS= rs232.h
+INCSDIR=${PREFIX}/include
+
+# Libraries
+LIB= rs232
+SHLIB_MAJOR= 1
+LIBDIR= ${PREFIX}/lib
+NO_PROFILE= YES
+
+.include <bsd.lib.mk>
diff --git a/comms/librs232/files/patch-rs232.c b/comms/librs232/files/patch-rs232.c
new file mode 100644
index 000000000000..e68de21ffc8c
--- /dev/null
+++ b/comms/librs232/files/patch-rs232.c
@@ -0,0 +1,71 @@
+--- rs232.c.orig 2014-10-05 15:21:14.000000000 +0800
++++ rs232.c 2014-12-04 14:24:26.000000000 +0800
+@@ -38,19 +38,23 @@
+
+
+
+-#ifdef __linux__ /* Linux */
++#if defined(__linux__) || defined(__FreeBSD__)
+
+
+-int Cport[30],
++int Cport[38],
+ error;
+
+ struct termios new_port_settings,
+- old_port_settings[30];
++ old_port_settings[38];
+
+-char comports[30][16]={"/dev/ttyS0","/dev/ttyS1","/dev/ttyS2","/dev/ttyS3","/dev/ttyS4","/dev/ttyS5",
+- "/dev/ttyS6","/dev/ttyS7","/dev/ttyS8","/dev/ttyS9","/dev/ttyS10","/dev/ttyS11",
+- "/dev/ttyS12","/dev/ttyS13","/dev/ttyS14","/dev/ttyS15","/dev/ttyUSB0",
+- "/dev/ttyUSB1","/dev/ttyUSB2","/dev/ttyUSB3","/dev/ttyUSB4","/dev/ttyUSB5",
++char comports[38][16]={"/dev/cuau0", "/dev/cuau1", "/dev/cuau2", "/dev/cuau3",
++ "/dev/cuaU0", "/dev/cuaU1", "/dev/cuaU2", "/dev/cuaU3",
++ "/dev/ttyS0","/dev/ttyS1","/dev/ttyS2","/dev/ttyS3",
++ "/dev/ttyS4","/dev/ttyS5", "/dev/ttyS6","/dev/ttyS7",
++ "/dev/ttyS8","/dev/ttyS9","/dev/ttyS10","/dev/ttyS11",
++ "/dev/ttyS12","/dev/ttyS13","/dev/ttyS14","/dev/ttyS15",
++ "/dev/ttyUSB0", "/dev/ttyUSB1","/dev/ttyUSB2",
++ "/dev/ttyUSB3", "/dev/ttyUSB4","/dev/ttyUSB5",
+ "/dev/ttyAMA0","/dev/ttyAMA1","/dev/ttyACM0","/dev/ttyACM1",
+ "/dev/rfcomm0","/dev/rfcomm1","/dev/ircomm0","/dev/ircomm1"};
+
+@@ -61,7 +65,7 @@
+ int baudr,
+ status;
+
+- if((comport_number>29)||(comport_number<0))
++ if((comport_number>37)||(comport_number<0))
+ {
+ printf("illegal comport number\n");
+ return(1);
+@@ -107,28 +111,6 @@
+ break;
+ case 460800 : baudr = B460800;
+ break;
+- case 500000 : baudr = B500000;
+- break;
+- case 576000 : baudr = B576000;
+- break;
+- case 921600 : baudr = B921600;
+- break;
+- case 1000000 : baudr = B1000000;
+- break;
+- case 1152000 : baudr = B1152000;
+- break;
+- case 1500000 : baudr = B1500000;
+- break;
+- case 2000000 : baudr = B2000000;
+- break;
+- case 2500000 : baudr = B2500000;
+- break;
+- case 3000000 : baudr = B3000000;
+- break;
+- case 3500000 : baudr = B3500000;
+- break;
+- case 4000000 : baudr = B4000000;
+- break;
+ default : printf("invalid baudrate\n");
+ return(1);
+ break;
diff --git a/comms/librs232/files/patch-rs232.h b/comms/librs232/files/patch-rs232.h
new file mode 100644
index 000000000000..81c40ed93dc3
--- /dev/null
+++ b/comms/librs232/files/patch-rs232.h
@@ -0,0 +1,12 @@
+--- rs232.h.orig 2014-12-04 14:17:08.000000000 +0800
++++ rs232.h 2014-12-04 14:17:22.000000000 +0800
+@@ -45,8 +45,7 @@
+ #include <string.h>
+
+
+-
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+
+ #include <termios.h>
+ #include <sys/ioctl.h>
diff --git a/comms/librs232/pkg-descr b/comms/librs232/pkg-descr
new file mode 100644
index 000000000000..0e89a5fa7729
--- /dev/null
+++ b/comms/librs232/pkg-descr
@@ -0,0 +1,4 @@
+Librs232 is a library which provides common interface to rs232 serial
+interface communication.
+
+WWW: http://www.teuniz.net/RS-232/
diff --git a/comms/librs232/pkg-plist b/comms/librs232/pkg-plist
new file mode 100644
index 000000000000..57385db495cb
--- /dev/null
+++ b/comms/librs232/pkg-plist
@@ -0,0 +1,5 @@
+include/rs232.h
+lib/librs232.a
+lib/librs232.so
+lib/librs232.so.1
+%%PORTDOCS%%%%DOCSDIR%%/doc.txt