You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
5.8 KiB

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