aboutsummaryrefslogtreecommitdiff
path: root/misc/usbrh-libusb
diff options
context:
space:
mode:
authorMIHIRA Sanpei Yoshiro <sanpei@FreeBSD.org>2009-07-20 14:33:55 +0000
committerMIHIRA Sanpei Yoshiro <sanpei@FreeBSD.org>2009-07-20 14:33:55 +0000
commit16e8ce3a4760a09940966a9d3020ea8909704b7a (patch)
tree49b3bb7e6b048cf1eeb0f2e78c73d536ebf5d833 /misc/usbrh-libusb
parentd12eaf0bccd0effa6f06b8ef9a4f001409beba96 (diff)
downloadports-16e8ce3a4760a09940966a9d3020ea8909704b7a.tar.gz
ports-16e8ce3a4760a09940966a9d3020ea8909704b7a.zip
Notes
Diffstat (limited to 'misc/usbrh-libusb')
-rw-r--r--misc/usbrh-libusb/Makefile30
-rw-r--r--misc/usbrh-libusb/distinfo3
-rw-r--r--misc/usbrh-libusb/files/patch-Makefile13
-rw-r--r--misc/usbrh-libusb/files/patch-usbrh_main.c72
-rw-r--r--misc/usbrh-libusb/pkg-descr9
5 files changed, 127 insertions, 0 deletions
diff --git a/misc/usbrh-libusb/Makefile b/misc/usbrh-libusb/Makefile
new file mode 100644
index 000000000000..d64b705a3c17
--- /dev/null
+++ b/misc/usbrh-libusb/Makefile
@@ -0,0 +1,30 @@
+# New ports collection makefile for: usbrh-libusb
+# Date created: 2009-07-20
+# Whom: sanpei@FreeBSD.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= usbrh-libusb
+PORTVERSION= 0.05
+CATEGORIES= misc
+MASTER_SITES= http://www.dd.iij4u.or.jp/~briareos/soft/ \
+ ${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR= sanpei
+DISTNAME= usbrh-${PORTVERSION}
+
+MAINTAINER= sanpei@FreeBSD.org
+COMMENT= Yet another reads temperatures and humidity from a Strawberry Linux USB-RH
+
+PLIST_FILES= bin/usbrh
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} <= 800097
+BROKEN= does not build
+.endif
+
+do-install:
+ @${INSTALL_SCRIPT} ${WRKSRC}/usbrh ${PREFIX}/bin/usbrh
+
+.include <bsd.port.post.mk>
diff --git a/misc/usbrh-libusb/distinfo b/misc/usbrh-libusb/distinfo
new file mode 100644
index 000000000000..4ce00b4052c8
--- /dev/null
+++ b/misc/usbrh-libusb/distinfo
@@ -0,0 +1,3 @@
+MD5 (usbrh-0.05.tar.gz) = 8a35c957e5b344567efc585ca2ac135d
+SHA256 (usbrh-0.05.tar.gz) = 9ed3dbed548b3eee278e9aca53690c7727c42c2c6ef933eeff04c23cc1d029ee
+SIZE (usbrh-0.05.tar.gz) = 5044
diff --git a/misc/usbrh-libusb/files/patch-Makefile b/misc/usbrh-libusb/files/patch-Makefile
new file mode 100644
index 000000000000..faa3d8a75372
--- /dev/null
+++ b/misc/usbrh-libusb/files/patch-Makefile
@@ -0,0 +1,13 @@
+--- ./Makefile.orig 2008-03-24 23:22:09.000000000 +0900
++++ ./Makefile 2009-07-20 23:23:39.000000000 +0900
+@@ -2,8 +2,9 @@
+ SRC = usbrh_main.c
+ EXE = usbrh
+
++all: $(EXE)
+ $(EXE): $(SRC)
+- gcc -lusb -g -o $@ $^
++ gcc -lusb -g -o $@ $(SRC)
+
+ clean:
+ rm $(EXE)
diff --git a/misc/usbrh-libusb/files/patch-usbrh_main.c b/misc/usbrh-libusb/files/patch-usbrh_main.c
new file mode 100644
index 000000000000..c6c6a9ec77ea
--- /dev/null
+++ b/misc/usbrh-libusb/files/patch-usbrh_main.c
@@ -0,0 +1,72 @@
+--- ./usbrh_main.c.orig 2008-03-24 23:23:26.000000000 +0900
++++ ./usbrh_main.c 2009-07-20 23:22:59.000000000 +0900
+@@ -198,7 +198,7 @@
+ break;
+ default:
+ usage();
+- exit(0);
++ return(0);
+ break;
+ }
+ }
+@@ -209,7 +209,7 @@
+
+ if(flag_l){
+ listdevice(USBRH_VENDOR, USBRH_PRODUCT);
+- exit(0);
++ return(0);
+ }
+
+ if(flag_d)
+@@ -217,7 +217,7 @@
+
+ if((dev = searchdevice(USBRH_VENDOR, USBRH_PRODUCT, DeviceNum)) == (struct usb_device *)NULL){
+ puts("USBRH not found");
+- exit(1);
++ return(1);
+ }
+
+ if(flag_d){
+@@ -226,26 +226,30 @@
+ dh = usb_open(dev);
+ if(dh == NULL){
+ puts("usb_open error");
+- exit(2);
++ return(2);
+ }
+
+ if((rc = usb_set_configuration(dh, dev->config->bConfigurationValue))<0){
+ puts("usb_set_configuration error");
+ usb_close(dh);
+- exit(3);
++ return(3);
+ }
+
+ if((rc =usb_claim_interface(dh, dev->config->interface->altsetting->bInterfaceNumber))<0){
+ //puts("usb_claim_interface error");
++#if 0
+ if((rc = usb_detach_kernel_driver_np(dh, dev->config->interface->altsetting->bInterfaceNumber))<0){
+ puts("usb_detach_kernel_driver_np error");
+ usb_close(dh);
+ exit(4);
+ }else{
++#endif
++ {
++
+ if((rc =usb_claim_interface(dh, dev->config->interface->altsetting->bInterfaceNumber))<0){
+ puts("usb_claim_interface error");
+ usb_close(dh);
+- exit(4);
++ return(4);
+ }
+ }
+ }
+@@ -311,7 +315,7 @@
+ if((rc = usb_release_interface(dh, dev->config->interface->altsetting->bInterfaceNumber))<0){
+ puts("usb_release_interface error");
+ usb_close(dh);
+- exit(5);
++ return(5);
+ }
+
+ usb_close(dh);
diff --git a/misc/usbrh-libusb/pkg-descr b/misc/usbrh-libusb/pkg-descr
new file mode 100644
index 000000000000..073264fc3532
--- /dev/null
+++ b/misc/usbrh-libusb/pkg-descr
@@ -0,0 +1,9 @@
+Yet Another usbrh reads temperatures and humidity from sensors of a "USB-RH",
+which is connected to a USB port of the computer.
+
+This program use libusb library and 8.0-RELEASE later.
+
+Strawberry Linux Co.,Ltd. USH-RH(Sensirion SHT-11)
+WWW: http://www2.strawberry-linux.com/products/usbrh/
+
+WWW: http://www.dd.iij4u.or.jp/~briareos/soft/usbrh.html