openwrtv4/package/utils/usbmode/Makefile
Daniel Engberg 9edfe7dd13 source: Switch to xz for packages and tools where possible
* Change git packages to xz
* Update mirror checksums in packages where they are used
* Change a few source tarballs to xz if available upstream
* Remove unused lines in packages we're touching, requested by jow- and blogic
* We're relying more on xz-utils so add official mirror as primary source, master site as secondary.
* Add SHA256 checksums to multiple git tarball packages

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2016-10-06 12:16:56 +02:00

60 lines
1.8 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=usbmode
PKG_VERSION:=2014-08-26
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=993a9a542791953c4804f7ddbb3a07756738e37a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_MD5SUM:=4ba4ed629ef4530fd5a60b84cf5bf7a7194f60b69068882d47c1d3c55e06fc8c
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_DATA_VERSION:=20150115
PKG_DATA_URL:=http://www.draisberghof.de/usb_modeswitch
PKG_DATA_PATH:=usb-modeswitch-data-$(PKG_DATA_VERSION)
PKG_DATA_FILENAME:=$(PKG_DATA_PATH).tar.bz2
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Download/data
FILE:=$(PKG_DATA_FILENAME)
URL:=$(PKG_DATA_URL)
MD5SUM:=662bcd56a97e560ea974bc710822de51
endef
$(eval $(call Download,data))
define Package/usb-modeswitch
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libubox +libblobmsg-json +libusb-1.0
TITLE:=USB mode switching utility
endef
define Build/Prepare
$(Build/Prepare/Default)
tar xvfj $(DL_DIR)/$(PKG_DATA_FILENAME) -C $(PKG_BUILD_DIR)
rm -f \
$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/05c6:1000:sVe=GT
cp ./data/* $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/
endef
define Package/usb-modeswitch/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/usb $(1)/etc/init.d $(1)/sbin
perl $(PKG_BUILD_DIR)/convert-modeswitch.pl \
$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/* \
> $(1)/etc/usb-mode.json
$(INSTALL_DATA) ./files/usbmode.hotplug $(1)/etc/hotplug.d/usb/20-usb_mode
$(INSTALL_BIN) ./files/usbmode.init $(1)/etc/init.d/usbmode
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbmode $(1)/sbin/
endef
$(eval $(call BuildPackage,usb-modeswitch))