2 # Copyright (C) 2010-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://libnfc.googlecode.com/files
16 PKG_MD5SUM:=c99b2b9212b1a1b064055a199779bdd8
21 include $(INCLUDE_DIR)/package.mk
23 define Package/libnfc/Default
24 TITLE:=Near Field Communication (NFC) library
25 URL:=http://www.libnfc.org
29 $(call Package/libnfc/Default)
32 DEPENDS:=+libusb +pcscd +ccid
35 define Package/libnfc/description
36 libnfc is a free software library used to handle NFC capable devices.
37 It supports the four main NFC modulations:
38 * ISO14443-A (NXP MIFARE),
40 * JIS X 6319-4 (Sony Felica) and
41 * Jewel Topaz (Innovision Research & Development).
42 And depending on hardware, it supports:
43 * Read (RFID @13.56Mhz),
48 define Package/libnfc-bin
49 $(call Package/libnfc/Default)
56 define Package/libnfc-bin/description
57 libnfc is provided with some useful tools:
58 * nfc-list: target listing;
59 * nfc-mfclassic: Mifare Classic operations;
60 * nfc-mfultralight: Mifare Ultralight operations.
63 define Package/libnfc-examples
64 $(call Package/libnfc/Default)
71 define Package/libnfc-examples/description
72 libnfc is provided with some examples like:
73 * various targets emulation;
74 * NFC frames relay (ie. over network);
75 * manually done anticollision;
79 TARGET_CFLAGS += $(FPIC)
80 CONFIGURE_ARGS += --without-readline
82 define Build/InstallDev
83 $(INSTALL_DIR) $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/nfc $(1)/usr/include/
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/
87 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfc.pc $(1)/usr/lib/pkgconfig/
91 define Package/libnfc/install
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/
96 define Package/libnfc-bin/install
97 $(INSTALL_DIR) $(1)/usr/bin
98 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/
99 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfclassic $(1)/usr/bin/
100 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfultralight $(1)/usr/bin/
103 define Package/libnfc-examples/install
104 $(INSTALL_DIR) $(1)/usr/bin
105 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-anticol $(1)/usr/bin/
106 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-initiator $(1)/usr/bin/
107 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-target $(1)/usr/bin/
108 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-forum-tag4 $(1)/usr/bin/
109 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-tag $(1)/usr/bin/
110 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-uid $(1)/usr/bin/
111 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-poll $(1)/usr/bin/
112 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay $(1)/usr/bin/
113 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay-picc $(1)/usr/bin/
116 $(eval $(call BuildPackage,libnfc))
117 $(eval $(call BuildPackage,libnfc-bin))
118 $(eval $(call BuildPackage,libnfc-examples))