source: packages/net/usbip/Makefile @ 20978

Last change on this file since 20978 was 20978, checked in by nico, 6 years ago

[packages] add usbip, a general USB device sharing system over IP network (closes: #5590)

File size: 3.2 KB
Line 
1#
2# Copyright (C) 2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=usbip
12PKG_VERSION:=0.1.7
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=@SF/usbip
17PKG_MD5SUM:=d1094b6d4449787864f8be001639232c
18
19PKG_FIXUP:=libtool
20PKG_INSTALL:=1
21
22include $(INCLUDE_DIR)/package.mk
23
24define Package/usbip/Common
25  TITLE:=USB-over-IP
26  URL:=http://usbip.sourceforge.net/
27  DEPENDS:=@LINUX_2_6 @USB_SUPPORT
28endef
29
30define Package/usbip/Default
31$(call Package/usbip/Common)
32  SECTION:=net
33  CATEGORY:=Network
34endef
35
36define Package/usbip
37$(call Package/usbip/Default)
38  TITLE+= (common)
39  DEPENDS+= +glib2 +libsysfs +libwrap
40endef
41
42define Package/usbip-client
43$(call Package/usbip/Default)
44  TITLE+= (client)
45  DEPENDS+= +usbip +kmod-usbip-client
46endef
47
48define Package/usbip-server
49$(call Package/usbip/Default)
50  TITLE+= (server)
51  DEPENDS+= +usbip +kmod-usbip-server
52endef
53
54define KernelPackage/usbip/Default
55$(call Package/usbip/Common)
56  SUBMENU:=USB Support
57endef
58
59define KernelPackage/usbip
60$(call KernelPackage/usbip/Default)
61  TITLE+= (kernel support)
62  KCONFIG:= USB_IP_COMMON=m
63  FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip_common_mod.$(LINUX_KMOD_SUFFIX)
64  AUTOLOAD:=$(call AutoLoad,98,usbip_common_mod)
65endef
66
67define KernelPackage/usbip-client
68$(call KernelPackage/usbip/Default)
69  SUBMENU:=USB Support
70  TITLE+= (kernel client driver)
71  DEPENDS+= +kmod-usbip
72  KCONFIG:= USB_IP_VHCI_HCD=m
73  FILES:=$(LINUX_DIR)/drivers/staging/usbip/vhci-hcd.$(LINUX_KMOD_SUFFIX)
74  AUTOLOAD:=$(call AutoLoad,99,vhci-hcd)
75endef
76
77define KernelPackage/usbip-server
78$(call KernelPackage/usbip/Default)
79  SUBMENU:=USB Support
80  TITLE+= (kernel host driver)
81  DEPENDS+= +kmod-usbip
82  KCONFIG:= USB_IP_HOST=m
83  FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip.$(LINUX_KMOD_SUFFIX)
84  AUTOLOAD:=$(call AutoLoad,99,usbip)
85endef
86
87include $(INCLUDE_DIR)/kernel-defaults.mk
88
89CONFIGURE_PATH:=./src
90MAKE_PATH:=./src
91LIBTOOL_PATHS:=./src
92
93define Build/Prepare
94$(call Build/Prepare/Default)
95        (cd $(PKG_BUILD_DIR)/src; [ -x ./configure ] || ./autogen.sh )
96endef
97
98define Build/Compile/kmod
99        $(MAKE) $(KERNEL_MAKEOPTS) \
100                SUBDIRS="$(LINUX_DIR)/drivers/staging/usbip" \
101                CONFIG_USB_IP_COMMON=m \
102                CONFIG_USB_IP_VHCI_HCD=m \
103                CONFIG_USB_IP_HOST=m \
104                modules
105endef
106
107define Build/Compile
108$(call Build/Compile/Default)
109$(call Build/Compile/kmod)
110endef
111
112define Package/usbip/install
113        $(INSTALL_DIR) $(1)/usr/lib
114        $(CP) \
115                $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* \
116                $(1)/usr/lib/
117        $(INSTALL_DIR) $(1)/usr/share/usbip
118        $(CP) \
119                $(PKG_INSTALL_DIR)/usr/share/usbip/usb.ids \
120                $(1)/usr/share/usbip/
121endef
122
123define Package/usbip-client/install
124        $(INSTALL_DIR) $(1)/usr/bin
125        $(CP) \
126                $(PKG_INSTALL_DIR)/usr/bin/usbip \
127                $(1)/usr/bin/
128endef
129
130define Package/usbip-server/install
131        $(INSTALL_DIR) $(1)/usr/bin
132        $(CP) \
133                $(PKG_INSTALL_DIR)/usr/bin/bind_driver \
134                $(PKG_INSTALL_DIR)/usr/bin/usbipd \
135                $(1)/usr/bin/
136endef
137
138$(eval $(call BuildPackage,usbip))
139$(eval $(call BuildPackage,usbip-client))
140$(eval $(call BuildPackage,usbip-server))
141$(eval $(call KernelPackage,usbip))
142$(eval $(call KernelPackage,usbip-client))
143$(eval $(call KernelPackage,usbip-server))
Note: See TracBrowser for help on using the repository browser.