Add shell-fm package (#1107)
[openwrt/svn-archive/archive.git] / utils / firmwarehotplug / Makefile
1 #
2 # Copyright (C) 2006 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:=firmwarehotplug
11 PKG_VERSION:=0.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/linux-hotplug
16 PKG_MD5SUM:=e5cf352b172f498e27b160167b981f24
17 PKG_CAT:=zcat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/firmwarehotplug
25 SECTION:=utils
26 CATEGORY:=Utilities
27 DEPENDS:=@USB_SUPPORT +fxload
28 TITLE:=Hotplug firmware for EZ-USB microcontrollers
29 URL:=http://linux-hotplug.sourceforge.net/
30 endef
31
32 define Build/Compile
33 $(call Build/Compile/Default, \
34 OPT="$(TARGET_CFLAGS)" \
35 -C $(PKG_BUILD_DIR)/ezusb/midi/original \
36 DESTDIR="$(PKG_INSTALL_DIR)" \
37 all install \
38 )
39 endef
40
41 define Package/firmwarehotplug/install
42 $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
43 install -m755 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi $(1)/etc/hotplug.d/usb
44 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi.usermap $(1)/etc/hotplug.d
45 $(INSTALL_DIR) $(1)/usr/share/usb/ezusbmidi
46 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi1x1.ihx $(1)/usr/share/usb/ezusbmidi
47 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi2x2.ihx $(1)/usr/share/usb/ezusbmidi
48 endef
49
50 $(eval $(call BuildPackage,firmwarehotplug))
51
52 define Require/working-sdcc
53 echo 'int main() { return 0; }' >$(TMP_DIR)/a.c; \
54 sdcc -o $(TMP_DIR)/a.out $(TMP_DIR)/a.c; \
55 rm -f $(TMP_DIR)/a.*
56 endef
57
58 $(eval $(call Require,working-sdcc, \
59 Please install the SDCC Cross Compiler (sdcc). \
60 ))
61
62 define Require/working-sgml2html
63 echo >$(TMP_DIR)/test.sgml ' \
64 <!doctype linuxdoc system> \
65 <article> \
66 <!-- Title information --> \
67 <title>test \
68 <author>test \
69 <htmlurl url="localhost"> \
70 <date>test \
71 <sect>test \
72 </article>' ; \
73 sgml2html $(TMP_DIR)/test.sgml >$(TMP_DIR)/test.html; \
74 rm -f $(TMP_DIR)/test.*
75 endef
76
77 $(eval $(call Require,working-sgml2html, \
78 Please install the sgml-common package (sgml2html). \
79 ))