Gentoo Archives: gentoo-commits

From: NP Hardass <np-hardass@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/acme-tiny/files/, app-crypt/acme-tiny/
Date: Tue, 20 Jun 2017 22:51:21
Message-Id: 1497998933.cbc49b3b9bbcd1736e335e3c16ca6770b7234898.np-hardass@gentoo
1 commit: cbc49b3b9bbcd1736e335e3c16ca6770b7234898
2 Author: NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 20 22:46:06 2017 +0000
4 Commit: NP Hardass <np-hardass <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 20 22:48:53 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbc49b3b
7
8 app-crypt/acme-tiny: Initial commit
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 app-crypt/acme-tiny/Manifest | 1 +
13 app-crypt/acme-tiny/acme-tiny-20170207.ebuild | 47 +++++++
14 app-crypt/acme-tiny/acme-tiny-9999.ebuild | 47 +++++++
15 .../files/acme-tiny-PR101-contactinfo.patch | 97 +++++++++++++
16 .../acme-tiny/files/acme-tiny-PR50-setup.py.patch | 150 +++++++++++++++++++++
17 .../acme-tiny/files/acme-tiny-PR87-readmefix.patch | 23 ++++
18 app-crypt/acme-tiny/metadata.xml | 14 ++
19 7 files changed, 379 insertions(+)
20
21 diff --git a/app-crypt/acme-tiny/Manifest b/app-crypt/acme-tiny/Manifest
22 new file mode 100644
23 index 00000000000..022d3d6856d
24 --- /dev/null
25 +++ b/app-crypt/acme-tiny/Manifest
26 @@ -0,0 +1 @@
27 +DIST acme-tiny-20170207.tar.gz 10510 SHA256 aef2541c7270a9aa4d4ce49509d6a0f48e59eccc116df0fe7defe77df724f544 SHA512 260de3fe3052e3eba3e8438b15e34d95c99f95d75137ddabe9c031a83bd7b967bebabe6916fa23de6194ab19cc687942af0cc700b7095b7c810820800c26061e WHIRLPOOL f16ed8b8f0a096bf379ad203343061b9bc078999029254b9462178a930e08728f370f0837991676f5d6bad41cd5279fbecc27dfa9b08c307341e1052cd9bbdfb
28
29 diff --git a/app-crypt/acme-tiny/acme-tiny-20170207.ebuild b/app-crypt/acme-tiny/acme-tiny-20170207.ebuild
30 new file mode 100644
31 index 00000000000..05ce311583f
32 --- /dev/null
33 +++ b/app-crypt/acme-tiny/acme-tiny-20170207.ebuild
34 @@ -0,0 +1,47 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
41 +inherit distutils-r1
42 +
43 +if [[ ${PV} == 9999 ]]; then
44 + inherit git-r3
45 + EGIT_REPO_URI="https://github.com/diafygi/${PN}.git"
46 + KEYWORDS=""
47 +else
48 + HASH="daba51d37efd7c1f205f9da383b9b09968e30d29"
49 + SRC_URI="https://github.com/diafygi/${PN}/archive/${HASH}.tar.gz -> ${P}.tar.gz"
50 + KEYWORDS="~amd64 ~x86"
51 + S="${WORKDIR}/${PN}-${HASH}"
52 +fi
53 +
54 +DESCRIPTION="A tiny, auditable script for Let's Encrypt's ACME Protocol"
55 +HOMEPAGE="https://github.com/diafygi/acme-tiny"
56 +
57 +LICENSE="MIT"
58 +SLOT="0"
59 +
60 +IUSE="minimal"
61 +
62 +DEPEND="dev-python/setuptools_scm[${PYTHON_USEDEP}]"
63 +RDEPEND="dev-libs/openssl:0"
64 +
65 +PATCHES=( "${FILESDIR}/${PN}-PR50-setup.py.patch" )
66 +
67 +pkg_setup() {
68 + if [[ ${PV} != 9999 ]]; then
69 + export SETUPTOOLS_SCM_PRETEND_VERSION="0.1.dev79+n${HASH:0:7}.d$(date +%Y%m%d)"
70 + fi
71 +}
72 +
73 +src_prepare() {
74 + if ! use minimal; then
75 + PATCHES+=(
76 + "${FILESDIR}/${PN}-PR87-readmefix.patch"
77 + "${FILESDIR}/${PN}-PR101-contactinfo.patch"
78 + )
79 + fi
80 + distutils-r1_src_prepare
81 +}
82
83 diff --git a/app-crypt/acme-tiny/acme-tiny-9999.ebuild b/app-crypt/acme-tiny/acme-tiny-9999.ebuild
84 new file mode 100644
85 index 00000000000..05ce311583f
86 --- /dev/null
87 +++ b/app-crypt/acme-tiny/acme-tiny-9999.ebuild
88 @@ -0,0 +1,47 @@
89 +# Copyright 1999-2017 Gentoo Foundation
90 +# Distributed under the terms of the GNU General Public License v2
91 +
92 +EAPI=6
93 +
94 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
95 +inherit distutils-r1
96 +
97 +if [[ ${PV} == 9999 ]]; then
98 + inherit git-r3
99 + EGIT_REPO_URI="https://github.com/diafygi/${PN}.git"
100 + KEYWORDS=""
101 +else
102 + HASH="daba51d37efd7c1f205f9da383b9b09968e30d29"
103 + SRC_URI="https://github.com/diafygi/${PN}/archive/${HASH}.tar.gz -> ${P}.tar.gz"
104 + KEYWORDS="~amd64 ~x86"
105 + S="${WORKDIR}/${PN}-${HASH}"
106 +fi
107 +
108 +DESCRIPTION="A tiny, auditable script for Let's Encrypt's ACME Protocol"
109 +HOMEPAGE="https://github.com/diafygi/acme-tiny"
110 +
111 +LICENSE="MIT"
112 +SLOT="0"
113 +
114 +IUSE="minimal"
115 +
116 +DEPEND="dev-python/setuptools_scm[${PYTHON_USEDEP}]"
117 +RDEPEND="dev-libs/openssl:0"
118 +
119 +PATCHES=( "${FILESDIR}/${PN}-PR50-setup.py.patch" )
120 +
121 +pkg_setup() {
122 + if [[ ${PV} != 9999 ]]; then
123 + export SETUPTOOLS_SCM_PRETEND_VERSION="0.1.dev79+n${HASH:0:7}.d$(date +%Y%m%d)"
124 + fi
125 +}
126 +
127 +src_prepare() {
128 + if ! use minimal; then
129 + PATCHES+=(
130 + "${FILESDIR}/${PN}-PR87-readmefix.patch"
131 + "${FILESDIR}/${PN}-PR101-contactinfo.patch"
132 + )
133 + fi
134 + distutils-r1_src_prepare
135 +}
136
137 diff --git a/app-crypt/acme-tiny/files/acme-tiny-PR101-contactinfo.patch b/app-crypt/acme-tiny/files/acme-tiny-PR101-contactinfo.patch
138 new file mode 100644
139 index 00000000000..787b66c1129
140 --- /dev/null
141 +++ b/app-crypt/acme-tiny/files/acme-tiny-PR101-contactinfo.patch
142 @@ -0,0 +1,97 @@
143 +From 86083e6f79c6af99a59d8ee27c61f5d9b407f436 Mon Sep 17 00:00:00 2001
144 +From: Phiber2000 <phiber2000@×××.de>
145 +Date: Thu, 10 Mar 2016 16:43:54 +0100
146 +Subject: [PATCH 1/3] added contact key in payload and email parameter
147 +
148 +---
149 + acme_tiny.py | 12 ++++++++----
150 + 1 file changed, 8 insertions(+), 4 deletions(-)
151 +
152 +diff --git a/acme_tiny.py b/acme_tiny.py
153 +index 34a1863..bd79321 100644
154 +--- a/acme_tiny.py
155 ++++ b/acme_tiny.py
156 +@@ -12,7 +12,7 @@
157 + LOGGER.addHandler(logging.StreamHandler())
158 + LOGGER.setLevel(logging.INFO)
159 +
160 +-def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
161 ++def get_crt(account_key, csr, acme_dir, account_email, log=LOGGER, CA=DEFAULT_CA):
162 + # helper function base64 encode for jose spec
163 + def _b64(b):
164 + return base64.urlsafe_b64encode(b).decode('utf8').replace("=", "")
165 +@@ -80,10 +80,13 @@ def _send_signed_request(url, payload):
166 +
167 + # get the certificate domains and expiration
168 + log.info("Registering account...")
169 +- code, result = _send_signed_request(CA + "/acme/new-reg", {
170 ++ payload = {
171 + "resource": "new-reg",
172 + "agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf",
173 +- })
174 ++ }
175 ++ if account_email:
176 ++ payload["contact"] = ["mailto:"+account_email]
177 ++ code, result = _send_signed_request(CA + "/acme/new-reg", payload)
178 + if code == 201:
179 + log.info("Registered!")
180 + elif code == 409:
181 +@@ -188,10 +191,11 @@ def main(argv):
182 + parser.add_argument("--acme-dir", required=True, help="path to the .well-known/acme-challenge/ directory")
183 + parser.add_argument("--quiet", action="store_const", const=logging.ERROR, help="suppress output except for errors")
184 + parser.add_argument("--ca", default=DEFAULT_CA, help="certificate authority, default is Let's Encrypt")
185 ++ parser.add_argument("--account-email", help="contact e-mail address")
186 +
187 + args = parser.parse_args(argv)
188 + LOGGER.setLevel(args.quiet or LOGGER.level)
189 +- signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca)
190 ++ signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, args.account_email, log=LOGGER, CA=args.ca)
191 + sys.stdout.write(signed_crt)
192 +
193 + if __name__ == "__main__": # pragma: no cover
194 +
195 +From b128ae1289b106e1ddf20d3787a431d8ea949cf3 Mon Sep 17 00:00:00 2001
196 +From: Phiber2000 <phiber2000@×××.de>
197 +Date: Thu, 10 Mar 2016 19:27:17 +0100
198 +Subject: [PATCH 2/3] code style correction
199 +
200 +---
201 + acme_tiny.py | 2 +-
202 + 1 file changed, 1 insertion(+), 1 deletion(-)
203 +
204 +diff --git a/acme_tiny.py b/acme_tiny.py
205 +index bd79321..cea57ee 100644
206 +--- a/acme_tiny.py
207 ++++ b/acme_tiny.py
208 +@@ -85,7 +85,7 @@ def _send_signed_request(url, payload):
209 + "agreement": "https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf",
210 + }
211 + if account_email:
212 +- payload["contact"] = ["mailto:"+account_email]
213 ++ payload["contact"] = ["mailto:{0}".format(account_email)]
214 + code, result = _send_signed_request(CA + "/acme/new-reg", payload)
215 + if code == 201:
216 + log.info("Registered!")
217 +
218 +From 90eac8d6f22e858168ead32f00f13e7c997b64fc Mon Sep 17 00:00:00 2001
219 +From: Phiber2000 <phiber2000@×××.de>
220 +Date: Thu, 10 Mar 2016 19:33:21 +0100
221 +Subject: [PATCH 3/3] updated email argument helptext
222 +
223 +---
224 + acme_tiny.py | 2 +-
225 + 1 file changed, 1 insertion(+), 1 deletion(-)
226 +
227 +diff --git a/acme_tiny.py b/acme_tiny.py
228 +index cea57ee..930cd43 100644
229 +--- a/acme_tiny.py
230 ++++ b/acme_tiny.py
231 +@@ -191,7 +191,7 @@ def main(argv):
232 + parser.add_argument("--acme-dir", required=True, help="path to the .well-known/acme-challenge/ directory")
233 + parser.add_argument("--quiet", action="store_const", const=logging.ERROR, help="suppress output except for errors")
234 + parser.add_argument("--ca", default=DEFAULT_CA, help="certificate authority, default is Let's Encrypt")
235 +- parser.add_argument("--account-email", help="contact e-mail address")
236 ++ parser.add_argument("--account-email", help="set contact e-mail address, leave empty to keep current")
237 +
238 + args = parser.parse_args(argv)
239 + LOGGER.setLevel(args.quiet or LOGGER.level)
240
241 diff --git a/app-crypt/acme-tiny/files/acme-tiny-PR50-setup.py.patch b/app-crypt/acme-tiny/files/acme-tiny-PR50-setup.py.patch
242 new file mode 100644
243 index 00000000000..c7e2c08a7c6
244 --- /dev/null
245 +++ b/app-crypt/acme-tiny/files/acme-tiny-PR50-setup.py.patch
246 @@ -0,0 +1,150 @@
247 +From 9bc3865d8c86392ca115ffb64a9389e92e00e861 Mon Sep 17 00:00:00 2001
248 +From: Jonas Haag <jonas@××××××.org>
249 +Date: Tue, 29 Dec 2015 14:14:49 +0100
250 +Subject: [PATCH 1/3] Add setup.py
251 +
252 +---
253 + acme_tiny.py | 2 +-
254 + setup.py | 28 ++++++++++++++++++++++++++++
255 + tests/__init__.py | 1 +
256 + tests/test_install.py | 24 ++++++++++++++++++++++++
257 + 4 files changed, 54 insertions(+), 1 deletion(-)
258 + create mode 100644 setup.py
259 + create mode 100644 tests/test_install.py
260 +
261 +diff --git a/acme_tiny.py b/acme_tiny.py
262 +index f54db0c..ca9ad3d 100644
263 +--- a/acme_tiny.py
264 ++++ b/acme_tiny.py
265 +@@ -165,7 +165,7 @@ def _send_signed_request(url, payload):
266 + return """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
267 + "\n".join(textwrap.wrap(base64.b64encode(result).decode('utf8'), 64)))
268 +
269 +-def main(argv):
270 ++def main(argv=None):
271 + parser = argparse.ArgumentParser(
272 + formatter_class=argparse.RawDescriptionHelpFormatter,
273 + description=textwrap.dedent("""\
274 +diff --git a/setup.py b/setup.py
275 +new file mode 100644
276 +index 0000000..9ed597e
277 +--- /dev/null
278 ++++ b/setup.py
279 +@@ -0,0 +1,28 @@
280 ++from setuptools import setup
281 ++
282 ++setup(
283 ++ name="acme-tiny",
284 ++ version="1.0.0",
285 ++ url="https://github.com/diafygi/acme-tiny",
286 ++ author="Daniel Roesler",
287 ++ author_email="diafygi@×××××.com",
288 ++ description="A tiny script to issue and renew TLS certs from Let's Encrypt",
289 ++ license="MIT",
290 ++ py_modules=['acme_tiny'],
291 ++ entry_points={'console_scripts': [
292 ++ 'acme-tiny = acme_tiny:main',
293 ++ ]},
294 ++ classifiers = [
295 ++ 'Development Status :: 5 - Production/Stable',
296 ++ 'Intended Audience :: System Administrators'
297 ++ 'License :: OSI Approved :: MIT License',
298 ++ 'Operating System :: OS Independent',
299 ++ 'Programming Language :: Python',
300 ++ 'Programming Language :: Python :: 2',
301 ++ 'Programming Language :: Python :: 2.7',
302 ++ 'Programming Language :: Python :: 3',
303 ++ 'Programming Language :: Python :: 3.3',
304 ++ 'Programming Language :: Python :: 3.4',
305 ++ 'Programming Language :: Python :: 3.5',
306 ++ ]
307 ++)
308 +diff --git a/tests/__init__.py b/tests/__init__.py
309 +index ce89619..5ade34c 100644
310 +--- a/tests/__init__.py
311 ++++ b/tests/__init__.py
312 +@@ -1 +1,2 @@
313 + from .test_module import TestModule
314 ++from .test_install import TestInstall
315 +diff --git a/tests/test_install.py b/tests/test_install.py
316 +new file mode 100644
317 +index 0000000..005f36c
318 +--- /dev/null
319 ++++ b/tests/test_install.py
320 +@@ -0,0 +1,24 @@
321 ++import unittest
322 ++import os
323 ++import tempfile
324 ++import shutil
325 ++import subprocess
326 ++
327 ++
328 ++class TestInstall(unittest.TestCase):
329 ++ def setUp(self):
330 ++ self.tempdir = tempfile.mkdtemp()
331 ++ subprocess.check_call(["virtualenv", self.tempdir])
332 ++
333 ++ def tearDown(self):
334 ++ shutil.rmtree(self.tempdir)
335 ++
336 ++ def virtualenv_bin(self, cmd):
337 ++ return os.path.join(self.tempdir, "bin", cmd)
338 ++
339 ++ def test_install(self):
340 ++ subprocess.check_call([self.virtualenv_bin("python"), "setup.py", "install"])
341 ++
342 ++ def test_cli(self):
343 ++ self.test_install()
344 ++ subprocess.check_call([self.virtualenv_bin("acme-tiny"), "-h"])
345 +
346 +From cdf1bde83d6b640a8896722557386b6d9b6a9fbb Mon Sep 17 00:00:00 2001
347 +From: Rob Speed <speed.rob@×××××.com>
348 +Date: Wed, 10 Feb 2016 21:53:24 -0500
349 +Subject: [PATCH 2/3] Added setuptools_scm for automatic versioning based on
350 + tags.
351 +
352 +---
353 + setup.py | 3 ++-
354 + 1 file changed, 2 insertions(+), 1 deletion(-)
355 +
356 +diff --git a/setup.py b/setup.py
357 +index 9ed597e..7ec7ef1 100644
358 +--- a/setup.py
359 ++++ b/setup.py
360 +@@ -2,7 +2,7 @@
361 +
362 + setup(
363 + name="acme-tiny",
364 +- version="1.0.0",
365 ++ use_scm_version=True,
366 + url="https://github.com/diafygi/acme-tiny",
367 + author="Daniel Roesler",
368 + author_email="diafygi@×××××.com",
369 +@@ -12,6 +12,7 @@
370 + entry_points={'console_scripts': [
371 + 'acme-tiny = acme_tiny:main',
372 + ]},
373 ++ setup_requires=['setuptools_scm'],
374 + classifiers = [
375 + 'Development Status :: 5 - Production/Stable',
376 + 'Intended Audience :: System Administrators'
377 +
378 +From edcaee1fa841d49a3fa488288faa8e6573269413 Mon Sep 17 00:00:00 2001
379 +From: Matthias Bach <marix@×××××.org>
380 +Date: Mon, 22 Feb 2016 22:53:06 +0100
381 +Subject: [PATCH 3/3] Mark wheels of acme-tiny as universal
382 +
383 +Ensure that wheels created from the acme-tiny source are marked as universal.
384 +---
385 + setup.cfg | 2 ++
386 + 1 file changed, 2 insertions(+)
387 + create mode 100644 setup.cfg
388 +
389 +diff --git a/setup.cfg b/setup.cfg
390 +new file mode 100644
391 +index 0000000..434559d
392 +--- /dev/null
393 ++++ b/setup.cfg
394 +@@ -0,0 +1,2 @@
395 ++[wheel]
396 ++universal=True
397
398 diff --git a/app-crypt/acme-tiny/files/acme-tiny-PR87-readmefix.patch b/app-crypt/acme-tiny/files/acme-tiny-PR87-readmefix.patch
399 new file mode 100644
400 index 00000000000..1f576d50c75
401 --- /dev/null
402 +++ b/app-crypt/acme-tiny/files/acme-tiny-PR87-readmefix.patch
403 @@ -0,0 +1,23 @@
404 +From 85df9d1217341893ab6dbbe58fb7c878e15d832b Mon Sep 17 00:00:00 2001
405 +From: Jakub Wilk <jwilk@×××××.net>
406 +Date: Wed, 24 Feb 2016 22:10:01 +0100
407 +Subject: [PATCH] renew_cert.sh: fix unusual shebang
408 +
409 +sh is normally lives in /bin, not in /usr/bin.
410 +---
411 + README.md | 2 +-
412 + 1 file changed, 1 insertion(+), 1 deletion(-)
413 +
414 +diff --git a/README.md b/README.md
415 +index dfa562c..5c83a67 100644
416 +--- a/README.md
417 ++++ b/README.md
418 +@@ -171,7 +171,7 @@ for example script).
419 +
420 + Example of a `renew_cert.sh`:
421 + ```sh
422 +-#!/usr/bin/sh
423 ++#!/bin/sh
424 + python /path/to/acme_tiny.py --account-key /path/to/account.key --csr /path/to/domain.csr --acme-dir /var/www/challenges/ > /tmp/signed.crt || exit
425 + wget -O - https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem > intermediate.pem
426 + cat /tmp/signed.crt intermediate.pem > /path/to/chained.pem
427
428 diff --git a/app-crypt/acme-tiny/metadata.xml b/app-crypt/acme-tiny/metadata.xml
429 new file mode 100644
430 index 00000000000..1e492cbeec2
431 --- /dev/null
432 +++ b/app-crypt/acme-tiny/metadata.xml
433 @@ -0,0 +1,14 @@
434 +<?xml version="1.0" encoding="UTF-8"?>
435 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
436 +<pkgmetadata>
437 + <maintainer type="person">
438 + <email>NP-Hardass@g.o</email>
439 + <name>NP-Hardass</name>
440 + </maintainer>
441 + <longdescription>
442 + A tiny, auditable script for Let's Encrypt's ACME Protocol
443 + </longdescription>
444 + <upstream>
445 + <remote-id type="github">diafygi/acme-tiny</remote-id>
446 + </upstream>
447 +</pkgmetadata>