You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2010-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=usbip
  10. PKG_RELEASE:=5
  11. PKG_LICENSE:=GPL-2.0
  12. # Since kernel 2.6.39.1 userspace tools are inside the kernel tree
  13. # Package Automatic match version in kernel
  14. # MD5SUM is not useful kernel package already check it
  15. PKG_VERSION:=$(shell sed -n -e '/^AC_INIT/s/.*\[\([[:digit:]\.]*\)\].*/\1/gp' $(LINUX_DIR)/tools/usb/usbip/configure.ac)
  16. PKG_SOURCE:=
  17. PKG_SOURCE_URL:=
  18. PKG_MD5SUM:=unknown
  19. PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
  20. PATCH_DIR:=./patches-$(PKG_VERSION)
  21. define prepare_source_directory
  22. rm -rf $(PKG_BUILD_DIR)
  23. $(CP) $(LINUX_DIR)/tools/usb/usbip $(PKG_BUILD_DIR)
  24. endef
  25. Hooks/Prepare/Pre += prepare_source_directory
  26. PKG_BUILD_DEPENDS:=eudev
  27. PKG_FIXUP:=autoreconf
  28. PKG_INSTALL:=1
  29. PKG_FLAGS:=nonshared
  30. include $(INCLUDE_DIR)/package.mk
  31. include $(INCLUDE_DIR)/nls.mk
  32. define Package/usbip/Common
  33. TITLE:=USB-over-IP
  34. URL:=http://usbip.sourceforge.net/
  35. DEPENDS:=@USB_SUPPORT
  36. endef
  37. define Package/usbip/Default
  38. $(call Package/usbip/Common)
  39. SECTION:=net
  40. CATEGORY:=Network
  41. endef
  42. define Package/usbip
  43. $(call Package/usbip/Default)
  44. TITLE+= (common)
  45. DEPENDS+= +libwrap +kmod-usbip +eudev
  46. endef
  47. define Package/usbip-client
  48. $(call Package/usbip/Default)
  49. TITLE+= (client)
  50. DEPENDS+= usbip +kmod-usbip-client
  51. endef
  52. define Package/usbip-server
  53. $(call Package/usbip/Default)
  54. TITLE+= (server)
  55. DEPENDS+= usbip +kmod-usbip-server
  56. endef
  57. CONFIGURE_PATH:=.
  58. MAKE_PATH:=.
  59. LIBTOOL_PATHS:=.
  60. MAKE_FLAGS+=CFLAGS="-Wno-implicit-function-declaration"
  61. define Build/Configure
  62. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  63. $(call Build/Configure/Default)
  64. endef
  65. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  66. define Download/usb.ids
  67. URL:=http://www.linux-usb.org/
  68. FILE:=usb.ids
  69. MD5SUM:=
  70. endef
  71. define Package/usbip/install
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  74. $(INSTALL_DIR) $(1)/usr/share/hwdata
  75. $(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/
  76. endef
  77. define Package/usbip-client/install
  78. $(INSTALL_DIR) $(1)/usr/sbin
  79. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  80. endef
  81. define Package/usbip-server/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  84. endef
  85. $(eval $(call Download,usb.ids))
  86. $(eval $(call BuildPackage,usbip))
  87. $(eval $(call BuildPackage,usbip-client))
  88. $(eval $(call BuildPackage,usbip-server))