d82a83c56a1709278bd49004e86bd18f37ca3e10
[openwrt/svn-archive/archive.git] / package / system / utils / usb-modeswitch / Makefile
1 #
2 # Copyright (C) 2008-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=usb-modeswitch
11 PKG_VERSION:=1.2.5
12 PKG_DATA_VERSION:=20121109
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://www.draisberghof.de/usb_modeswitch
18 PKG_MD5SUM:=c393603908eceab95444c5bde790f6f0
19
20 PKG_DATA_PATH:=usb-modeswitch-data-$(PKG_DATA_VERSION)
21 PKG_DATA_FILENAME:=$(PKG_DATA_PATH).tar.bz2
22
23 PKG_MAINTAINER := Felix Fietkau <nbd@openwrt.org>
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/usb-modeswitch
28 SECTION:=utils
29 CATEGORY:=Utilities
30 DEPENDS:=+libusb-compat
31 TITLE:=USB ModeSwitch
32 URL:=http://www.draisberghof.de/usb_modeswitch/
33 endef
34
35 define Package/usb-modeswitch/description
36 A mode switching tool for controlling
37 "flip flop" (multiple device) USB gear.
38 endef
39
40 define Package/usb-modeswitch-data
41 SECTION:=utils
42 CATEGORY:=Utilities
43 DEPENDS:=usb-modeswitch
44 VERSION:=$(PKG_DATA_VERSION)
45 TITLE:=USB ModeSwitch - Dongle configuration database
46 URL:=http://www.draisberghof.de/usb_modeswitch/
47 endef
48
49 define Package/usb-modeswitch-data/description
50 Configuration database for usb-modeswitch.
51 Contains definitions for many USB devices required to
52 autoswitch "flip flop" gear.
53 endef
54
55 define Download/data
56 FILE:=$(PKG_DATA_FILENAME)
57 URL:=$(PKG_SOURCE_URL)
58 MD5SUM:=a7d23a03157871013a0d708ab2b1b6df
59 endef
60 $(eval $(call Download,data))
61
62 define Build/Compile
63 tar xvfj $(DL_DIR)/$(PKG_DATA_FILENAME) -C $(PKG_BUILD_DIR)
64 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \
65 -lusb \
66 -o $(PKG_BUILD_DIR)/usb_modeswitch-OpenWrt \
67 $(PKG_BUILD_DIR)/usb_modeswitch.c
68 endef
69
70 define Package/usb-modeswitch/install
71 $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/hotplug.d/usb
72 $(INSTALL_BIN) $(PKG_BUILD_DIR)/usb_modeswitch-OpenWrt $(1)/usr/bin/usb_modeswitch
73 $(INSTALL_DATA) ./files/modeswitch.hotplug $(1)/etc/hotplug.d/usb/20-modeswitch
74 endef
75
76 define Package/usb-modeswitch-data/install
77 $(INSTALL_DIR) $(1)/etc
78 $(CP) $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d $(1)/etc/
79 endef
80
81 $(eval $(call BuildPackage,usb-modeswitch))
82 $(eval $(call BuildPackage,usb-modeswitch-data))