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.

108 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2010-2015 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:=6
  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. PKG_FLAGS:=nonshared
  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
  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="-Wno-implicit-function-declaration"
  60. define Build/Configure
  61. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  62. $(call Build/Configure/Default)
  63. endef
  64. CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
  65. define Download/usb.ids
  66. URL:=http://www.linux-usb.org/
  67. FILE:=usb.ids
  68. MD5SUM:=
  69. endef
  70. define Package/usbip/install
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
  73. $(INSTALL_DIR) $(1)/usr/share/hwdata
  74. $(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/
  75. endef
  76. define Package/usbip-client/install
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
  79. endef
  80. define Package/usbip-server/install
  81. $(INSTALL_DIR) $(1)/usr/sbin
  82. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
  83. endef
  84. $(eval $(call Download,usb.ids))
  85. $(eval $(call BuildPackage,usbip))
  86. $(eval $(call BuildPackage,usbip-client))
  87. $(eval $(call BuildPackage,usbip-server))