remove libusb-legacy and point its users at libusb-compat
[packages.git] / libs / libnfc / Makefile
index cd505f3..882554f 100644 (file)
@@ -1,14 +1,22 @@
+#
+# Copyright (C) 2010-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnfc
-PKG_VERSION:=1.2.1
+PKG_VERSION:=1.4.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://libnfc.googlecode.com/files/
-PKG_MD5SUM:=90ce5d0445c6228f0e80ae3b62709f96
+PKG_SOURCE_URL:=http://libnfc.googlecode.com/files
+PKG_MD5SUM:=c99b2b9212b1a1b064055a199779bdd8
 
-PKG_FIXUP = libtool
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -18,41 +26,62 @@ define Package/libnfc/Default
 endef
 
 define Package/libnfc
-  $(call Package/libnfc/Default)
+$(call Package/libnfc/Default)
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libpcsclite +libusb +pcscd +ccid
+  DEPENDS:=+libusb-compat +pcscd +ccid
 endef
 
 define Package/libnfc/description
-  libnfc is a free software library used to communicate with NFC 
-  capable devices or tags. It support the four main NFC modulations:
-  * ISO14443-A (NXP MIFARE),
-  * ISO14443-B,
-  * JIS X 6319-4 (Sony Felica) and
-  * Jewel Topaz (Innovision Research & Development).
-  Supported NFC hardware devices are theorically all readers based 
-  on the NXP PN53x NFC Controller.
+  libnfc is a free software library used to handle NFC capable devices.
+  It supports the four main NFC modulations:
+   * ISO14443-A (NXP MIFARE),
+   * ISO14443-B,
+   * JIS X 6319-4 (Sony Felica) and
+   * Jewel Topaz (Innovision Research & Development).
+  And depending on hardware, it supports:
+   * Read (RFID @13.56Mhz),
+   * Emulation and
+   * Peer2Peer mode.  
 endef
 
-define Package/nfc-tools
-  $(call Package/libnfc/Default)
+define Package/libnfc-bin
+$(call Package/libnfc/Default)
+  TITLE+= (binaries)
   SECTION:=utils
   CATEGORY:=Utilities
   DEPENDS:=+libnfc
 endef
 
-TARGET_CFLAGS += $(FPIC)
+define Package/libnfc-bin/description
+  libnfc is provided with some useful tools:
+   * nfc-list: target listing;
+   * nfc-mfclassic: Mifare Classic operations;
+   * nfc-mfultralight: Mifare Ultralight operations.
+endef
+
+define Package/libnfc-examples
+$(call Package/libnfc/Default)
+  TITLE+= (examples)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libnfc
+endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
+define Package/libnfc-examples/description
+  libnfc is provided with some examples like:
+   * various targets emulation;
+   * NFC frames relay (ie. over network);
+   * manually done anticollision;
+   * etc.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_ARGS += --without-readline
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnfc $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/nfc $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
@@ -64,14 +93,26 @@ define Package/libnfc/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/
 endef
 
-define Package/nfc-tools/install
+define Package/libnfc-bin/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-anticol $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mftool $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfclassic $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfultralight $(1)/usr/bin/
+endef
+
+define Package/libnfc-examples/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-anticol $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-initiator $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-target $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-forum-tag4 $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-tag $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-uid $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-poll $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay-picc $(1)/usr/bin/
 endef
 
 $(eval $(call BuildPackage,libnfc))
-$(eval $(call BuildPackage,nfc-tools))
+$(eval $(call BuildPackage,libnfc-bin))
+$(eval $(call BuildPackage,libnfc-examples))