public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/opencryptoki/
Date: Sun, 11 Apr 2021 19:48:08 +0000 (UTC)	[thread overview]
Message-ID: <1618169421.2d4d861149374fc302f73d3cf91835656d85ae70.conikost@gentoo> (raw)

commit:     2d4d861149374fc302f73d3cf91835656d85ae70
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 11 19:30:21 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Apr 11 19:30:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d4d8611

dev-libs/opencryptoki: migrate to GLEP 81

Closes: https://bugs.gentoo.org/781563
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-libs/opencryptoki/opencryptoki-3.6.1-r1.ebuild | 102 +++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/dev-libs/opencryptoki/opencryptoki-3.6.1-r1.ebuild b/dev-libs/opencryptoki/opencryptoki-3.6.1-r1.ebuild
new file mode 100644
index 00000000000..a391a24d3fa
--- /dev/null
+++ b/dev-libs/opencryptoki/opencryptoki-3.6.1-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="PKCS#11 provider cryptographic hardware"
+HOMEPAGE="https://sourceforge.net/projects/opencryptoki"
+SRC_URI="mirror://sourceforge/opencryptoki/${PV}/${P}.tgz"
+S="${WORKDIR}/${PN}"
+
+# Upstream is looking into relicensing it into CPL-1.0 entirely; the CCA
+# token sources are under CPL-1.0 already.
+LICENSE="CPL-0.5"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~s390 ~x86"
+IUSE="debug libressl +tpm"
+
+DEPEND="
+	tpm? ( app-crypt/trousers )
+	!libressl? ( >=dev-libs/openssl-1.1.0:0= )
+	libressl? ( >=dev-libs/libressl-2.7.0:0= )
+"
+RDEPEND="
+	${DEPEND}
+	acct-group/pkcs11
+"
+
+DOCS=(
+	README AUTHORS FAQ TODO
+	doc/openCryptoki-HOWTO.pdf
+)
+
+# tests right now basically don't exist; the only available thing would
+# test against an installed copy and would kill a running pcscd, all
+# things that we're not interested to.
+RESTRICT=test
+
+src_prepare() {
+	default
+	mv configure.in configure.ac || die
+	eautoreconf
+}
+
+src_configure() {
+	# package uses ${localstatedir}/lib as the default path, so if we
+	# leave it to econf, it'll create /var/lib/lib.
+
+	# Since upstream by default seem to enable any possible token, even
+	# when they don't seem to be used, we limit ourselves to the
+	# software emulation token (swtok) and if the user enabled the tpm
+	# USE flag, tpmtok.  The rest of the tokens seem to be hardware- or
+	# software-dependent even when they build fine without their
+	# requirements, but until somebody asks for those, I'd rather not
+	# enable them.
+
+	# We don't use --enable-debug because that tinkers with the CFLAGS
+	# and we don't want that. Instead we append -DDEBUG which enables
+	# debug information.
+	use debug && append-flags -DDEBUG
+
+	econf \
+		--localstatedir=/var \
+		--enable-fast-install \
+		--disable-debug \
+		--enable-daemon \
+		--enable-library \
+		--disable-icatok \
+		--enable-swtok \
+		$(use_enable tpm tpmtok) \
+		--disable-ccatok
+}
+
+src_install() {
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+
+	# Install libopencryptoki in the standard directory for libraries.
+	mv "${ED}"/usr/$(get_libdir)/opencryptoki/libopencryptoki.so* "${ED}"/usr/$(get_libdir) || die
+	rm "${ED}"/usr/$(get_libdir)/pkcs11/libopencryptoki.so || die
+	dosym ../libopencryptoki.so /usr/$(get_libdir)/pkcs11/libopencryptoki.so
+
+	# Remove compatibility symlinks as we _never_ required those and
+	# they seem unused even upstream.
+	find "${ED}" -name 'PKCS11_*' -delete || die
+
+	# We replace their ld.so and init files (mostly designed for RedHat
+	# as far as I can tell) with our own replacements.
+	rm -rf "${ED}"/etc/ld.so.conf.d "${ED}"/etc/rc.d || die
+
+	# make sure that we don't modify the init script if the USE flags
+	# are enabled for the needed services.
+	cp "${FILESDIR}"/pkcsslotd.init.2 "${T}"/pkcsslotd.init || die
+	use tpm || sed -i -e '/use tcsd/d' "${T}"/pkcsslotd.init
+	newinitd "${T}/pkcsslotd.init" pkcsslotd
+
+	# We create /var dirs at runtime as needed, so don't bother installing
+	# our own.
+	rm -r "${ED}"/var/{lib,lock} || die
+}


             reply	other threads:[~2021-04-11 19:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 19:48 Conrad Kostecki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-05-01  7:29 [gentoo-commits] repo/gentoo:master commit in: dev-libs/opencryptoki/ Mikle Kolyada
2021-04-11 19:48 Conrad Kostecki
2021-04-03 23:07 Sam James
2021-03-16 19:23 Sam James
2019-07-26 22:21 Aaron Bauman
2019-02-16 18:19 Alon Bar-Lev
2018-09-27 23:55 Alon Bar-Lev
2018-06-18 20:53 Mikle Kolyada
2017-03-25 18:11 Alon Bar-Lev
2016-06-26  0:09 Anthony G. Basile
2016-06-12 13:41 Alon Bar-Lev
2015-12-23 13:50 Alon Bar-Lev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618169421.2d4d861149374fc302f73d3cf91835656d85ae70.conikost@gentoo \
    --to=conikost@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox