bluez-tools: Add package bluezetools
[feed/packages.git] / utils / opensc / Makefile
1 #
2 # Copyright (C) 2011-2014 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:=opensc
11 PKG_VERSION:=0.22.0
12 PKG_RELEASE:=$(AUTORELEASE)
13 PKG_HASH:=8d4e5347195ebea332be585df61dcc470331c26969e4b0447c851fb0844c7186
14
15 PKG_LICENSE:=LGPL-2.1-or-later
16 PKG_LICENSE_FILES:=COPYING
17 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
18 PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC/releases/download/$(PKG_VERSION)/
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20
21 PKG_BUILD_DEPENDS:=pcsc-lite
22 PKG_FIXUP:=libtool
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libopensc
29 SECTION:=libs
30 CATEGORY:=Libraries
31 TITLE:=OpenSC libraries for smart cards
32 URL:=https://github.com/OpenSC/OpenSC/wiki
33 DEPENDS:=+libopenssl +libpthread +zlib
34 MENU:=1
35 endef
36
37 define Package/libopensc/description
38 OpenSC provides a set of libraries and utilities to work with smart cards.
39 Its main focus is on cards that support cryptographic operations, and
40 facilitate their use in security applications such as authentication,
41 mail encryption and digital signatures.
42 endef
43
44 define Package/libopensc-pkcs11
45 SECTION:=libs
46 CATEGORY:=Libraries
47 TITLE:=OpenSC - PKCS11 provider
48 URL:=https://github.com/OpenSC/OpenSC/wiki
49 DEPENDS:=libopensc
50 endef
51
52 define Package/libopensc-pkcs11/description
53 OpenSC PKCS#11 provider
54 endef
55
56 define Package/libpkcs11-spy
57 SECTION:=libs
58 CATEGORY:=Libraries
59 TITLE:=PKCS11 spying wrapper
60 URL:=https://github.com/OpenSC/OpenSC/wiki
61 DEPENDS:=+libopenssl +libpthread
62 endef
63
64 define Package/libpkcs11-spy/dscription
65 PKCS#11 spying wrapper
66 endef
67
68 define Package/opensc-utils
69 SECTION:=utils
70 CATEGORY:=Utilities
71 TITLE:=OpenSC - tools for smart cards
72 URL:=https://github.com/OpenSC/OpenSC/wiki
73 DEPENDS:=+libopensc
74 MENU:=1
75 endef
76
77 define Package/opensc-utils/description
78 OpenSC utilities
79 endef
80
81 define ToolGen
82 define Package/opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))
83 TITLE:=$(firstword $(subst :, ,$(1))) utility from opensc
84 URL:=https://github.com/OpenSC/OpenSC/wiki
85 SECTION:=utils
86 CATEGORY:=Utilities
87 DEPENDS:=opensc-utils $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
88 endef
89 endef
90
91 define ProfileGen
92 define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))
93 TITLE:=$(firstword $(subst :, ,$(1))) card profile for opensc
94 URL:=https://github.com/OpenSC/OpenSC/wiki
95 SECTION:=libs
96 CATEGORY:=Libraries
97 DEPENDS:=libopensc
98 endef
99 endef
100
101 CONFIGURE_ARGS += \
102 --disable-notify \
103 --disable-strict
104
105 TOOLS:= \
106 cardos-tool \
107 cryptoflex-tool \
108 dnie-tool \
109 eidenv \
110 iasecc-tool \
111 netkey-tool \
112 openpgp-tool \
113 opensc-tool \
114 opensc-explorer:+libncurses:+libreadline \
115 piv-tool \
116 pkcs11-tool \
117 pkcs15-crypt \
118 pkcs15-init \
119 pkcs15-tool \
120 sc-hsm-tool \
121 westcos-tool
122
123 PROFILES:= \
124 asepcos \
125 authentic \
126 cardos \
127 cyberflex \
128 entersafe \
129 epass2003 \
130 flex \
131 gpk \
132 ias_adele_admin1 \
133 ias_adele_admin2 \
134 ias_adele_common \
135 iasecc_admin_eid \
136 iasecc_generic_oberthur \
137 iasecc_generic_pki \
138 iasecc \
139 incrypto34 \
140 jcop \
141 miocos \
142 muscle \
143 myeid \
144 oberthur \
145 openpgp \
146 pkcs15 \
147 rutoken_ecp \
148 rutoken \
149 sc-hsm \
150 setcos \
151 starcos \
152 westcos
153
154 $(foreach file,$(TOOLS),$(eval $(call ToolGen,$(file))))
155 $(foreach file,$(PROFILES),$(eval $(call ProfileGen,$(file))))
156
157 define Build/InstallDev
158 $(INSTALL_DIR) $(1)/usr/lib
159 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{la,so}* $(1)/usr/lib/
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{la,so}* $(1)/usr/lib/
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
163 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
164 $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
165 $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
166 $(INSTALL_DIR) $(1)/usr/share/opensc
167 $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
168 endef
169
170 define Package/libopensc/install
171 $(INSTALL_DIR) $(1)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.so* $(1)/usr/lib/
173 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.so* $(1)/usr/lib/
174 $(INSTALL_DIR) $(1)/etc
175 $(CP) $(PKG_INSTALL_DIR)/etc/opensc.conf $(1)/etc/
176 endef
177
178 define Package/libopensc-pkcs11/install
179 $(INSTALL_DIR) $(1)/usr/lib
180 $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
181 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
182 $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
183 endef
184
185 define Package/libpkcs11-spy/install
186 $(INSTALL_DIR) $(1)/usr/lib
187 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
188 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
189 $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
190 endef
191
192 define Package/opensc-card-profiles
193 $(INSTALL_DIR) $(1)/usr/share/opensc
194 $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
195 endef
196
197 define Package/opensc-utils/install
198 true
199 endef
200
201 define ToolInstall
202 define Package/opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
203 $(INSTALL_DIR) $$(1)/usr/bin
204 $(INSTALL_BIN) \
205 $(PKG_INSTALL_DIR)/usr/bin/$(firstword $(subst :, ,$(1))) \
206 $$(1)/usr/bin/
207 endef
208 endef
209
210 define ProfileInstall
211 define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
212 $(INSTALL_DIR) $$(1)/usr/share/opensc
213 $(INSTALL_BIN) \
214 $(PKG_INSTALL_DIR)/usr/share/opensc/$(firstword $(subst :, ,$(1))).profile \
215 $$(1)/usr/share/opensc
216 endef
217 endef
218
219 $(foreach file,$(TOOLS),$(eval $(call ToolInstall,$(file))))
220 $(foreach file,$(PROFILES),$(eval $(call ProfileInstall,$(file))))
221
222 $(eval $(call BuildPackage,libopensc))
223 $(eval $(call BuildPackage,libopensc-pkcs11))
224 $(eval $(call BuildPackage,libpkcs11-spy))
225
226 $(eval $(call BuildPackage,opensc-utils))
227 $(foreach file,$(TOOLS),$(eval $(call BuildPackage,opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
228 $(foreach file,$(PROFILES),$(eval $(call BuildPackage,libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(file)))))))