aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorbrix <brix@FreeBSD.org>2007-12-12 04:45:58 +0800
committerbrix <brix@FreeBSD.org>2007-12-12 04:45:58 +0800
commita0574d1502f731a7028eb40b24e1715aa7222f9a (patch)
tree5b181a3b0190d84c9023a9c3986a2077c888bbc6 /sysutils
parent5e2faa69baf5562d2851eab24515caaab3527f2e (diff)
downloadfreebsd-ports-gnome-a0574d1502f731a7028eb40b24e1715aa7222f9a.tar.gz
freebsd-ports-gnome-a0574d1502f731a7028eb40b24e1715aa7222f9a.tar.zst
freebsd-ports-gnome-a0574d1502f731a7028eb40b24e1715aa7222f9a.zip
Add usbutils, which contains the popular lsusb(8) utility for listing
USB device descriptors. Approved by: erwin (mentor)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/usbutils/Makefile34
-rw-r--r--sysutils/usbutils/distinfo3
-rw-r--r--sysutils/usbutils/files/patch-config.h.in22
-rw-r--r--sysutils/usbutils/files/patch-configure13
-rw-r--r--sysutils/usbutils/files/patch-configure.in11
-rw-r--r--sysutils/usbutils/files/patch-lsusb.c33
-rw-r--r--sysutils/usbutils/pkg-descr4
-rw-r--r--sysutils/usbutils/pkg-plist3
9 files changed, 124 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index f9f26dc11c34..ce1526251c85 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -668,6 +668,7 @@
SUBDIR += uptimec
SUBDIR += uptimed
SUBDIR += usbhotkey
+ SUBDIR += usbutils
SUBDIR += uschedule
SUBDIR += userinfo
SUBDIR += userlist
diff --git a/sysutils/usbutils/Makefile b/sysutils/usbutils/Makefile
new file mode 100644
index 000000000000..ee636e9a5d99
--- /dev/null
+++ b/sysutils/usbutils/Makefile
@@ -0,0 +1,34 @@
+# New ports collection makefile for: usbutils
+# Date created: 14 Nov 2007
+# Whom: Henrik Brix Andersen <brix@FreeBSD.org>
+#
+# $FreeBSD$
+
+PORTNAME= usbutils
+PORTVERSION= 0.73
+CATEGORIES= sysutils
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= linux-usb
+
+MAINTAINER= brix@FreeBSD.org
+COMMENT= Utility for listing USB devices
+
+LIB_DEPENDS= usb-0.1:${PORTSDIR}/devel/libusb
+
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+CONFIGURE_ARGS= --datadir=${DATADIR}
+
+MAN8= lsusb.8
+PORTDOCS= AUTHORS ChangeLog NEWS README
+
+.include <bsd.port.pre.mk>
+
+post-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${PORTDOCS:S@^@${WRKSRC}/@} ${DOCSDIR}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/usbutils/distinfo b/sysutils/usbutils/distinfo
new file mode 100644
index 000000000000..0c83ddf363ad
--- /dev/null
+++ b/sysutils/usbutils/distinfo
@@ -0,0 +1,3 @@
+MD5 (usbutils-0.73.tar.gz) = 88978b4ad891f610620b1b8e5e0f43eb
+SHA256 (usbutils-0.73.tar.gz) = 2edc7cc98fd217f6980d8ba0b3792beed4695d4e8429a11c7237faab04ab47f4
+SIZE (usbutils-0.73.tar.gz) = 173312
diff --git a/sysutils/usbutils/files/patch-config.h.in b/sysutils/usbutils/files/patch-config.h.in
new file mode 100644
index 000000000000..c664960dea69
--- /dev/null
+++ b/sysutils/usbutils/files/patch-config.h.in
@@ -0,0 +1,22 @@
+--- config.h.in.orig 2006-12-10 21:33:49.000000000 +0100
++++ config.h.in 2007-11-14 20:50:36.000000000 +0100
+@@ -15,6 +15,9 @@
+ */
+ #undef HAVE_ALLOCA_H
+
++/* Define to 1 if you have the <asm/byteorder.h> header file. */
++#undef HAVE_ASM_BYTEORDER_H
++
+ /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+ #undef HAVE_DIRENT_H
+@@ -46,6 +49,9 @@
+ /* Define to 1 if you have the `z' library (-lz). */
+ #undef HAVE_LIBZ
+
++/* Define to 1 if you have the <machine/endian.h> header file. */
++#undef HAVE_MACHINE_ENDIAN_H
++
+ /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+ #undef HAVE_MALLOC
diff --git a/sysutils/usbutils/files/patch-configure b/sysutils/usbutils/files/patch-configure
new file mode 100644
index 000000000000..3ed6d73112c2
--- /dev/null
+++ b/sysutils/usbutils/files/patch-configure
@@ -0,0 +1,13 @@
+--- configure.orig 2007-10-23 23:19:49.000000000 +0200
++++ configure 2007-11-14 20:50:37.000000000 +0100
+@@ -4138,7 +4138,9 @@ done
+
+
+
+-for ac_header in fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h getopt.h errno.h
++
++
++for ac_header in fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h getopt.h errno.h asm/byteorder.h machine/endian.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff --git a/sysutils/usbutils/files/patch-configure.in b/sysutils/usbutils/files/patch-configure.in
new file mode 100644
index 000000000000..2f54d02fd7f0
--- /dev/null
+++ b/sysutils/usbutils/files/patch-configure.in
@@ -0,0 +1,11 @@
+--- configure.in.orig 2007-10-23 23:19:32.000000000 +0200
++++ configure.in 2007-11-14 20:50:37.000000000 +0100
+@@ -20,7 +20,7 @@ AC_PROG_LN_S
+ AC_FUNC_ALLOCA
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h getopt.h errno.h ])
++AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h getopt.h errno.h asm/byteorder.h machine/endian.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
diff --git a/sysutils/usbutils/files/patch-lsusb.c b/sysutils/usbutils/files/patch-lsusb.c
new file mode 100644
index 000000000000..40a7e3c1ab15
--- /dev/null
+++ b/sysutils/usbutils/files/patch-lsusb.c
@@ -0,0 +1,33 @@
+--- lsusb.c.orig 2007-10-23 23:04:32.000000000 +0200
++++ lsusb.c 2007-11-14 20:50:37.000000000 +0100
+@@ -35,13 +35,29 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdarg.h>
++
++#if defined(HAVE_ASM_BYTEORDER_H)
+ #include <asm/byteorder.h>
+ #define le16_to_cpu __le16_to_cpu
++
++#elif defined(HAVE_MACHINE_ENDIAN_H)
++#include <machine/endian.h>
++#if _BYTE_ORDER == _LITTLE_ENDIAN
++#define le16_to_cpu(x) (x)
++#else
++#define le16_to_cpu __bswap16
++#endif
++
++#else
++#error no le16_to_cpu implementation is available
++#endif
++
+ #include <usb.h>
+
+ /* NOTE: that should be <libusb.h> and it should include
+- * <linux/usb_ch9.h> ... without it, we keep accumulating
++ * <linux/usb/ch9.h> ... without it, we keep accumulating
+ * potentially broken variants of standard types ...
++ * also <linux/usb/cdc.h>, <linux/usb/audio.h>, etc
+ */
+
+ #include "names.h"
diff --git a/sysutils/usbutils/pkg-descr b/sysutils/usbutils/pkg-descr
new file mode 100644
index 000000000000..99bdfe3ce1a9
--- /dev/null
+++ b/sysutils/usbutils/pkg-descr
@@ -0,0 +1,4 @@
+Usbutils contains the lsusb utility for displaying information about
+USB buses in the system and the devices connected to them.
+
+WWW: http://sourceforge.net/projects/linux-usb/
diff --git a/sysutils/usbutils/pkg-plist b/sysutils/usbutils/pkg-plist
new file mode 100644
index 000000000000..c7b66580e81a
--- /dev/null
+++ b/sysutils/usbutils/pkg-plist
@@ -0,0 +1,3 @@
+sbin/lsusb
+%%DATADIR%%/usb.ids.gz
+@dirrm %%DATADIR%%