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.

114 lines
2.8 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:=11
  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. # 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-fbsd +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. MAKE_FLAGS+=CFLAGS='-Dudev_device_get_devpath\(x\)=udev_device_get_syspath\(x\)+strlen\(\"/sys\"\) \
  60. -DSIGCLD=SIGCHLD'
  61. CONFIGURE_ARGS+= --disable-silent-rules
  62. define Build/Configure
  63. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  64. $(call Build/Configure/Default)
  65. endef
  66. CONFIGURE_VARS+= $(if $(CONFIG_USE_GLIBC),LIBS='-lbsd -lpthread')
  67. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  68. USB_IDS_VER:=0.318
  69. USB_IDS_FILE:=usb.ids.$(USB_IDS_VER)
  70. define Download/usb.ids
  71. FILE:=$(USB_IDS_FILE)
  72. URL_FILE:=usb.ids
  73. URL:=@GITHUB/vcrhonek/hwdata/v$(USB_IDS_VER)
  74. HASH:=84bc5452e4e45c2250e01bc74e03528b2a53c4724b2c4a5feaea76a922f83915
  75. endef
  76. define Package/usbip/install
  77. $(INSTALL_DIR) $(1)/usr/lib
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  79. $(INSTALL_DIR) $(1)/usr/share/hwdata
  80. $(CP) $(DL_DIR)/usb.ids.$(USB_IDS_VER) $(1)/usr/share/hwdata/usb.ids
  81. endef
  82. define Package/usbip-client/install
  83. $(INSTALL_DIR) $(1)/usr/sbin
  84. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  85. endef
  86. define Package/usbip-server/install
  87. $(INSTALL_DIR) $(1)/usr/sbin
  88. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  89. endef
  90. $(eval $(call Download,usb.ids))
  91. $(eval $(call BuildPackage,usbip))
  92. $(eval $(call BuildPackage,usbip-client))
  93. $(eval $(call BuildPackage,usbip-server))