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.

100 lines
2.4 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:=13
  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 +usbids
  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. define Package/usbip/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  69. endef
  70. define Package/usbip-client/install
  71. $(INSTALL_DIR) $(1)/usr/sbin
  72. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  73. endef
  74. define Package/usbip-server/install
  75. $(INSTALL_DIR) $(1)/usr/sbin
  76. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  77. endef
  78. $(eval $(call BuildPackage,usbip))
  79. $(eval $(call BuildPackage,usbip-client))
  80. $(eval $(call BuildPackage,usbip-server))