summaryrefslogtreecommitdiff
path: root/dev-python/python-pkcs11
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-03-06 15:14:59 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-03-06 15:14:59 +0000
commitfde3b5bbeb07fb00d002d7686ba1fb259a5e5184 (patch)
treec7c2fa1cc942119d9d1f9fc9db5b4c2f15e8fea9 /dev-python/python-pkcs11
parent7be16c0e5ac01853add3329935dacfdaa10b62e9 (diff)
downloadbaldeagleos-repo-fde3b5bbeb07fb00d002d7686ba1fb259a5e5184.tar.gz
baldeagleos-repo-fde3b5bbeb07fb00d002d7686ba1fb259a5e5184.tar.xz
baldeagleos-repo-fde3b5bbeb07fb00d002d7686ba1fb259a5e5184.zip
Adding metadata
Diffstat (limited to 'dev-python/python-pkcs11')
-rw-r--r--dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild40
-rw-r--r--dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild65
2 files changed, 65 insertions, 40 deletions
diff --git a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild
deleted file mode 100644
index 37ff26eb8440..000000000000
--- a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DOCS_BUILDER="sphinx"
-DOCS_DIR="${S}/docs"
-DOCS_DEPEND="dev-python/sphinx-rtd-theme"
-PYTHON_COMPAT=( python3_{7,8,9,10,11} )
-
-inherit distutils-r1 docs
-
-DESCRIPTION="PKCS#11 (Cryptoki) support for Python"
-HOMEPAGE="
- https://github.com/danni/python-pkcs11
- https://pypi.org/project/python-pkcs11/
-"
-SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-#hardware device needed for tests
-RESTRICT="test"
-
-RDEPEND="
- >=dev-python/asn1crypto-1.0.0[${PYTHON_USEDEP}]
- dev-python/cached-property[${PYTHON_USEDEP}]
-"
-DEPEND="
- ${RDEPEND}
- dev-python/cython[${PYTHON_USEDEP}]
- test? (
- dev-python/cryptography[${PYTHON_USEDEP}]
- dev-python/oscrypto[${PYTHON_USEDEP}]
- dev-python/parameterized[${PYTHON_USEDEP}]
- )
-"
-
-distutils_enable_tests pytest
diff --git a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild
new file mode 100644
index 000000000000..8cd2e866e583
--- /dev/null
+++ b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{7,8,9,10,11} )
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+inherit edo distutils-r1 pypi
+
+DESCRIPTION="PKCS#11 (Cryptoki) support for Python"
+HOMEPAGE="
+ https://pypi.org/project/python-pkcs11/
+ https://github.com/danni/python-pkcs11
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ >=dev-python/asn1crypto-1.0.0[${PYTHON_USEDEP}]
+ dev-python/cached-property[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ dev-python/cython[${PYTHON_USEDEP}]
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+ test? (
+ dev-libs/openssl
+ dev-libs/softhsm
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ dev-python/oscrypto[${PYTHON_USEDEP}]
+ dev-python/parameterized[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+distutils_enable_sphinx docs
+
+python_test() {
+ cd "${S}" || die
+ epytest
+}
+
+src_test() {
+ local -x PKCS11_MODULE="${BROOT}/usr/$(get_libdir)/softhsm/libsofthsm2.so"
+ local -x PKCS11_TOKEN_LABEL="TEST"
+ local -x PKCS11_TOKEN_PIN="1234"
+ local -x PKCS11_TOKEN_SO_PIN="5678"
+
+ mkdir -p "${HOME}/.config/softhsm2" || die
+ cat > "${HOME}/.config/softhsm2/softhsm2.conf" <<- EOF || die "Failed to create config"
+ directories.tokendir = ${T}
+ objectstore.backend = file
+ EOF
+
+ edo softhsm2-util --init-token --free \
+ --label ${PKCS11_TOKEN_LABEL} \
+ --pin ${PKCS11_TOKEN_PIN} \
+ --so-pin ${PKCS11_TOKEN_SO_PIN}
+
+ rm -r pkcs11 || die
+ distutils-r1_src_test
+}