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.

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