cd505f39281bccc3752c1c6887145d90b57571ac
[openwrt/svn-archive/archive.git] / libs / libnfc / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=libnfc
4 PKG_VERSION:=1.2.1
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
8 PKG_SOURCE_URL:=http://libnfc.googlecode.com/files/
9 PKG_MD5SUM:=90ce5d0445c6228f0e80ae3b62709f96
10
11 PKG_FIXUP = libtool
12
13 include $(INCLUDE_DIR)/package.mk
14
15 define Package/libnfc/Default
16 TITLE:=Near Field Communication (NFC) library
17 URL:=http://www.libnfc.org
18 endef
19
20 define Package/libnfc
21 $(call Package/libnfc/Default)
22 SECTION:=libs
23 CATEGORY:=Libraries
24 DEPENDS:=+libpcsclite +libusb +pcscd +ccid
25 endef
26
27 define Package/libnfc/description
28 libnfc is a free software library used to communicate with NFC
29 capable devices or tags. It support the four main NFC modulations:
30 * ISO14443-A (NXP MIFARE),
31 * ISO14443-B,
32 * JIS X 6319-4 (Sony Felica) and
33 * Jewel Topaz (Innovision Research & Development).
34 Supported NFC hardware devices are theorically all readers based
35 on the NXP PN53x NFC Controller.
36 endef
37
38 define Package/nfc-tools
39 $(call Package/libnfc/Default)
40 SECTION:=utils
41 CATEGORY:=Utilities
42 DEPENDS:=+libnfc
43 endef
44
45 TARGET_CFLAGS += $(FPIC)
46
47 define Build/Compile
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 DESTDIR="$(PKG_INSTALL_DIR)" \
50 all install
51 endef
52
53 define Build/InstallDev
54 $(INSTALL_DIR) $(1)/usr/include
55 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnfc $(1)/usr/include/
56 $(INSTALL_DIR) $(1)/usr/lib
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/
58 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfc.pc $(1)/usr/lib/pkgconfig/
60 endef
61
62 define Package/libnfc/install
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/
65 endef
66
67 define Package/nfc-tools/install
68 $(INSTALL_DIR) $(1)/usr/bin
69 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-anticol $(1)/usr/bin/
70 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/
71 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mftool $(1)/usr/bin/
72 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay $(1)/usr/bin/
73 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate $(1)/usr/bin/
74 endef
75
76 $(eval $(call BuildPackage,libnfc))
77 $(eval $(call BuildPackage,nfc-tools))