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.

112 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2010-2017 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:=12
  11. PKG_LICENSE:=GPL-2.0-only
  12. # Since kernel 2.6.39.1 userspace tools are inside the kernel tree
  13. # Package Automatic match version in kernel
  14. # HASH 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_HASH:=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_FIXUP:=autoreconf
  27. PKG_INSTALL:=1
  28. PKG_ASLR_PIE:=0
  29. include $(INCLUDE_DIR)/package.mk
  30. include $(INCLUDE_DIR)/nls.mk
  31. define Package/usbip/Common
  32. TITLE:=USB-over-IP
  33. URL:=http://usbip.sourceforge.net/
  34. DEPENDS:=@USB_SUPPORT
  35. endef
  36. define Package/usbip/Default
  37. $(call Package/usbip/Common)
  38. SECTION:=net
  39. CATEGORY:=Network
  40. endef
  41. define Package/usbip
  42. $(call Package/usbip/Default)
  43. TITLE+= (common)
  44. DEPENDS+= +libwrap +kmod-usbip +libudev +USE_GLIBC:libbsd
  45. endef
  46. define Package/usbip-client
  47. $(call Package/usbip/Default)
  48. TITLE+= (client)
  49. DEPENDS+= usbip +kmod-usbip-client
  50. endef
  51. define Package/usbip-server
  52. $(call Package/usbip/Default)
  53. TITLE+= (server)
  54. DEPENDS+= usbip +kmod-usbip-server
  55. endef
  56. CONFIGURE_PATH:=.
  57. MAKE_PATH:=.
  58. LIBTOOL_PATHS:=.
  59. CONFIGURE_ARGS+= --disable-silent-rules
  60. define Build/Configure
  61. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  62. $(call Build/Configure/Default)
  63. endef
  64. CONFIGURE_VARS+= $(if $(CONFIG_USE_GLIBC),LIBS='-lbsd -lpthread')
  65. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  66. USB_IDS_VER:=0.318
  67. USB_IDS_FILE:=usb.ids.$(USB_IDS_VER)
  68. define Download/usb.ids
  69. FILE:=$(USB_IDS_FILE)
  70. URL_FILE:=usb.ids
  71. URL:=@GITHUB/vcrhonek/hwdata/v$(USB_IDS_VER)
  72. HASH:=84bc5452e4e45c2250e01bc74e03528b2a53c4724b2c4a5feaea76a922f83915
  73. endef
  74. define Package/usbip/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  77. $(INSTALL_DIR) $(1)/usr/share/hwdata
  78. $(CP) $(DL_DIR)/usb.ids.$(USB_IDS_VER) $(1)/usr/share/hwdata/usb.ids
  79. endef
  80. define Package/usbip-client/install
  81. $(INSTALL_DIR) $(1)/usr/sbin
  82. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  83. endef
  84. define Package/usbip-server/install
  85. $(INSTALL_DIR) $(1)/usr/sbin
  86. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  87. endef
  88. $(eval $(call Download,usb.ids))
  89. $(eval $(call BuildPackage,usbip))
  90. $(eval $(call BuildPackage,usbip-client))
  91. $(eval $(call BuildPackage,usbip-server))