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.

227 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:=20141126
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=LGPL-2.1+
  12. PKG_LICENSE_FILES:=COPYING
  13. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  14. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  15. PKG_SOURCE_PROTO:=git
  16. PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC.git
  17. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  18. PKG_SOURCE_VERSION:=8aadbbd678730dbafb819382da553439887499fd
  19. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  20. PKG_BUILD_DEPENDS:=+libpcsclite
  21. PKG_FIXUP:=libtool
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/libopensc
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=OpenSC libraries for smart cards
  28. URL:=https://github.com/OpenSC/OpenSC/wiki
  29. DEPENDS:=+libopenssl +libpthread
  30. MENU:=1
  31. endef
  32. define Package/libopensc/description
  33. OpenSC provides a set of libraries and utilities to work with smart cards.
  34. Its main focus is on cards that support cryptographic operations, and
  35. facilitate their use in security applications such as authentication,
  36. mail encryption and digital signatures.
  37. endef
  38. define Package/libopensc-pkcs11
  39. SECTION:=libs
  40. CATEGORY:=Libraries
  41. TITLE:=OpenSC - PKCS11 provider
  42. URL:=https://github.com/OpenSC/OpenSC/wiki
  43. DEPENDS:=libopensc
  44. endef
  45. define Package/libopensc-pkcs11/description
  46. OpenSC PKCS#11 provider
  47. endef
  48. define Package/libpkcs11-spy
  49. SECTION:=libs
  50. CATEGORY:=Libraries
  51. TITLE:=PKCS11 spying wrapper
  52. URL:=https://github.com/OpenSC/OpenSC/wiki
  53. DEPENDS:=+libopenssl +libpthread
  54. endef
  55. define Package/libpkcs11-spy/dscription
  56. PKCS#11 spying wrapper
  57. endef
  58. define Package/opensc-utils
  59. SECTION:=utils
  60. CATEGORY:=Utilities
  61. TITLE:=OpenSC - tools for smart cards
  62. URL:=https://github.com/OpenSC/OpenSC/wiki
  63. DEPENDS:=+libopensc
  64. MENU:=1
  65. endef
  66. define Package/opensc-utils/description
  67. OpenSC utilities
  68. endef
  69. define ToolGen
  70. define Package/opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))
  71. TITLE:=$(firstword $(subst :, ,$(1))) utility from opensc
  72. URL:=https://github.com/OpenSC/OpenSC/wiki
  73. SECTION:=utils
  74. CATEGORY:=Utilities
  75. DEPENDS:=opensc-utils $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
  76. endef
  77. endef
  78. define ProfileGen
  79. define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))
  80. TITLE:=$(firstword $(subst :, ,$(1))) card profile for opensc
  81. URL:=https://github.com/OpenSC/OpenSC/wiki
  82. SECTION:=lib
  83. CATEGORY:=Libraries
  84. DEPENDS:=libopensc
  85. endef
  86. endef
  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.{a,so}* $(1)/usr/lib/
  139. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{a,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)))))))