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.

224 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. 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:=lib
  80. CATEGORY:=Libraries
  81. DEPENDS:=libopensc
  82. endef
  83. endef
  84. TOOLS:= \
  85. cardos-tool \
  86. cryptoflex-tool \
  87. dnie-tool \
  88. eidenv \
  89. iasecc-tool \
  90. netkey-tool \
  91. openpgp-tool \
  92. opensc-tool \
  93. opensc-explorer:+libncurses:+libreadline \
  94. piv-tool \
  95. pkcs11-tool \
  96. pkcs15-crypt \
  97. pkcs15-init \
  98. pkcs15-tool \
  99. sc-hsm-tool \
  100. westcos-tool
  101. PROFILES:= \
  102. asepcos \
  103. authentic \
  104. cardos \
  105. cyberflex \
  106. entersafe \
  107. epass2003 \
  108. flex \
  109. gpk \
  110. ias_adele_admin1 \
  111. ias_adele_admin2 \
  112. ias_adele_common \
  113. iasecc_admin_eid \
  114. iasecc_generic_oberthur \
  115. iasecc_generic_pki \
  116. iasecc \
  117. incrypto34 \
  118. jcop \
  119. miocos \
  120. muscle \
  121. myeid \
  122. oberthur \
  123. openpgp \
  124. pkcs15 \
  125. rutoken_ecp \
  126. rutoken \
  127. sc-hsm \
  128. setcos \
  129. starcos \
  130. westcos
  131. $(foreach file,$(TOOLS),$(eval $(call ToolGen,$(file))))
  132. $(foreach file,$(PROFILES),$(eval $(call ProfileGen,$(file))))
  133. define Build/InstallDev
  134. $(INSTALL_DIR) $(1)/usr/lib
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{a,so}* $(1)/usr/lib/
  136. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{a,so}* $(1)/usr/lib/
  137. $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
  139. $(INSTALL_DIR) $(1)/usr/lib/pkcs11
  140. $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
  141. $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
  142. $(INSTALL_DIR) $(1)/usr/share/opensc
  143. $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
  144. endef
  145. define Package/libopensc/install
  146. $(INSTALL_DIR) $(1)/usr/lib
  147. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.so* $(1)/usr/lib/
  148. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.so* $(1)/usr/lib/
  149. $(INSTALL_DIR) $(1)/etc
  150. $(CP) $(PKG_INSTALL_DIR)/etc/opensc.conf $(1)/etc/
  151. endef
  152. define Package/libopensc-pkcs11/install
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
  155. $(INSTALL_DIR) $(1)/usr/lib/pkcs11
  156. $(LN) ../opensc-pkcs11.so $(1)/usr/lib/pkcs11/
  157. endef
  158. define Package/libpkcs11-spy/install
  159. $(INSTALL_DIR) $(1)/usr/lib
  160. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
  161. $(INSTALL_DIR) $(1)/usr/lib/pkcs11
  162. $(LN) ../pkcs11-spy.so $(1)/usr/lib/pkcs11/
  163. endef
  164. define Package/opensc-card-profiles
  165. $(INSTALL_DIR) $(1)/usr/share/opensc
  166. $(CP) $(PKG_INSTALL_DIR)/usr/share/opensc/* $(1)/usr/share/opensc/
  167. endef
  168. define Package/opensc-utils/install
  169. true
  170. endef
  171. define ToolInstall
  172. define Package/opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
  173. $(INSTALL_DIR) $$(1)/usr/bin
  174. $(INSTALL_BIN) \
  175. $(PKG_INSTALL_DIR)/usr/bin/$(firstword $(subst :, ,$(1))) \
  176. $$(1)/usr/bin/
  177. endef
  178. endef
  179. define ProfileInstall
  180. define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
  181. $(INSTALL_DIR) $$(1)/usr/share/opensc
  182. $(INSTALL_BIN) \
  183. $(PKG_INSTALL_DIR)/usr/share/opensc/$(firstword $(subst :, ,$(1))).profile \
  184. $$(1)/usr/share/opensc
  185. endef
  186. endef
  187. $(foreach file,$(TOOLS),$(eval $(call ToolInstall,$(file))))
  188. $(foreach file,$(PROFILES),$(eval $(call ProfileInstall,$(file))))
  189. $(eval $(call BuildPackage,libopensc))
  190. $(eval $(call BuildPackage,libopensc-pkcs11))
  191. $(eval $(call BuildPackage,libpkcs11-spy))
  192. $(eval $(call BuildPackage,opensc-utils))
  193. $(foreach file,$(TOOLS),$(eval $(call BuildPackage,opensc-utils-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
  194. $(foreach file,$(PROFILES),$(eval $(call BuildPackage,libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(file)))))))