gst1-plugins-base: update to 1.22.8
[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:=2
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-man \
103 --disable-notify \
104 --disable-strict
105
106 TOOLS:= \
107 cardos-tool \
108 cryptoflex-tool \
109 dnie-tool \
110 eidenv \
111 iasecc-tool \
112 netkey-tool \
113 openpgp-tool \
114 opensc-tool \
115 opensc-explorer:+libncurses:+libreadline \
116 piv-tool \
117 pkcs11-tool \
118 pkcs15-crypt \
119 pkcs15-init \
120 pkcs15-tool \
121 sc-hsm-tool \
122 westcos-tool
123
124 PROFILES:= \
125 asepcos \
126 authentic \
127 cardos \
128 cyberflex \
129 entersafe \
130 epass2003 \
131 flex \
132 gpk \
133 ias_adele_admin1 \
134 ias_adele_admin2 \
135 ias_adele_common \
136 iasecc_admin_eid \
137 iasecc_generic_oberthur \
138 iasecc_generic_pki \
139 iasecc \
140 incrypto34 \
141 jcop \
142 miocos \
143 muscle \
144 myeid \
145 oberthur \
146 openpgp \
147 pkcs15 \
148 rutoken_ecp \
149 rutoken \
150 sc-hsm \
151 setcos \
152 starcos \
153 westcos
154
155 $(foreach file,$(TOOLS),$(eval $(call ToolGen,$(file))))
156 $(foreach file,$(PROFILES),$(eval $(call ProfileGen,$(file))))
157
158 define Build/InstallDev
159 $(INSTALL_DIR) $(1)/usr/lib
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{la,so}* $(1)/usr/lib/
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{la,so}* $(1)/usr/lib/
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
163 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
164 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
165 $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
166 $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
167 $(INSTALL_DIR) $(1)/usr/share/opensc
168 $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
169 endef
170
171 define Package/libopensc/install
172 $(INSTALL_DIR) $(1)/usr/lib
173 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.so* $(1)/usr/lib/
174 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.so* $(1)/usr/lib/
175 $(INSTALL_DIR) $(1)/etc
176 $(CP) $(PKG_INSTALL_DIR)/etc/opensc.conf $(1)/etc/
177 endef
178
179 define Package/libopensc-pkcs11/install
180 $(INSTALL_DIR) $(1)/usr/lib
181 $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
182 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
183 $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
184 endef
185
186 define Package/libpkcs11-spy/install
187 $(INSTALL_DIR) $(1)/usr/lib
188 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
189 $(INSTALL_DIR) $(1)/usr/lib/pkcs11
190 $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
191 endef
192
193 define Package/opensc-card-profiles
194 $(INSTALL_DIR) $(1)/usr/share/opensc
195 $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
196 endef
197
198 define Package/opensc-utils/install
199 true
200 endef
201
202 define ToolInstall
203 define Package/opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
204 $(INSTALL_DIR) $$(1)/usr/bin
205 $(INSTALL_BIN) \
206 $(PKG_INSTALL_DIR)/usr/bin/$(firstword $(subst :, ,$(1))) \
207 $$(1)/usr/bin/
208 endef
209 endef
210
211 define ProfileInstall
212 define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
213 $(INSTALL_DIR) $$(1)/usr/share/opensc
214 $(INSTALL_BIN) \
215 $(PKG_INSTALL_DIR)/usr/share/opensc/$(firstword $(subst :, ,$(1))).profile \
216 $$(1)/usr/share/opensc
217 endef
218 endef
219
220 $(foreach file,$(TOOLS),$(eval $(call ToolInstall,$(file))))
221 $(foreach file,$(PROFILES),$(eval $(call ProfileInstall,$(file))))
222
223 $(eval $(call BuildPackage,libopensc))
224 $(eval $(call BuildPackage,libopensc-pkcs11))
225 $(eval $(call BuildPackage,libpkcs11-spy))
226
227 $(eval $(call BuildPackage,opensc-utils))
228 $(foreach file,$(TOOLS),$(eval $(call BuildPackage,opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
229 $(foreach file,$(PROFILES),$(eval $(call BuildPackage,libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(file)))))))