From b989eb0842a79484b79413db9000951bdda041d1 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 20 Jun 2012 06:04:10 +0000 Subject: [PATCH] Build usbip userland packages (Closes: #568362) Do not build a shared library package; the API and ABI have changed from libusbip0 but there has been no upstream soversion change. svn path=/dists/sid/linux-tools/; revision=19177 --- debian/bin/genorig.py | 1 + debian/build/Makefile | 1 + debian/build/drivers/staging/usbip/Makefile | 24 ++++++++ debian/changelog | 3 + debian/libusbip-dev.install | 3 + debian/patches/series | 1 + .../usbip-remove-usbip_bind_driver-man-page | 56 +++++++++++++++++++ debian/rules.real | 23 +++++++- debian/templates/control.main.in | 32 +++++++++++ debian/templates/control.source.in | 3 +- debian/usbip.install | 4 ++ 11 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 debian/build/drivers/staging/usbip/Makefile create mode 100644 debian/libusbip-dev.install create mode 100644 debian/patches/usbip-remove-usbip_bind_driver-man-page create mode 100644 debian/usbip.install diff --git a/debian/bin/genorig.py b/debian/bin/genorig.py index 0bb17e417..a83142945 100755 --- a/debian/bin/genorig.py +++ b/debian/bin/genorig.py @@ -145,6 +145,7 @@ class Main(object): 'arch/*/include/', 'arch/*/Makefile', 'arch/x86/lib/memcpy_64.S', + 'drivers/staging/usbip/userspace/', 'include/', 'lib/rbtree.c', 'scripts/', diff --git a/debian/build/Makefile b/debian/build/Makefile index 970d4e4c7..c14458250 100644 --- a/debian/build/Makefile +++ b/debian/build/Makefile @@ -3,6 +3,7 @@ DATA = \ Makefile \ SUBDIRS = \ + drivers/staging/usbip \ scripts \ tools diff --git a/debian/build/drivers/staging/usbip/Makefile b/debian/build/drivers/staging/usbip/Makefile new file mode 100644 index 000000000..ef35f0737 --- /dev/null +++ b/debian/build/drivers/staging/usbip/Makefile @@ -0,0 +1,24 @@ +srcdir := $(top_srcdir)/drivers/staging/usbip/userspace + +# Make sure we don't override top_srcdir in the sub-make. 'unexport +# top_srcdir' is *not* sufficient; nor is adding 'MAKEFLAGS=' to the +# sub-make command line. +unexport MAKEFLAGS + +all: + cd $(srcdir) && ./autogen.sh + mkdir -p userspace + cd userspace && $(srcdir)/configure \ + --prefix=/usr \ + --with-tcp-wrappers=no \ + --with-usbids-dir=/usr/share/misc \ + --disable-shared + $(MAKE) -C userspace + +install: + $(MAKE) -C userspace install + +clean: + rm -rf $(addprefix $(srcdir)/,autom4te.cache aclocal.m4 config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing) + find $(srcdir)/ -name Makefile.in -delete + rm -rf userspace diff --git a/debian/changelog b/debian/changelog index 8f1b0f5cd..4252096bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ linux-tools (3.2.17-1) UNRELEASED; urgency=low - Perf: fix build breakage * Fix version insertion in perf man pages + * Build usbip userland packages (Closes: #568362) + - Do not build a shared library package; the API and ABI have changed + from libusbip0 but there has been no upstream soversion change -- Ben Hutchings Sat, 09 Jun 2012 19:56:44 +0100 diff --git a/debian/libusbip-dev.install b/debian/libusbip-dev.install new file mode 100644 index 000000000..7b2d9eb61 --- /dev/null +++ b/debian/libusbip-dev.install @@ -0,0 +1,3 @@ +usr/lib/libusbip.la +usr/lib/libusbip.a +usr/include/usbip/* diff --git a/debian/patches/series b/debian/patches/series index fd1f7d4cc..49ad21b28 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ modpost-symbol-prefix.patch tools-perf-version.patch tools-perf-install.patch +usbip-remove-usbip_bind_driver-man-page diff --git a/debian/patches/usbip-remove-usbip_bind_driver-man-page b/debian/patches/usbip-remove-usbip_bind_driver-man-page new file mode 100644 index 000000000..2a71f9f2c --- /dev/null +++ b/debian/patches/usbip-remove-usbip_bind_driver-man-page @@ -0,0 +1,56 @@ +From: Ben Hutchings +Subject: The usbip_bind_driver command was removed; remove the man page too + +--- a/drivers/staging/usbip/userspace/Makefile.am ++++ b/drivers/staging/usbip/userspace/Makefile.am +@@ -3,4 +3,4 @@ + include_HEADERS := $(addprefix libsrc/, \ + usbip_common.h vhci_driver.h usbip_host_driver.h) + +-dist_man_MANS := $(addprefix doc/, usbip.8 usbipd.8 usbip_bind_driver.8) ++dist_man_MANS := $(addprefix doc/, usbip.8 usbipd.8) +--- a/drivers/staging/usbip/userspace/doc/usbip_bind_driver.8 ++++ /dev/null +@@ -1,42 +0,0 @@ +-.TH USBIP_BIND_DRIVER "8" "February 2009" "usbip" "System Administration Utilities" +-.SH NAME +-usbip_bind_driver \- change driver binding for USB/IP +- +-.SH SYNOPSIS +-.B usbip_bind_driver +-[\fIoptions\fR] +- +-.SH DESCRIPTION +-Driver bindings for USB devices can be changed using +-this program. It is used to export and unexport USB +-devices over USB/IP. +- +-.SH OPTIONS +-.TP +-\fB\-u\fR, \fB\-\-usbip\fR +-Make a device exportable +-.TP +-\fB\-o\fR, \fB\-\-other\fR +-Use a device by a local driver +-.TP +-\fB\-l\fR, \fB\-\-list\fR +-Print usb devices and their drivers +-.TP +-\fB\-L\fR, \fB\-\-list2\fR +-Print usb devices and their drivers in parseable mode +- +-.SH EXAMPLES +- +- server:# usbip_bind_driver --list +- - List driver assignments for usb devices. +- +- server:# usbip_bind_driver --usbip 1-2 +- - Bind usbip-host.ko to the device of busid 1-2. +- - A usb device 1-2 is now exportable to other hosts! +- +- server:# usbip_bind_driver --other 1-2 +- - Shutdown exporting and use the device locally. +- +-.SH "SEE ALSO" +-\fBusbip\fP\fB(8)\fB\fP, +-\fBusbipd\fP\fB(8)\fB\fP diff --git a/debian/rules.real b/debian/rules.real index 17eec6acb..548df5f62 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -3,8 +3,10 @@ export DH_OPTIONS include debian/rules.defs DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) +PACKAGE_VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: ,,p') +USBIP_VERSION := 1.1.1+$(PACKAGE_VERSION) -binary-arch: install-kbuild +binary-arch: install-kbuild install-usbip ifneq ($(filter alpha amd64 armel armhf hppa i386 powerpc ppc64 s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),) binary-arch: install-tools endif @@ -57,3 +59,22 @@ install-tools: $(STAMPS_DIR)/build dh_md5sums dh_builddeb +install-usbip: DH_OPTIONS = -plibusbip-dev -pusbip +install-usbip: DIR = $(CURDIR)/debian/tmp +install-usbip: $(STAMPS_DIR)/build + dh_testdir + dh_testroot + dh_clean -k -d + $(MAKE) -C $(BUILD_DIR)/drivers/staging/usbip install top_srcdir=$(CURDIR) DESTDIR=$(DIR) + dh_install + dh_installchangelogs + dh_installdocs + dh_lintian + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol -- -v$(USBIP_VERSION) + dh_md5sums + dh_builddeb diff --git a/debian/templates/control.main.in b/debian/templates/control.main.in index 0a18f5b25..5f9d6a867 100644 --- a/debian/templates/control.main.in +++ b/debian/templates/control.main.in @@ -15,3 +15,35 @@ Description: Performance analysis tools for Linux @upstreamversion@ . The linux-base package contains a 'perf' command which will invoke the appropriate version for the running kernel. + +Package: libusbip-dev +Architecture: linux-any +Depends: ${misc:Depends} +Section: libdevel +Description: USB device sharing system over IP network (development files) + USB/IP is a system for sharing USB devices over the network. + . + This package provides headers for the libusbip library and + the library itself for static linking. + +Package: usbip +Architecture: linux-any +Depends: usbutils, ${shlibs:Depends}, ${misc:Depends} +Section: admin +Description: USB device sharing system over IP network + USB/IP is a system for sharing USB devices over the network. + . + To share USB devices between computers with their full + functionality, USB/IP encapsulates "USB requests" into IP + packets and transmits them between computers. + . + Original USB device drivers and applications can be used + for remote USB devices without any modification of them. A + computer can use remote USB devices as if they were + directly attached. + . + Currently USB/IP provides no access control or encryption. + It should only be used in trusted environments. + . + This package provides the server component 'usbipd' and the + client tool 'usbip'. diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index 82fa837fd..38ea5e236 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -6,6 +6,7 @@ Uploaders: Bastian Blank , Ben Hutchings Standards-Version: 3.9.2 Build-Depends: debhelper (>> 7), python, - asciidoc, binutils-dev, libdw-dev, libelf-dev, libnewt-dev, libperl-dev, python-dev, xmlto + asciidoc, binutils-dev, libdw-dev, libelf-dev, libnewt-dev, libperl-dev, python-dev, xmlto, + autoconf, automake, libtool, libglib2.0-dev, libsysfs-dev Vcs-Svn: svn://svn.debian.org/svn/kernel/dists/trunk/linux-tools/ Vcs-Browser: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux-tools/ diff --git a/debian/usbip.install b/debian/usbip.install new file mode 100644 index 000000000..4252b2807 --- /dev/null +++ b/debian/usbip.install @@ -0,0 +1,4 @@ +usr/sbin/usbip +usr/sbin/usbipd +usr/share/man/man8/usbip.8 +usr/share/man/man8/usbipd.8