Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-auth/ssh-ldap-pubkey/, sys-auth/ssh-ldap-pubkey/files/
Date: Wed, 02 Jun 2021 16:15:08
Message-Id: 1622650500.4e071c4943bc0240977d7499caac736bf209aa3c.whissi@gentoo
1 commit: 4e071c4943bc0240977d7499caac736bf209aa3c
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 2 15:20:10 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 2 16:15:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e071c49
7
8 sys-auth/ssh-ldap-pubkey: bump to v1.3.3
9
10 Package-Manager: Portage-3.0.19, Repoman-3.0.3
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-auth/ssh-ldap-pubkey/Manifest | 1 +
14 .../files/ssh-ldap-pubkey-1.3.3-python3.9.patch | 34 ++++++++++
15 .../ssh-ldap-pubkey/ssh-ldap-pubkey-1.3.3.ebuild | 73 ++++++++++++++++++++++
16 3 files changed, 108 insertions(+)
17
18 diff --git a/sys-auth/ssh-ldap-pubkey/Manifest b/sys-auth/ssh-ldap-pubkey/Manifest
19 index d9319450c0c..e7fba398136 100644
20 --- a/sys-auth/ssh-ldap-pubkey/Manifest
21 +++ b/sys-auth/ssh-ldap-pubkey/Manifest
22 @@ -1 +1,2 @@
23 DIST ssh-ldap-pubkey-1.3.2.tar.gz 15311 BLAKE2B a8119b9808de556184c7f88c86b657d5d342e476b27cf53d92f37b8e9d3db69182b55c62a636bec6624c5d1aa2a90e3a04a22ce5ee8020ada27582b1ac6eefa3 SHA512 8475715151f331017850c094a50bd285574533fa6266341effc83f758ca30af9b9c24b54fce8c3eac5441c5cf18b0d7aa91bb04829b71efc4b8dcacba3642415
24 +DIST ssh-ldap-pubkey-1.3.3.tar.gz 15389 BLAKE2B 24c741646e33cf7af400053eff17efa35b96ec418d1c2b8c370a371dde51fdbbb3af3423f0cc4374f61b302f9836601444ee72613388fa2d4445957f918d64f9 SHA512 b52d4de3e0704817e8ea0fb316c21646da1bac74ed226812c03f9ee5ae449a86e5ef4c679633d212db05382e216b254a185e29d4a2244318ad5de288b909254a
25
26 diff --git a/sys-auth/ssh-ldap-pubkey/files/ssh-ldap-pubkey-1.3.3-python3.9.patch b/sys-auth/ssh-ldap-pubkey/files/ssh-ldap-pubkey-1.3.3-python3.9.patch
27 new file mode 100644
28 index 00000000000..b646603a134
29 --- /dev/null
30 +++ b/sys-auth/ssh-ldap-pubkey/files/ssh-ldap-pubkey-1.3.3-python3.9.patch
31 @@ -0,0 +1,34 @@
32 +commit 56b4b77bfa2b063b3f3686b54d8e39f6bce1d2a0
33 +Author: Thomas Deutschmann <whissi@××××××.de>
34 +AuthorDate: Wed Jun 2 17:40:06 2021 +0200
35 +Commit: Thomas Deutschmann <whissi@××××××.de>
36 +CommitDate: Wed Jun 2 18:01:16 2021 +0200
37 +
38 + Use decodebytes instead of decodestring in Python 3.9
39 +
40 + base64.decodestring(), alias deprecated since Python 3.1, has been removed
41 + in Python 3.9 in favor of new base64.decodebytes() function [Link 1].
42 +
43 + Link 1: https://docs.python.org/3.9/whatsnew/3.9.html#removed
44 + Closes: https://github.com/jirutka/ssh-ldap-pubkey/issues/49
45 +
46 +diff --git a/ssh_ldap_pubkey/__init__.py b/ssh_ldap_pubkey/__init__.py
47 +index 5da2ade..d80b335 100644
48 +--- a/ssh_ldap_pubkey/__init__.py
49 ++++ b/ssh_ldap_pubkey/__init__.py
50 +@@ -39,8 +39,14 @@ def is_valid_openssh_pubkey(pubkey):
51 + key_type, data64 = map(_encode, pubkey.split()[0:2])
52 + except (ValueError, AttributeError):
53 + return False
54 ++
55 ++ if hasattr(base64, "decodebytes"):
56 ++ decodebytes = base64.decodebytes
57 ++ else:
58 ++ decodebytes = base64.decodestring
59 ++
60 + try:
61 +- data = base64.decodestring(data64)
62 ++ data = decodebytes(data64)
63 + except base64.binascii.Error:
64 + return False
65 +
66
67 diff --git a/sys-auth/ssh-ldap-pubkey/ssh-ldap-pubkey-1.3.3.ebuild b/sys-auth/ssh-ldap-pubkey/ssh-ldap-pubkey-1.3.3.ebuild
68 new file mode 100644
69 index 00000000000..c34e4af8ac9
70 --- /dev/null
71 +++ b/sys-auth/ssh-ldap-pubkey/ssh-ldap-pubkey-1.3.3.ebuild
72 @@ -0,0 +1,73 @@
73 +# Copyright 1999-2021 Gentoo Authors
74 +# Distributed under the terms of the GNU General Public License v2
75 +
76 +EAPI="7"
77 +
78 +PYTHON_COMPAT=( python3_{7..9} )
79 +inherit distutils-r1
80 +
81 +DESCRIPTION="Utility to manage SSH public keys stored in LDAP"
82 +HOMEPAGE="https://github.com/jirutka/ssh-ldap-pubkey"
83 +
84 +if [[ ${PV} == "9999" ]]; then
85 + EGIT_REPO_URI="https://github.com/jirutka/${PN}/${PN}.git"
86 +
87 + inherit git-r3
88 +else
89 + SRC_URI="https://github.com/jirutka/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
90 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
91 +fi
92 +
93 +LICENSE="MIT"
94 +SLOT="0"
95 +IUSE="schema test"
96 +RESTRICT="!test? ( test )"
97 +
98 +MY_CDEPEND="
99 + dev-python/docopt[${PYTHON_USEDEP}]
100 + >=dev-python/python-ldap-3.0[${PYTHON_USEDEP}]
101 + virtual/logger"
102 +
103 +DEPEND="
104 + ${MY_CDEPEND}
105 + dev-python/setuptools[${PYTHON_USEDEP}]
106 + test? (
107 + dev-python/pytest[${PYTHON_USEDEP}]
108 + dev-python/pytest-describe[${PYTHON_USEDEP}]
109 + dev-python/pytest-mock[${PYTHON_USEDEP}]
110 + )"
111 +
112 +# We need to block previous net-misc/openssh packages
113 +# to avoid file collision on "/etc/openldap/schema/openssh-lpk.schema"
114 +RDEPEND="${MY_CDEPEND}
115 + schema? ( !net-misc/openssh[ldap(-)] )"
116 +
117 +DOCS=( README.md CHANGELOG.adoc )
118 +
119 +PATCHES=( "${FILESDIR}"/${P}-python3.9.patch )
120 +
121 +src_prepare() {
122 + sed -i -e 's/pyldap/python-ldap >= 3.0/' setup.py || die
123 + distutils-r1_src_prepare
124 +}
125 +
126 +python_test() {
127 + pytest -vv || die "Tests failed under ${EPYTHON}"
128 +}
129 +
130 +python_install_all() {
131 + distutils-r1_python_install_all
132 +
133 + if use schema; then
134 + insinto /etc/openldap/schema
135 + doins etc/openssh-lpk.schema
136 + fi
137 +
138 + local MY_DOCDIR="/usr/share/doc/${PF}/examples"
139 + insinto "${MY_DOCDIR}"
140 + doins etc/ldap.conf
141 +
142 + # We don't want to compress this small file to allow user
143 + # to diff configuration against upstream's default
144 + docompress -x "${MY_DOCDIR}"
145 +}