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