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.

54 lines
1.4 KiB

  1. #
  2. # Copyright (C) 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. PKG_NAME:=hub-ctrl
  9. PKG_VERSION:=1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/codazoda/hub-ctrl.c.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=3eef0240fac90067d081551e9f73dfa741d94a9e
  15. PKG_LICENSE:=GPL-2.0+
  16. PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  18. PKG_MIRROR_HASH:=98ffd9ead07d6208acf7f713dc6574877d4967bdfb47bf70444ec9d44399faaa
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/hub-ctrl
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=Control USB power on a port by port basis
  25. URL:=https://github.com/codazoda/hub-ctrl.c
  26. DEPENDS:=+libusb-compat
  27. endef
  28. define Package/hub-ctrl/description
  29. Control USB power on a port by port basis on some USB hubs.
  30. This only works on USB hubs that have the hardware necessary
  31. to allow software controlled power switching.
  32. Most hubs DO NOT include the hardware.
  33. endef
  34. define Build/Compile
  35. $(TARGET_CC) $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include \
  36. -L$(STAGING_DIR)/usr/lib -lusb \
  37. -o $(PKG_BUILD_DIR)/hub-ctrl $(PKG_BUILD_DIR)/hub-ctrl.c
  38. endef
  39. define Package/hub-ctrl/install
  40. $(INSTALL_DIR) $(1)/usr/sbin
  41. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hub-ctrl $(1)/usr/sbin/
  42. endef
  43. $(eval $(call BuildPackage,hub-ctrl))