d6138ecfd49cb86be051bdbd49d74bee478997a4
[packages.git] / utils / pcsc-lite / Makefile
1 #
2 # Copyright (C) 2009-2012 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:=pcsc-lite
11 PKG_VERSION:=1.8.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://alioth.debian.org/frs/download.php/3695
16 PKG_MD5SUM:=cb7156346e9478c19085c918b605ed43
17
18 PKG_FIXUP:=autoreconf
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/pcsc-lite/Default
24   TITLE:=Middleware to access a smart card using SCard API (PC/SC).
25   URL:=http://pcsclite.alioth.debian.org/
26 endef
27
28 define Package/pcsc-lite/Default/description
29   The purpose of PC/SC Lite is to provide a Windows(R) SCard
30   interface in a very small form factor for communicating to
31   smart cards and smart cards readers.
32 endef
33
34 define Package/libpcsclite
35   $(call Package/pcsc-lite/Default)
36   SECTION:=libs
37   CATEGORY:=Libraries
38   TITLE+= (library)
39   DEPENDS:=+libusb +libpthread +librt
40 endef
41
42 define Package/libpcsclite/description
43   $(call Package/pcsc-lite/Default/description)
44   .
45   This package contains the PC/SC shared library.
46 endef
47
48 define Package/pcscd
49   $(call Package/pcsc-lite/Default)
50   SECTION:=utils
51   CATEGORY:=Utilities
52   TITLE+= (daemon)
53   DEPENDS:=+libpcsclite
54 endef
55
56 define Package/pcscd/description
57   $(call Package/pcsc-lite/Default/description)
58   .
59   This package contains the PC/SC daemon.
60 endef
61
62 TARGET_CFLAGS += $(FPIC)
63 TARGET_LDFLAGS += -lpthread
64
65 CONFIGURE_ARGS += \
66         --disable-libudev \
67         --enable-libusb \
68         --enable-static \
69         --enable-usbdropdir=/usr/lib/pcsc/drivers
70
71 define Build/InstallDev
72         $(INSTALL_DIR) $(1)/usr/include/PCSC
73         $(CP) $(PKG_INSTALL_DIR)/usr/include/PCSC/* $(1)/usr/include/PCSC/
74         $(INSTALL_DIR) $(1)/usr/lib
75         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcsclite.{a,so*} $(1)/usr/lib/
76         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
77         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcsclite.pc $(1)/usr/lib/pkgconfig/
78 endef
79
80 define Package/libpcsclite/install
81         $(INSTALL_DIR) $(1)/usr/lib
82         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcsclite.so.* $(1)/usr/lib/
83 endef
84
85 define Package/pcscd/conffiles
86 /etc/reader.conf.d/reader.conf
87 endef
88
89 define Package/pcscd/install
90         $(INSTALL_DIR) $(1)/usr/sbin
91         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pcscd $(1)/usr/sbin/
92         $(INSTALL_DIR) $(1)/etc/init.d
93         $(INSTALL_BIN) ./files/pcscd.init $(1)/etc/init.d/pcscd
94         $(INSTALL_DIR) $(1)/etc/reader.conf.d
95 endef
96
97 $(eval $(call BuildPackage,libpcsclite))
98 $(eval $(call BuildPackage,pcscd))