ed7ff2d2d60f2937ac1dfa0db0a87e6c2d2734d5
[feed/packages.git] / libs / libftdi1 / Makefile
1 #
2 # Copyright (C) 2014-2015 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:=libftdi1
11 PKG_VERSION:=1.2
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
16 PKG_MD5SUM:=89dff802d89c4c0d55d8b4665fd52d0b
17 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
18
19 PKG_LICENSE:=LGPL-2.0
20 PKG_LICENSE_FILES:=COPYING.LIB
21
22 PKG_INSTALL:=1
23 PKG_USE_MIPS16:=0
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 define Package/libftdi1
29 SECTION:=libs
30 CATEGORY:=Libraries
31 DEPENDS:=+libusb-1.0
32 TITLE:=Library to talk to FTDI chips
33 URL:=http://www.intra2net.com/en/developer/libftdi/
34 endef
35
36 define Package/libftdi1/description
37 libFTDI - FTDI USB driver with bitbang mode
38 libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode.
39 The library is linked with your program in userspace, no kernel driver required.
40 endef
41
42 define Package/ftdi_eeprom
43 SECTION:=utils
44 CATEGORY:=Utilities
45 DEPENDS:=+confuse +libftdi1
46 TITLE:=Tool for reading/erasing/flashing FTDI USB chip eeproms
47 URL:=http://www.intra2net.com/en/developer/libftdi/
48 endef
49
50 define Package/ftdi_eeprom/description
51 ftdi_eeprom is a small tool for reading/erasing/flashing FTDI USB chip
52 eeproms. It uses libftdi to access the chip, so you will need to have
53 the required permissions on the device.
54
55 The ftdi_sio module should not be loaded.
56
57 You have to unplug and replug your device to get the new values to be
58 read. Otherwise, you will still get the old values.
59 endef
60
61 define Build/InstallDev
62 $(INSTALL_DIR) $(1)/usr/include/libftdi1/
63 $(CP) $(PKG_INSTALL_DIR)/usr/include/libftdi1/ftdi.h $(1)/usr/include/libftdi1/
64 $(INSTALL_DIR) $(1)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi1.{a,so*} $(1)/usr/lib/
66 $(INSTALL_DIR) $(1)/usr/lib/cmake/libftdi1
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libftdi1/* $(1)/usr/lib/cmake/libftdi1/
68 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libftdi1.pc $(1)/usr/lib/pkgconfig/libftdi1.pc
70 $(SED) \
71 's,/usr/include,$$$${prefix}/include,g' \
72 $(1)/usr/lib/pkgconfig/libftdi1.pc
73 $(SED) \
74 's,/usr/lib,$$$${prefix}/lib,g' \
75 $(1)/usr/lib/pkgconfig/libftdi1.pc
76 endef
77
78 define Package/libftdi1/install
79 $(INSTALL_DIR) $(1)/usr/bin
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libftdi1-config $(1)/usr/bin/
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi1.so.* $(1)/usr/lib/
83 endef
84
85 define Package/ftdi_eeprom/install
86 $(INSTALL_DIR) $(1)/usr/bin
87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ftdi_eeprom $(1)/usr/bin/
88 endef
89
90 $(eval $(call BuildPackage,libftdi1))
91 $(eval $(call BuildPackage,ftdi_eeprom))