From 32020cbc63690f629fcf0c8c8280f4a036739345 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 25 Jan 2015 02:46:28 +0100 Subject: [PATCH] hub-ctrl: Control USB power on a port by port basis Signed-off-by: Simon Peter --- utils/hub-ctrl/Makefile | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 utils/hub-ctrl/Makefile diff --git a/utils/hub-ctrl/Makefile b/utils/hub-ctrl/Makefile new file mode 100644 index 0000000000..48cca4d77c --- /dev/null +++ b/utils/hub-ctrl/Makefile @@ -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 + +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))