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.

106 lines
2.6 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:=14
  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. define Package/usbip-server/conffiles
  57. /etc/config/usbipd
  58. endef
  59. CONFIGURE_PATH:=.
  60. MAKE_PATH:=.
  61. LIBTOOL_PATHS:=.
  62. CONFIGURE_ARGS+= --disable-silent-rules
  63. define Build/Configure
  64. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  65. $(call Build/Configure/Default)
  66. endef
  67. CONFIGURE_VARS+= $(if $(CONFIG_USE_GLIBC),LIBS='-lbsd -lpthread')
  68. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  69. define Package/usbip/install
  70. $(INSTALL_DIR) $(1)/usr/lib
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  72. endef
  73. define Package/usbip-client/install
  74. $(INSTALL_DIR) $(1)/usr/sbin
  75. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  76. endef
  77. define Package/usbip-server/install
  78. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
  79. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  80. $(INSTALL_BIN) ./files/usbipd.init $(1)/etc/init.d/usbipd
  81. $(INSTALL_DATA) ./files/usbipd.conf $(1)/etc/config/usbipd
  82. endef
  83. $(eval $(call BuildPackage,usbip))
  84. $(eval $(call BuildPackage,usbip-client))
  85. $(eval $(call BuildPackage,usbip-server))