Merge pull request #819 from probonopd/hub-ctrl

hub-ctrl: Control USB power on a port by port basis
This commit is contained in:
Ted Hess 2015-01-25 18:57:30 -05:00
commit ebcd0936ee
1 changed files with 53 additions and 0 deletions

53
utils/hub-ctrl/Makefile Normal file
View File

@ -0,0 +1,53 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=hub-ctrl
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/codazoda/hub-ctrl.c.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=3eef0240fac90067d081551e9f73dfa741d94a9e
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/hub-ctrl
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Control USB power on a port by port basis
URL:=https://github.com/codazoda/hub-ctrl.c
DEPENDS:=+libusb-compat
endef
define Package/hub-ctrl/description
Control USB power on a port by port basis on some USB hubs.
This only works on USB hubs that have the hardware necessary
to allow software controlled power switching.
Most hubs DO NOT include the hardware.
endef
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include \
-L$(STAGING_DIR)/usr/lib -lusb \
-o $(PKG_BUILD_DIR)/hub-ctrl $(PKG_BUILD_DIR)/hub-ctrl.c
endef
define Package/hub-ctrl/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hub-ctrl $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,hub-ctrl))