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