summaryrefslogtreecommitdiff
path: root/dev-libs/opensc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-libs/opensc
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-libs/opensc')
-rw-r--r--dev-libs/opensc/Manifest10
-rw-r--r--dev-libs/opensc/files/opensc-0.17.0-build.patch100
-rw-r--r--dev-libs/opensc/files/opensc-0.18.0-build.patch32
-rw-r--r--dev-libs/opensc/files/opensc-0.18.0-libressl.patch79
-rw-r--r--dev-libs/opensc/metadata.xml28
-rw-r--r--dev-libs/opensc/opensc-0.16.0.ebuild55
-rw-r--r--dev-libs/opensc/opensc-0.17.0.ebuild60
-rw-r--r--dev-libs/opensc/opensc-0.18.0.ebuild61
8 files changed, 425 insertions, 0 deletions
diff --git a/dev-libs/opensc/Manifest b/dev-libs/opensc/Manifest
new file mode 100644
index 000000000000..44f172abd15f
--- /dev/null
+++ b/dev-libs/opensc/Manifest
@@ -0,0 +1,10 @@
+AUX opensc-0.17.0-build.patch 3577 BLAKE2B 0ad69e4305a21d613f93e76818d442983b1b1b642ba8e5c7030e44c96d4e86ed03f72c7623ba6b08ef9b620f6a5c5f43ea00a670880f070c165cb1f60235c529 SHA512 0412a0d0ee3caca534098357e7778f2aa6800ef6d8d559614cd892de13c6dd05d3a6f78dc12cdf834ab6a4c0160234342b46efda0ac844e2411f54aa08a94016
+AUX opensc-0.18.0-build.patch 788 BLAKE2B 809f109bfde3f40929d5e487c5f766210d1520bff0d857219d226b7d67a3301c9ba5f10b9e54409e75174a170501654a276bce97556bab8a2819980971ca03f8 SHA512 f1f74ef670826901d0302119fc914b7cd82295573d2f2e7b4e2121c81bd58a148021287bb544053dc1eeaf7f056db25b51603ec9bab3b4c27f692eb49214f36e
+AUX opensc-0.18.0-libressl.patch 3145 BLAKE2B 2e1c0c789adf7c21db1cfd4ab2bf0ba077a463f74ee5bc3293278260b5531cfb231f70d594c491fdaaad0d09f4e7107804f3937d316816ea62eb0e6956ac1c6e SHA512 fedb3906104c02d08d5c44a0da49764556e19653a9d52a3e1ddc5254a2f13abee92b23fc3101779bdc6b9c623388ec9242f198402c022505dffc7e932d1b0dfe
+DIST opensc-0.16.0.tar.gz 1760418 BLAKE2B 7f5799445e285010392f315fa57919c7f0b038170a19e83dbda664d5d73898f075cccad4304275402c900b9fc50564ed5515a10d31156a6c76a68f170ca3e439 SHA512 15f7d62388dde6dad226acab3cd54f8e2f2f53684dc0cb976c6fc6fbdb4487be931ca69bf965ab07c51efd16be64d5411f10bacea11a07fc823c92dd7bb25139
+DIST opensc-0.17.0.tar.gz 1950547 BLAKE2B 861dbb60e211d503332228c9d75d667f70cb9e15883c571821bb2f7703ca62dd4ce56c5ea7965e2d5e8c6a81b5063fc689013670294426baf1bfaec88282e20e SHA512 8991c1724d187d3c34a2ed591b21f0085f767c0d866edc2decfda85a2b3dedf717838f4937d1dda3e1bbc17f02e6eca6740299660128bc448a29e8bfc2962922
+DIST opensc-0.18.0.tar.gz 2037073 BLAKE2B f2b339d1f9c616f6f706acb3c55289deb5b1749a8b5561142c69db4ed1c7dee554ce1f8d820e6e69bb9e462ca460379badf3017ed35fa6cd395702c995326c3e SHA512 dc90cff3e0e639c14bfb11d1d0455964d24d08aa27728592ab0d8b487a1ffee1ca71cb9bbf5d0f101b2ebd85cf9478988f686d45effa72315e6ffc843d398768
+EBUILD opensc-0.16.0.ebuild 1390 BLAKE2B 14cd6dacb0ebc6d688ac0c0c6628cf11cb10337e13cf390a72d83bd755a589f8b8a61e4961a66b4de0b479e39f43ae30725dddd91aea27e33242cab1955de7ca SHA512 ab05e282f226d4c194b292330cdd132c23e92abff34aa8acdb75b3e2e97d5c1dad29089fe79f8e48d0ba93ed4150c7a287a497da20322ec9f44e8c6850230b4e
+EBUILD opensc-0.17.0.ebuild 1467 BLAKE2B 87f9b57bfeedd29319951e7e88e96f67dbdb6517ecef4a185f6f61c396a1943b7967b2e6ac9080dfc4f54b6bcf017c81169702a0e6b035eec6f4bd40a3f34f42 SHA512 50b49c15558621c22addc53dd2ed3b5379e1c185b098c1b4caee9a3af8557f87dc1de3c0d4f6d8c6ae8c73399caf7780aa2a984ff1f64d30814eb2082c8792d4
+EBUILD opensc-0.18.0.ebuild 1502 BLAKE2B 7ab09ea688fcb9f3d1b138546558eafb6fd65fcb5678cbb97e3e08c359ea43d004af773668877d1922494b738a064afe0f9b2230ca0d70a8f4e05198b04dd4ad SHA512 886c333f75a7827779c14606106afa8d95031d2f46eaf97d91aeec383fdda85f1181da26bb25025531a43a6ffc17641a4a4a273c3a24f56790fa18ee14cfa13e
+MISC metadata.xml 1164 BLAKE2B d512f5bb01592e7f864a09e7d537a94e89ac2226be34fa999d746701e3b0b9fc8495700f5dc6ec1c866ec9f2fa59ed23d737de53204e4cbc401eca176d1a8ac6 SHA512 eae0e3d7c795c452f65730138d867bff881778d9615b1cea1aba362d374e4d8ae8949d01204ce14bb8ea80021ca3328cb2657f3e25b95b93a7848e76f577c761
diff --git a/dev-libs/opensc/files/opensc-0.17.0-build.patch b/dev-libs/opensc/files/opensc-0.17.0-build.patch
new file mode 100644
index 000000000000..8a51d7ac4450
--- /dev/null
+++ b/dev-libs/opensc/files/opensc-0.17.0-build.patch
@@ -0,0 +1,100 @@
+From 65b302e33b710833d4d14bf8eaf00acdaa436c39 Mon Sep 17 00:00:00 2001
+From: Frank Morgner <frankmorgner@gmail.com>
+Date: Wed, 19 Jul 2017 00:09:36 +0200
+Subject: [PATCH] sc-hsm: fixed building with --disable-sm
+
+Closes https://github.com/OpenSC/OpenSC/pull/1103
+---
+ src/libopensc/card-sc-hsm.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c
+index cfa084a06..1f61e0138 100644
+--- a/src/libopensc/card-sc-hsm.c
++++ b/src/libopensc/card-sc-hsm.c
+@@ -284,7 +284,9 @@ static int sc_hsm_soc_select_minbioclient(sc_card_t *card)
+ };
+
+ /* Select MinBioClient */
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xA4, 0x04, 0x0C);
+ apdu.data = minBioClient_aid.value;
+ apdu.datalen = minBioClient_aid.len;
+@@ -533,7 +535,9 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
+ sc_apdu_t apdu;
+ u8 cmdbuff[16];
++#ifdef ENABLE_SM
+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
++#endif
+ int r;
+ int cmd = data->cmd;
+ size_t pin2_len = data->pin2.len;
+@@ -563,7 +567,10 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ if ((card->type == SC_CARD_TYPE_SC_HSM_SOC || card->reader->uid.len
+ || cmd == SC_PIN_CMD_GET_SESSION_PIN)
+ && (data->cmd != SC_PIN_CMD_GET_INFO)
+- && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) {
++#ifdef ENABLE_SM
++ && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT
++#endif
++ ) {
+ LOG_TEST_RET(card->ctx,
+ sc_hsm_perform_chip_authentication(card),
+ "Could not perform chip authentication");
+@@ -604,6 +611,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ data->apdu = &apdu;
+ }
+
++#ifdef ENABLE_SM
+ if ((data->cmd == SC_PIN_CMD_GET_INFO)
+ && (card->sm_ctx.sm_mode == SM_MODE_TRANSMIT)) {
+ /* JCOP's SM accelerator is incapable of using case 1 APDU in SM */
+@@ -612,6 +620,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ apdu.resplen = sizeof rbuf;
+ data->apdu = &apdu;
+ }
++#endif
+
+ data->pin1.offset = 5;
+ data->pin1.length_offset = 4;
+@@ -627,11 +636,17 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ data->cmd = SC_PIN_CMD_GET_SESSION_PIN;
+ if (data->pin_reference == 0x81) {
+ u8 recvbuf[SC_MAX_APDU_BUFFER_SIZE];
++#ifdef ENABLE_SM
+ if (card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) {
+ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL,
+ "Session PIN generation only supported in SM");
+ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+ }
++#else
++ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL,
++ "Session PIN generation only supported in SM");
++ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
++#endif
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0x5A, 0x01, data->pin_reference);
+ apdu.cla = 0x80;
+ apdu.resp = recvbuf;
+@@ -669,7 +684,9 @@ static int sc_hsm_logout(sc_card_t * card)
+ sc_path_t path;
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
+ memset(priv->sopin, 0, sizeof(priv->sopin));
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+
+ sc_path_set(&path, SC_PATH_TYPE_DF_NAME, sc_hsm_aid.value, sc_hsm_aid.len, 0, 0);
+
+@@ -1586,7 +1603,9 @@ static int sc_hsm_init(struct sc_card *card)
+ static int sc_hsm_finish(sc_card_t * card)
+ {
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+ if (priv->serialno) {
+ free(priv->serialno);
+ }
diff --git a/dev-libs/opensc/files/opensc-0.18.0-build.patch b/dev-libs/opensc/files/opensc-0.18.0-build.patch
new file mode 100644
index 000000000000..2bea2e53d595
--- /dev/null
+++ b/dev-libs/opensc/files/opensc-0.18.0-build.patch
@@ -0,0 +1,32 @@
+From 1f1de5ae9a43e845431dc43af96ec61e910ad789 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Wed, 16 May 2018 21:30:15 +0300
+Subject: [PATCH] build: fix --disable-sm
+
+---
+ src/libopensc/card-sc-hsm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c
+index e2af52b9..a609f612 100644
+--- a/src/libopensc/card-sc-hsm.c
++++ b/src/libopensc/card-sc-hsm.c
+@@ -451,6 +451,7 @@ static int sc_hsm_soc_biomatch(sc_card_t *card, struct sc_pin_cmd_data *data,
+
+
+
++#ifdef ENABLE_SM
+ #ifdef ENABLE_OPENPACE
+ #include "sm/sm-eac.h"
+ #include <eac/cv_cert.h>
+@@ -573,6 +574,7 @@ static int sc_hsm_perform_chip_authentication(sc_card_t *card)
+ return SC_ERROR_NOT_SUPPORTED;
+ }
+ #endif
++#endif
+
+
+
+--
+2.16.1
+
diff --git a/dev-libs/opensc/files/opensc-0.18.0-libressl.patch b/dev-libs/opensc/files/opensc-0.18.0-libressl.patch
new file mode 100644
index 000000000000..f6f3d772e071
--- /dev/null
+++ b/dev-libs/opensc/files/opensc-0.18.0-libressl.patch
@@ -0,0 +1,79 @@
+From 226cd96bfd384a40b3ab6b6dafb97f6e399524f4 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Fri, 22 Jun 2018 22:21:03 +0300
+Subject: [PATCH] build: support >=libressl-2.7
+
+https://github.com/OpenSC/OpenSC/pull/1406
+
+---
+ src/libopensc/sc-ossl-compat.h | 19 +++++++++++++------
+ src/tools/sc-hsm-tool.c | 2 +-
+ 2 files changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/src/libopensc/sc-ossl-compat.h b/src/libopensc/sc-ossl-compat.h
+index a94d9564..d9e087a3 100644
+--- a/src/libopensc/sc-ossl-compat.h
++++ b/src/libopensc/sc-ossl-compat.h
+@@ -90,17 +90,24 @@ extern "C" {
+
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define RSA_PKCS1_OpenSSL RSA_PKCS1_SSLeay
+-#define OPENSSL_malloc_init CRYPTO_malloc_init
+
+-#define EVP_PKEY_get0_RSA(x) (x->pkey.rsa)
+-#define EVP_PKEY_get0_DSA(x) (x->pkey.dsa)
+ #define X509_get_extension_flags(x) (x->ex_flags)
+ #define X509_get_key_usage(x) (x->ex_kusage)
+ #define X509_get_extended_key_usage(x) (x->ex_xkusage)
+-#define EVP_PKEY_up_ref(user_key) CRYPTO_add(&user_key->references, 1, CRYPTO_LOCK_EVP_PKEY)
+ #if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2050300fL
+ #define X509_up_ref(cert) CRYPTO_add(&cert->references, 1, CRYPTO_LOCK_X509)
+ #endif
++#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x20700000L
++#define OPENSSL_malloc_init CRYPTO_malloc_init
++#define EVP_PKEY_get0_RSA(x) (x->pkey.rsa)
++#define EVP_PKEY_get0_DSA(x) (x->pkey.dsa)
++#define EVP_PKEY_up_ref(user_key) CRYPTO_add(&user_key->references, 1, CRYPTO_LOCK_EVP_PKEY)
++#endif
++#endif
++
++/* workaround unused value warning for a macro that does nothing */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L
++#define OPENSSL_malloc_init()
+ #endif
+
+ /*
+@@ -110,7 +117,7 @@ extern "C" {
+ * If that is not good enough, versions could be added to libopensc
+ */
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ /* based on OpenSSL-1.1.0 e_os2.h */
+ /* sc_ossl_inline: portable inline definition usable in public headers */
+ # if !defined(inline) && !defined(__cplusplus)
+@@ -129,7 +136,7 @@ extern "C" {
+ # endif
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2050300fL)
+
+ #define RSA_bits(R) (BN_num_bits(R->n))
+
+diff --git a/src/tools/sc-hsm-tool.c b/src/tools/sc-hsm-tool.c
+index 823eb217..307bad25 100644
+--- a/src/tools/sc-hsm-tool.c
++++ b/src/tools/sc-hsm-tool.c
+@@ -1761,7 +1761,7 @@ int main(int argc, char *argv[])
+ }
+ }
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L)
+ OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS
+ | OPENSSL_INIT_ADD_ALL_CIPHERS
+ | OPENSSL_INIT_ADD_ALL_DIGESTS,
+--
+2.16.4
+
diff --git a/dev-libs/opensc/metadata.xml b/dev-libs/opensc/metadata.xml
new file mode 100644
index 000000000000..52bf7f8f7bb9
--- /dev/null
+++ b/dev-libs/opensc/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+ </maintainer>
+ <longdescription>
+ OpenSC is a library for accessing SmartCard devices. It is also
+ the core library of the OpenSC project.
+
+ Basic functionality (e.g. SELECT FILE, READ BINARY) should work on
+ any ISO 7816-4 compatible SmartCard. Encryption and decryption
+ using private keys on the SmartCard is possible with PKCS #15
+ compatible cards, such as the FINEID (Finnish Electronic IDentity)
+ card.
+ </longdescription>
+ <use>
+ <flag name="openct">Use <pkg>dev-libs/openct</pkg> (and CT-API) for accessing Smartcard hardware</flag>
+ <flag name="ctapi">Use CT-API for accessing Smartcard hardware</flag>
+ <flag name="pcsc-lite">Use <pkg>sys-apps/pcsc-lite</pkg> (and PC/SC API) for accessing Smartcard hardware</flag>
+ <flag name="secure-messaging">Enable secure messaging</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">OpenSC/OpenSC</remote-id>
+ <remote-id type="sourceforge">opensc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-libs/opensc/opensc-0.16.0.ebuild b/dev-libs/opensc/opensc-0.16.0.ebuild
new file mode 100644
index 000000000000..df55b1ce24bc
--- /dev/null
+++ b/dev-libs/opensc/opensc-0.16.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit ltprune
+
+DESCRIPTION="Libraries and applications to access smartcards"
+HOMEPAGE="https://github.com/OpenSC/OpenSC/wiki"
+SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="doc +pcsc-lite secure-messaging openct ctapi readline libressl ssl zlib"
+
+RDEPEND="zlib? ( sys-libs/zlib )
+ readline? ( sys-libs/readline:0= )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ openct? ( >=dev-libs/openct-0.5.0 )
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+
+REQUIRED_USE="
+ pcsc-lite? ( !openct !ctapi )
+ openct? ( !pcsc-lite !ctapi )
+ ctapi? ( !pcsc-lite !openct )
+ || ( pcsc-lite openct ctapi )"
+
+src_configure() {
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --htmldir='$(docdir)/html' \
+ --disable-static \
+ $(use_enable doc) \
+ $(use_enable openct) \
+ $(use_enable readline) \
+ $(use_enable zlib) \
+ $(use_enable secure-messaging sm) \
+ $(use_enable ssl openssl) \
+ $(use_enable pcsc-lite pcsc) \
+ $(use_enable openct) \
+ $(use_enable ctapi)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/dev-libs/opensc/opensc-0.17.0.ebuild b/dev-libs/opensc/opensc-0.17.0.ebuild
new file mode 100644
index 000000000000..0612c40f2bb0
--- /dev/null
+++ b/dev-libs/opensc/opensc-0.17.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit ltprune
+
+DESCRIPTION="Libraries and applications to access smartcards"
+HOMEPAGE="https://github.com/OpenSC/OpenSC/wiki"
+SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="doc +pcsc-lite secure-messaging openct ctapi readline libressl ssl zlib"
+
+RDEPEND="zlib? ( sys-libs/zlib )
+ readline? ( sys-libs/readline:0= )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ openct? ( >=dev-libs/openct-0.5.0 )
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+
+REQUIRED_USE="
+ pcsc-lite? ( !openct !ctapi )
+ openct? ( !pcsc-lite !ctapi )
+ ctapi? ( !pcsc-lite !openct )
+ || ( pcsc-lite openct ctapi )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+)
+
+src_configure() {
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --htmldir='$(docdir)/html' \
+ --disable-static \
+ --disable-openpace \
+ $(use_enable doc) \
+ $(use_enable openct) \
+ $(use_enable readline) \
+ $(use_enable zlib) \
+ $(use_enable secure-messaging sm) \
+ $(use_enable ssl openssl) \
+ $(use_enable pcsc-lite pcsc) \
+ $(use_enable openct) \
+ $(use_enable ctapi)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/dev-libs/opensc/opensc-0.18.0.ebuild b/dev-libs/opensc/opensc-0.18.0.ebuild
new file mode 100644
index 000000000000..784b2c5735ce
--- /dev/null
+++ b/dev-libs/opensc/opensc-0.18.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit ltprune
+
+DESCRIPTION="Libraries and applications to access smartcards"
+HOMEPAGE="https://github.com/OpenSC/OpenSC/wiki"
+SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="doc +pcsc-lite secure-messaging openct ctapi readline libressl ssl zlib"
+
+RDEPEND="zlib? ( sys-libs/zlib )
+ readline? ( sys-libs/readline:0= )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ openct? ( >=dev-libs/openct-0.5.0 )
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+
+REQUIRED_USE="
+ pcsc-lite? ( !openct !ctapi )
+ openct? ( !pcsc-lite !ctapi )
+ ctapi? ( !pcsc-lite !openct )
+ || ( pcsc-lite openct ctapi )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+ "${FILESDIR}/${P}-libressl.patch"
+)
+
+src_configure() {
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --htmldir='$(docdir)/html' \
+ --disable-static \
+ --disable-openpace \
+ $(use_enable doc) \
+ $(use_enable openct) \
+ $(use_enable readline) \
+ $(use_enable zlib) \
+ $(use_enable secure-messaging sm) \
+ $(use_enable ssl openssl) \
+ $(use_enable pcsc-lite pcsc) \
+ $(use_enable openct) \
+ $(use_enable ctapi)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}