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.

113 lines
2.9 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:=10
  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_FIXUP:=autoreconf
  27. PKG_INSTALL:=1
  28. include $(INCLUDE_DIR)/package.mk
  29. include $(INCLUDE_DIR)/nls.mk
  30. define Package/usbip/Common
  31. TITLE:=USB-over-IP
  32. URL:=http://usbip.sourceforge.net/
  33. DEPENDS:=@USB_SUPPORT
  34. endef
  35. define Package/usbip/Default
  36. $(call Package/usbip/Common)
  37. SECTION:=net
  38. CATEGORY:=Network
  39. endef
  40. define Package/usbip
  41. $(call Package/usbip/Default)
  42. TITLE+= (common)
  43. DEPENDS+= +libwrap +kmod-usbip +libudev-fbsd +USE_GLIBC:libbsd
  44. endef
  45. define Package/usbip-client
  46. $(call Package/usbip/Default)
  47. TITLE+= (client)
  48. DEPENDS+= usbip +kmod-usbip-client
  49. endef
  50. define Package/usbip-server
  51. $(call Package/usbip/Default)
  52. TITLE+= (server)
  53. DEPENDS+= usbip +kmod-usbip-server
  54. endef
  55. CONFIGURE_PATH:=.
  56. MAKE_PATH:=.
  57. LIBTOOL_PATHS:=.
  58. MAKE_FLAGS+=CFLAGS='-Dudev_device_get_devpath\(x\)=udev_device_get_syspath\(x\)+strlen\(\"/sys\"\) \
  59. -DSIGCLD=SIGCHLD'
  60. CONFIGURE_ARGS+= --disable-silent-rules
  61. define Build/Configure
  62. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  63. $(call Build/Configure/Default)
  64. endef
  65. CONFIGURE_VARS+= $(if $(CONFIG_USE_GLIBC),LIBS='-lbsd -lpthread')
  66. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  67. USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383
  68. USB_IDS_FILE:=usb.ids.$(USB_IDS_REV)
  69. define Download/usb.ids
  70. FILE:=$(USB_IDS_FILE)
  71. URL_FILE:=usb.ids
  72. URL:=@GITHUB/gentoo/hwids/$(USB_IDS_REV)
  73. HASH:=2d0403ffccc0ff7150e32c0bf8e2878816b76ba08d2c3bb1059f33627a3da30f
  74. endef
  75. define Package/usbip/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  78. $(INSTALL_DIR) $(1)/usr/share/hwdata
  79. $(CP) $(DL_DIR)/usb.ids.$(USB_IDS_REV) $(1)/usr/share/hwdata/usb.ids
  80. endef
  81. define Package/usbip-client/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  84. endef
  85. define Package/usbip-server/install
  86. $(INSTALL_DIR) $(1)/usr/sbin
  87. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  88. endef
  89. $(eval $(call Download,usb.ids))
  90. $(eval $(call BuildPackage,usbip))
  91. $(eval $(call BuildPackage,usbip-client))
  92. $(eval $(call BuildPackage,usbip-server))