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