Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=usbmode
  3. PKG_VERSION:=2014-08-26
  4. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  5. PKG_SOURCE_PROTO:=git
  6. PKG_SOURCE_URL=$(OPENWRT_GIT)/project/usbmode.git
  7. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  8. PKG_SOURCE_VERSION:=993a9a542791953c4804f7ddbb3a07756738e37a
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  10. CMAKE_INSTALL:=1
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_LICENSE_FILES:=
  13. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  14. PKG_DATA_VERSION:=20150115
  15. PKG_DATA_URL:=http://www.draisberghof.de/usb_modeswitch
  16. PKG_DATA_PATH:=usb-modeswitch-data-$(PKG_DATA_VERSION)
  17. PKG_DATA_FILENAME:=$(PKG_DATA_PATH).tar.bz2
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Download/data
  21. FILE:=$(PKG_DATA_FILENAME)
  22. URL:=$(PKG_DATA_URL)
  23. MD5SUM:=662bcd56a97e560ea974bc710822de51
  24. endef
  25. $(eval $(call Download,data))
  26. define Package/usb-modeswitch
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. DEPENDS:=+libubox +libblobmsg-json +libusb-1.0
  30. TITLE:=USB mode switching utility
  31. endef
  32. define Build/Prepare
  33. $(Build/Prepare/Default)
  34. tar xvfj $(DL_DIR)/$(PKG_DATA_FILENAME) -C $(PKG_BUILD_DIR)
  35. rm -f \
  36. $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/05c6:1000:sVe=GT
  37. cp ./data/* $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/
  38. endef
  39. define Package/usb-modeswitch/install
  40. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb $(1)/etc/init.d $(1)/sbin
  41. perl $(PKG_BUILD_DIR)/convert-modeswitch.pl \
  42. $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/* \
  43. > $(1)/etc/usb-mode.json
  44. $(INSTALL_DATA) ./files/usbmode.hotplug $(1)/etc/hotplug.d/usb/20-usb_mode
  45. $(INSTALL_BIN) ./files/usbmode.init $(1)/etc/init.d/usbmode
  46. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbmode $(1)/sbin/
  47. endef
  48. $(eval $(call BuildPackage,usb-modeswitch))