Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.16.0
  10. PKG_RELEASE:=1
  11. PKG_MD5SUM:=3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
  12. PKG_LICENSE:=LGPL-2.1+
  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:=+libpcsclite
  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:=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)))))))