From bb34d6c7dc7177c17c9e4ec8f650fbd3cd413c74 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 20 Jun 2014 18:26:33 +0200 Subject: [PATCH] Added opensc tools and libraries Signed-off-by: Nikos Mavrogiannopoulos --- libs/opensc/Makefile | 72 +++++++++++++++++++++++++++++++++ libs/opensc/files/opensc.module | 1 + 2 files changed, 73 insertions(+) create mode 100644 libs/opensc/Makefile create mode 100644 libs/opensc/files/opensc.module diff --git a/libs/opensc/Makefile b/libs/opensc/Makefile new file mode 100644 index 0000000000..f3a56f7448 --- /dev/null +++ b/libs/opensc/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2005-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=OpenSC +PKG_VERSION:=0.13.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC/archive/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_MD5SUM:=92ed0041be8e5c53aa48c371b090b6cd + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/OpenSC + SECTION:=libs + CATEGORY:=Libraries + TITLE:=tools and libraries for smart cards + URL:=https://github.com/OpenSC/OpenSC/wiki + DEPENDS+= +libpcsclite +libopenssl +pcscd +endef + +define Package/OpenSC/description + OpenSC provides a set of libraries and utilities to work with smart cards. + Its main focus is on cards that support cryptographic operations, and facilitate + their use in security applications such as authentication, mail encryption and + digital signatures. OpenSC implements the PKCS11 API so applications supporting + this API (such as Mozilla Firefox and Thunderbird) can use it. On the card OpenSC + implements the PKCS15 standard and aims to be compatible with every software/card + that does so, too. +endef + +CONFIGURE_ARGS += \ + --disable-assert \ + --enable-pcsc \ + --enable-sm \ + --disable-zlib \ + --with-pcsc-provider=libpcsclite.so.1 + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{a,so*} $(1)/usr/lib/ +endef + +define Package/OpenSC/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/opensc-tool $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/pkcs15-tool $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/pkcs15-init $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.so.* $(1)/usr/lib/ +ifeq ($(CONFIG_PACKAGE_p11-kit),) + $(INSTALL_DIR) $(1)/etc/p11-kit/modules/ + $(CP) \ + ./files/opensc.module \ + $(1)/etc/p11-kit/modules/ +endif +endef + +$(eval $(call BuildPackage,OpenSC)) diff --git a/libs/opensc/files/opensc.module b/libs/opensc/files/opensc.module new file mode 100644 index 0000000000..fd1c1d9ae8 --- /dev/null +++ b/libs/opensc/files/opensc.module @@ -0,0 +1 @@ +module: opensc-pkcs11.so