Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / gnupg.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2018 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
7 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
11 ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
12 ;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
13 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
14 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
15 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
16 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages gnupg)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages adns)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages emacs)
43 #:use-module (gnu packages openldap)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages perl-check)
46 #:use-module (gnu packages pth)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages readline)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages databases)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gnome)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages ncurses)
57 #:use-module (gnu packages security-token)
58 #:use-module (gnu packages swig)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages tor)
61 #:use-module (gnu packages web)
62 #:use-module (gnu packages xml)
63 #:use-module (guix packages)
64 #:use-module (guix download)
65 #:use-module (guix git-download)
66 #:use-module (guix build-system gnu)
67 #:use-module (guix build-system perl)
68 #:use-module (guix build-system python))
69
70 (define-public libgpg-error
71 (package
72 (name "libgpg-error")
73 (version "1.28")
74 (source
75 (origin
76 (method url-fetch)
77 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
78 version ".tar.bz2"))
79 (sha256
80 (base32
81 "0jfsfnh9bxlxiwxws60yah4ybjw2hshmvqp31pri4m4h8ivrbnry"))
82 (patches (search-patches "libgpg-error-aarch64-logging-fix.patch"))))
83 (build-system gnu-build-system)
84 (home-page "https://gnupg.org")
85 (synopsis "Library of error values for GnuPG components")
86 (description
87 "Libgpg-error is a small library that defines common error values
88 for all GnuPG components. Among these are GPG, GPGSM, GPGME,
89 GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
90 Daemon and possibly more in the future.")
91 (license license:lgpl2.0+)
92 (properties '((ftp-server . "ftp.gnupg.org")
93 (ftp-directory . "/gcrypt/libgpg-error")))))
94
95 ;; Some packages (e.g. GPGME) require a newer libgpg-error to deal with
96 ;; error codes from recent GnuPG. Remove this in the next rebuild cycle.
97 (define-public libgpg-error-1.31
98 (package
99 (inherit libgpg-error)
100 (version "1.31")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
104 version ".tar.bz2"))
105 (sha256
106 (base32
107 "1vx4nw6rxh2biy3h8n96fyr86q29h8gjl6837437i51jr4isil20"))))))
108
109 (define-public libgcrypt
110 (package
111 (name "libgcrypt")
112 (version "1.8.2")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
116 version ".tar.bz2"))
117 (sha256
118 (base32
119 "01sca9m8hm6b5v8hmqsfdjhyz013869p1f0fxw9ln52qfnp4q1n8"))))
120 (build-system gnu-build-system)
121 (propagated-inputs
122 `(("libgpg-error-host" ,libgpg-error)))
123 (native-inputs
124 ;; Needed here for the 'gpg-error' program.
125 `(("libgpg-error-native" ,libgpg-error)))
126 (arguments
127 ;; The '--with-gpg-error-prefix' argument is needed because otherwise
128 ;; 'configure' uses 'gpg-error-config' to determine the '-L' flag, and
129 ;; the 'gpg-error-config' it runs is the native one---i.e., the wrong one.
130 `(#:configure-flags
131 (list (string-append "--with-gpg-error-prefix="
132 (assoc-ref %build-inputs "libgpg-error-host")))))
133 (outputs '("out" "debug"))
134 (home-page "https://gnupg.org/")
135 (synopsis "Cryptographic function library")
136 (description
137 "Libgcrypt is a general-purpose cryptographic library. It provides the
138 standard cryptographic building blocks such as symmetric ciphers, hash
139 algorithms, public key algorithms, large integer functions and random number
140 generation.")
141 (license license:lgpl2.0+)
142 (properties '((ftp-server . "ftp.gnupg.org")
143 (ftp-directory . "/gcrypt/libgcrypt")))))
144
145 (define-public libassuan
146 (package
147 (name "libassuan")
148 (version "2.5.1")
149 (source
150 (origin
151 (method url-fetch)
152 (uri (string-append "mirror://gnupg/libassuan/libassuan-"
153 version ".tar.bz2"))
154 (sha256
155 (base32
156 "0jb4nb4nrjr949gd3lw8lh4v5d6qigxaq6xwy24w5apjnhvnrya7"))))
157 (build-system gnu-build-system)
158 (propagated-inputs
159 `(("libgpg-error" ,libgpg-error)
160 ("pth" ,pth)))
161 (home-page "https://gnupg.org")
162 (synopsis
163 "IPC library used by GnuPG and related software")
164 (description
165 "Libassuan is a small library implementing the so-called Assuan
166 protocol. This protocol is used for IPC between most newer
167 GnuPG components. Both, server and client side functions are
168 provided.")
169 (license license:lgpl2.0+)
170 (properties '((ftp-server . "ftp.gnupg.org")
171 (ftp-directory . "/gcrypt/libassuan")))))
172
173 (define-public libksba
174 (package
175 (name "libksba")
176 (version "1.3.5")
177 (source
178 (origin
179 (method url-fetch)
180 (uri (string-append
181 "mirror://gnupg/libksba/libksba-"
182 version ".tar.bz2"))
183 (sha256
184 (base32
185 "0h53q4sns1jz1pkmhcz5wp9qrfn9f5g9i3vjv6dafwzzlvblyi21"))))
186 (build-system gnu-build-system)
187 (propagated-inputs
188 `(("libgpg-error" ,libgpg-error)))
189 (native-inputs
190 `(("libgpg-error" ,libgpg-error)))
191 (arguments
192 `(#:configure-flags
193 (list ,@(if (%current-target-system)
194 '("CC_FOR_BUILD=gcc")
195 '())
196 (string-append "--with-gpg-error-prefix="
197 (assoc-ref %build-inputs "libgpg-error")))))
198 (home-page "https://www.gnupg.org")
199 (synopsis "CMS and X.509 access library")
200 (description
201 "KSBA (pronounced Kasbah) is a library to make X.509 certificates
202 as well as the CMS easily accessible by other applications. Both
203 specifications are building blocks of S/MIME and TLS.")
204 (license license:gpl3+)
205 (properties '((ftp-server . "ftp.gnupg.org")
206 (ftp-directory . "/gcrypt/libksba")))))
207
208 (define-public npth
209 (package
210 (name "npth")
211 (version "1.5")
212 (source
213 (origin
214 (method url-fetch)
215 (uri (string-append "mirror://gnupg/npth/npth-" version ".tar.bz2"))
216 (sha256
217 (base32
218 "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9"))))
219 (build-system gnu-build-system)
220 (home-page "https://www.gnupg.org")
221 (synopsis "Non-preemptive thread library")
222 (description
223 "Npth is a library to provide the GNU Pth API and thus a non-preemptive
224 threads implementation.
225
226 In contrast to GNU Pth is is based on the system's standard threads
227 implementation. This allows the use of libraries which are not
228 compatible to GNU Pth.")
229 (license (list license:lgpl3+ license:gpl2+)))) ; dual license
230
231 (define-public gnupg
232 (package
233 (name "gnupg")
234 (version "2.2.7")
235 (source (origin
236 (method url-fetch)
237 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
238 ".tar.bz2"))
239 (sha256
240 (base32
241 "0vlpis0q7gvq9mhdc43hkyn3cdriz4mwgj20my3gyzpgwqg3cnyr"))))
242 (build-system gnu-build-system)
243 (native-inputs
244 `(("pkg-config" ,pkg-config)))
245 (inputs
246 `(("gnutls" ,gnutls)
247 ("libassuan" ,libassuan)
248 ("libgcrypt" ,libgcrypt)
249 ("libgpg-error" ,libgpg-error)
250 ("libksba" ,libksba)
251 ("npth" ,npth)
252 ("openldap" ,openldap)
253 ("pcsc-lite" ,pcsc-lite)
254 ("readline" ,readline)
255 ("sqlite" ,sqlite)
256 ("zlib" ,zlib)))
257 (arguments
258 `(#:configure-flags '(;; Otherwise, the test suite looks for the `gpg`
259 ;; executable in its installation directory in
260 ;; /gnu/store before it has been installed.
261 "--enable-gnupg-builddir-envvar"
262 "--enable-all-tests")
263 #:phases
264 (modify-phases %standard-phases
265 (add-before 'configure 'patch-paths
266 (lambda* (#:key inputs #:allow-other-keys)
267 (substitute* "scd/scdaemon.c"
268 (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
269 (string-append "\"" (assoc-ref inputs "pcsc-lite")
270 "/lib/" name "\"")))
271 #t))
272 (add-after 'build 'patch-scheme-tests
273 (lambda _
274 (substitute* (find-files "tests" ".\\.scm$")
275 (("/usr/bin/env gpgscm")
276 (string-append (getcwd) "/tests/gpgscm/gpgscm")))
277 #t))
278 (add-before 'build 'patch-test-paths
279 (lambda _
280 (substitute* '("tests/inittests"
281 "tests/pkits/inittests"
282 "tests/Makefile"
283 "tests/pkits/common.sh"
284 "tests/pkits/Makefile")
285 (("/bin/pwd") (which "pwd")))
286 (substitute* "common/t-exectool.c"
287 (("/bin/cat") (which "cat"))
288 (("/bin/true") (which "true"))
289 (("/bin/false") (which "false")))
290 #t)))))
291 (home-page "https://gnupg.org/")
292 (synopsis "GNU Privacy Guard")
293 (description
294 "The GNU Privacy Guard is a complete implementation of the OpenPGP
295 standard. It is used to encrypt and sign data and communication. It
296 features powerful key management and the ability to access public key
297 servers. It includes several libraries: libassuan (IPC between GnuPG
298 components), libgpg-error (centralized GnuPG error values), and
299 libskba (working with X.509 certificates and CMS data).")
300 (license license:gpl3+)
301 (properties '((ftp-server . "ftp.gnupg.org")
302 (ftp-directory . "/gcrypt/gnupg")))))
303
304 (define-public gnupg-2.0
305 (package (inherit gnupg)
306 (version "2.0.30")
307 (source (origin
308 (method url-fetch)
309 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
310 ".tar.bz2"))
311 (sha256
312 (base32
313 "0wax4cy14hh0h7kg9hj0hjn9424b71z8lrrc5kbsasrn9xd7hag3"))))
314 (native-inputs '())
315 (inputs
316 `(("adns" ,adns)
317 ("bzip2" ,bzip2)
318 ("curl" ,curl)
319 ("libassuan" ,libassuan)
320 ("libgcrypt" ,libgcrypt)
321 ("libgpg-error" ,libgpg-error)
322 ("libksba" ,libksba)
323 ("pth" ,pth)
324 ("openldap" ,openldap)
325 ("zlib" ,zlib)
326 ("readline" ,readline)))
327 (arguments
328 `(#:phases
329 (modify-phases %standard-phases
330 (add-before 'configure 'patch-config-files
331 (lambda _
332 (substitute* "tests/openpgp/Makefile.in"
333 (("/bin/sh") (which "sh")))
334 #t))
335 (add-after 'install 'rename-v2-commands
336 (lambda* (#:key outputs #:allow-other-keys)
337 ;; Upstream suggests removing the trailing '2' from command names:
338 ;; <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22883#58>.
339 (let ((out (assoc-ref outputs "out")))
340 (with-directory-excursion (string-append out "/bin")
341 (rename-file "gpgv2" "gpgv")
342 (rename-file "gpg2" "gpg")
343
344 ;; Keep the old name around to ease transition.
345 (symlink "gpgv" "gpgv2")
346 (symlink "gpg" "gpg2")
347 #t)))))))
348 (properties `((superseded . ,gnupg)))))
349
350 (define-public gnupg-1
351 (package (inherit gnupg)
352 (version "1.4.22")
353 (source (origin
354 (method url-fetch)
355 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
356 ".tar.bz2"))
357 (sha256
358 (base32
359 "1d1hz4szh1kvwhsw7w2zxa6q5ndrk3qy6hj289l1b8k3xi5s554m"))))
360 (native-inputs '())
361 (inputs
362 `(("zlib" ,zlib)
363 ("bzip2" ,bzip2)
364 ("curl" ,curl)
365 ("readline" ,readline)
366 ("libgpg-error" ,libgpg-error)))
367 (arguments
368 `(#:phases
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-check-sh
371 (lambda _
372 (substitute* "checks/Makefile.in"
373 (("/bin/sh") (which "sh")))
374 #t)))))))
375
376 (define-public gpgme
377 (package
378 (name "gpgme")
379 (version "1.11.1")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
384 ".tar.bz2"))
385 (sha256
386 (base32
387 "0vxx5xaag3rhp4g2arp5qm77gvz4kj0m3hnpvhkdvqyjfhbi26rd"))))
388 (build-system gnu-build-system)
389 (native-inputs
390 `(("gnupg" ,gnupg)))
391 (propagated-inputs
392 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
393 `(("libgpg-error" ,libgpg-error-1.31)))
394 (inputs
395 `(("libassuan" ,libassuan)))
396 (home-page "https://www.gnupg.org/related_software/gpgme/")
397 (synopsis "Library providing simplified access to GnuPG functionality")
398 (description
399 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
400 easier for applications. It provides a High-Level Crypto API for encryption,
401 decryption, signing, signature verification and key management. Currently
402 it uses GnuPG as its backend but the API isn't restricted to this engine.
403
404 Because the direct use of GnuPG from an application can be a complicated
405 programming task, it is suggested that all software should try to use GPGME
406 instead. This way bug fixes or improvements can be done at a central place
407 and every application benefits from this.")
408 (license license:lgpl2.1+)))
409
410 (define-public qgpgme
411 (package
412 (inherit gpgme)
413 (name "qgpgme")
414 (arguments
415 `(#:phases
416 (modify-phases %standard-phases
417 (add-before 'build 'chdir-and-symlink
418 (lambda* (#:key inputs #:allow-other-keys)
419 (let ((gpgme (assoc-ref inputs "gpgme")))
420 (symlink (string-append gpgme "/lib/libgpgmepp.la")
421 "lang/cpp/src/libgpgmepp.la")
422 (symlink (string-append gpgme "/lib/libgpgme.la")
423 "src/libgpgme.la"))
424 (chdir "lang/qt")
425 #t)))))
426 (native-inputs
427 `(("pkg-config" ,pkg-config)
428 ,@(package-native-inputs gpgme)))
429 (inputs
430 `(("gpgme" ,gpgme)
431 ("qtbase" ,qtbase)
432 ,@(package-inputs gpgme)))
433 (synopsis "Qt API bindings for gpgme")
434 (description "QGpgme provides a very high level Qt API around GpgMEpp.
435
436 QGpgME was originally developed as part of libkleo and incorporated into
437 gpgpme starting with version 1.7.")
438 (license license:gpl2+))) ;; Note: this differs from gpgme
439
440 (define-public python-gpg
441 (package
442 (name "python-gpg")
443 (version "1.8.0")
444 (source (origin
445 (method url-fetch)
446 (uri (pypi-uri "gpg" version))
447 (sha256
448 (base32
449 "1x74i6q713c0bckls7rdm8kgsmllf9qvy9x62jghszlhgjkyh9nd"))))
450 (build-system python-build-system)
451 (arguments
452 '(#:tests? #f)) ; No test suite.
453 (inputs
454 `(("gpgme" ,gpgme)))
455 (native-inputs
456 `(("swig" ,swig)))
457 (home-page (package-home-page gpgme))
458 (synopsis "Python bindings for GPGME GnuPG cryptography library")
459 (description "This package provides Python bindings to the GPGME GnuPG
460 cryptographic library. It is developed in the GPGME source code, and then
461 distributed separately.")
462 (license license:lgpl2.1+)))
463
464 (define-public python2-gpg
465 (package-with-python2 python-gpg))
466
467 (define-public python-pygpgme
468 (package
469 (name "python-pygpgme")
470 (version "0.3")
471 (source
472 (origin
473 (method url-fetch)
474 (uri (pypi-uri "pygpgme" version))
475 (sha256
476 (base32
477 "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
478 ;; Unfortunately, we have to disable some tests due to some gpg-agent
479 ;; goofiness... see:
480 ;; https://bugs.launchpad.net/pygpgme/+bug/999949
481 (patches (search-patches "pygpgme-disable-problematic-tests.patch"
482 "python-pygpgme-fix-pinentry-tests.patch"))))
483 (arguments
484 `(#:phases
485 (modify-phases %standard-phases
486 (add-before 'build 'make-build
487 (lambda _
488 (zero? (system* "make" "build"))))
489 (replace 'check
490 (lambda _
491 (zero? (system* "make" "check")))))))
492 (build-system python-build-system)
493 (native-inputs
494 `(("gnupg" ,gnupg-1)))
495 (inputs
496 `(("gpgme" ,gpgme)))
497 (home-page "https://launchpad.net/pygpgme")
498 (synopsis "Python module for working with OpenPGP messages")
499 (description
500 "PyGPGME is a Python module that lets you sign, verify, encrypt and
501 decrypt messages using the OpenPGP format by making use of GPGME.")
502 (license license:lgpl2.1+)))
503
504 (define-public python2-pygpgme
505 (package-with-python2 python-pygpgme))
506
507 (define-public python-gnupg
508 (package
509 (name "python-gnupg")
510 (version "0.3.8")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (pypi-uri "python-gnupg" version))
515 (sha256
516 (base32
517 "0nkbs9c8f30lra7ca39kg91x8cyxn0jb61vih4qky839gpbwwwiq"))))
518 (build-system python-build-system)
519 (arguments
520 `(#:phases
521 (modify-phases %standard-phases
522 (replace 'check
523 (lambda _
524 (substitute* "test_gnupg.py"
525 ;; Exported keys don't have a version line!
526 (("del k1\\[1\\]") "#")
527 ;; Unsure why this test fails.
528 (("'test_search_keys'") "True")
529 (("def test_search_keys") "def disabled__search_keys"))
530 (setenv "USERNAME" "guixbuilder")
531 ;; The doctests are extremely slow and sometimes time out,
532 ;; so we disable them.
533 (zero? (system* "python"
534 "test_gnupg.py" "--no-doctests")))))))
535 (native-inputs
536 `(("gnupg" ,gnupg-1)))
537 (home-page "https://packages.python.org/python-gnupg/index.html")
538 (synopsis "Wrapper for the GNU Privacy Guard")
539 (description
540 "This module allows easy access to GnuPG’s key management, encryption
541 and signature functionality from Python programs.")
542 (license license:bsd-3)))
543
544 (define-public python2-gnupg
545 (package-with-python2 python-gnupg))
546
547 (define-public perl-gnupg-interface
548 (package
549 (name "perl-gnupg-interface")
550 (version "0.52")
551 (source (origin
552 (method url-fetch)
553 (uri (string-append "mirror://cpan/authors/id/A/AL/ALEXMV/"
554 "GnuPG-Interface-" version ".tar.gz"))
555 (sha256
556 (base32
557 "0dgx8yhdsmhkazcrz14n4flrk1afv7azgl003hl4arxvi1d9yyi4"))))
558 (build-system perl-build-system)
559 (arguments
560 `(#:phases
561 (modify-phases %standard-phases
562 ;; FIXME: This test fails for unknown reasons
563 (add-after 'unpack 'delete-broken-test
564 (lambda _
565 (delete-file "t/encrypt_symmetrically.t")
566 #t)))))
567 (inputs
568 `(("gnupg" ,gnupg-1)))
569 (propagated-inputs
570 `(("perl-moo" ,perl-moo)
571 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
572 ("perl-moox-late" ,perl-moox-late)))
573 (native-inputs
574 `(("which" ,which)
575 ("perl-module-install" ,perl-module-install)))
576 (home-page "http://search.cpan.org/dist/GnuPG-Interface/")
577 (synopsis "Perl interface to GnuPG")
578 (description "@code{GnuPG::Interface} and its associated modules are
579 designed to provide an object-oriented method for interacting with GnuPG,
580 being able to perform functions such as but not limited to encrypting,
581 signing, decryption, verification, and key-listing parsing.")
582 (license license:perl-license)))
583
584 (define-public pius
585 (package
586 (name "pius")
587 (version "2.2.6")
588 (source (origin
589 (method url-fetch)
590 (uri (string-append
591 "https://github.com/jaymzh/pius/releases/download/v"
592 version "/pius-" version ".tar.bz2"))
593 (sha256
594 (base32
595 "1893hzpx3zv724drqv48csrn0cm98xw4ymb1zmhs2jvjj1778zfj"))
596 (patches (search-patches "pius.patch"))))
597 (build-system python-build-system)
598 (inputs `(("perl" ,perl) ;for 'pius-party-worksheet'
599 ("gpg" ,gnupg)
600 ("python-six" ,python2-six)))
601 (arguments
602 `(#:tests? #f
603 #:python ,python-2 ;uses the Python 2 'print' syntax
604 #:phases
605 (modify-phases %standard-phases
606 (add-before
607 'build 'set-gpg-file-name
608 (lambda* (#:key inputs outputs #:allow-other-keys)
609 (let* ((gpg (string-append (assoc-ref inputs "gpg")
610 "/bin/gpg")))
611 (substitute* "libpius/constants.py"
612 (("/usr/bin/gpg2") gpg))
613 #t))))))
614 (synopsis "Programs to simplify GnuPG key signing")
615 (description
616 "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
617 parties. It is the main utility and makes it possible to quickly and easily
618 sign each UID on a set of PGP keys. It is designed to take the pain out of
619 the sign-all-the-keys part of PGP Keysigning Party while adding security
620 to the process.
621
622 pius-keyring-mgr and pius-party-worksheet help organisers of
623 PGP keysigning parties.")
624 (license license:gpl2)
625 (home-page "https://www.phildev.net/pius/index.shtml")))
626
627 (define-public signing-party
628 (package
629 (name "signing-party")
630 (version "2.6")
631 (source (origin
632 (method url-fetch)
633 (uri (string-append "mirror://debian/pool/main/s/signing-party/"
634 "signing-party_" version ".orig.tar.gz"))
635 (sha256 (base32
636 "1n5bpcfpl9vg1xp6r1jhbyahrgdyxp05b5pria1rh4m0qnv8sifr"))))
637 (build-system gnu-build-system)
638 (native-inputs
639 `(("autoconf" ,autoconf-wrapper)
640 ("automake" ,automake)))
641 (inputs `(("perl" ,perl)
642 ("perl-text-template" ,perl-text-template)
643 ("perl-mime-tools" ,perl-mime-tools)
644 ("perl-gnupg-interface" ,perl-gnupg-interface)
645 ("perl-net-idn-encode" ,perl-net-idn-encode)
646 ("libmd" ,libmd)))
647 (arguments
648 `(#:tests? #f
649 #:phases
650 (modify-phases %standard-phases
651 (add-before 'configure 'change-directory
652 (lambda _
653 ;; The build system in the unpack phase changes to a less useful
654 ;; subdirectory, so move up one level
655 (chdir (dirname (getcwd)))))
656 (replace 'configure
657 (lambda* (#:key outputs #:allow-other-keys)
658 (let ((out (assoc-ref outputs "out")))
659 (substitute* "keyanalyze/Makefile"
660 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
661 (substitute* "keyanalyze/Makefile"
662 (("\\./configure") (string-append "./configure --prefix=" out)))
663 (substitute* "gpgwrap/src/Makefile"
664 (("\\} clean")
665 (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
666 out "/bin/gpgwrap\n")))
667 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
668 "keylookup/Makefile" "sig2dot/Makefile"
669 "springgraph/Makefile")
670 (("/usr") out))
671 (setenv "CONFIG_SHELL" (which "sh")))))
672 (replace 'install
673 (lambda* (#:key outputs #:allow-other-keys #:rest args)
674 (let ((out (assoc-ref outputs "out"))
675 (install (assoc-ref %standard-phases 'install)))
676 (apply install args)
677 (for-each
678 (lambda (dir file)
679 (copy-file (string-append dir "/" file)
680 (string-append out "/bin/" file)))
681 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
682 "gpglist" "gpg-mailkeys" "gpgparticipants")
683 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
684 "gpglist" "gpg-mailkeys" "gpgparticipants"))
685 (for-each
686 (lambda (dir file)
687 (copy-file (string-append dir "/" file)
688 (string-append out "/share/man/man1/" file)))
689 '("caff" "caff" "caff" "gpgdir"
690 "gpg-key2ps" "gpglist" "gpg-mailkeys"
691 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
692 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
693 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
694 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
695 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
696 "process_keys.1" "pgpring.1" "keyanalyze.1")))))
697 (add-after 'install 'wrap-programs
698 (lambda* (#:key outputs #:allow-other-keys)
699 (let* ((out (assoc-ref outputs "out")))
700 (wrap-program
701 (string-append out "/bin/caff")
702 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
703 (synopsis "Collection of scripts for simplifying gnupg key signing")
704 (description
705 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
706 including tools for signing keys, keyring analysis, and party preparation.
707 @enumerate
708 @item caff: CA - Fire and Forget signs and mails a key
709 @item pgp-clean: removes all non-self signatures from key
710 @item pgp-fixkey: removes broken packets from keys
711 @item gpg-mailkeys: simply mail out a signed key to its owner
712 @item gpg-key2ps: generate PostScript file with fingerprint paper strips
713 @item gpgdir: recursive directory encryption tool
714 @item gpglist: show who signed which of your UIDs
715 @item gpgsigs: annotates list of GnuPG keys with already done signatures
716 @item gpgparticipants: create list of party participants for the organiser
717 @item gpgwrap: a passphrase wrapper
718 @item keyanalyze: minimum signing distance (MSD) analysis on keyrings
719 @item keylookup: ncurses wrapper around gpg --search
720 @item sig2dot: converts a list of GnuPG signatures to a .dot file
721 @item springgraph: creates a graph from a .dot file
722 @end enumerate")
723 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
724 ;; and caff and gpgsigs: bsd-3, see
725 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
726 (license license:gpl2)
727 (home-page "https://pgp-tools.alioth.debian.org/")))
728
729 (define-public pinentry-tty
730 (package
731 (name "pinentry-tty")
732 (version "1.1.0")
733 (source (origin
734 (method url-fetch)
735 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
736 version ".tar.bz2"))
737 (sha256
738 (base32
739 "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8"))))
740 (build-system gnu-build-system)
741 (arguments
742 `(#:configure-flags '("--enable-pinentry-tty")))
743 (inputs
744 `(("ncurses" ,ncurses)
745 ("libassuan" ,libassuan)
746 ("libsecret" ,libsecret "out")))
747 (native-inputs
748 `(("pkg-config" ,pkg-config)))
749 (home-page "https://gnupg.org/aegypten2/")
750 (synopsis "GnuPG's interface to passphrase input")
751 (description
752 "Pinentry provides a console that allows users to enter a passphrase when
753 @code{gpg} is run and needs it.")
754 (license license:gpl2+)
755 (properties '((ftp-server . "ftp.gnupg.org")
756 (ftp-directory . "/gcrypt/pinentry")
757 (upstream-name . "pinentry")))))
758
759 (define-public pinentry-emacs
760 (package
761 (inherit pinentry-tty)
762 (name "pinentry-emacs")
763 (arguments
764 `(#:configure-flags '("--enable-pinentry-emacs")))
765 (description
766 "Pinentry provides a console and an Emacs interface that allows users to
767 enter a passphrase when required by @code{gpg} or other software.")))
768
769 (define-public pinentry-gtk2
770 (package
771 (inherit pinentry-tty)
772 (name "pinentry-gtk2")
773 (inputs
774 `(("gtk+" ,gtk+-2)
775 ("glib" ,glib)
776 ,@(package-inputs pinentry-tty)))
777 (description
778 "Pinentry provides a console and a GTK+ GUI that allows users to enter a
779 passphrase when @code{gpg} is run and needs it.")))
780
781 (define-public pinentry-gnome3
782 (package
783 (inherit pinentry-tty)
784 (name "pinentry-gnome3")
785 (inputs
786 `(("gtk+" ,gtk+-2)
787 ("gcr" ,gcr)
788 ("glib" ,glib)
789 ,@(package-inputs pinentry-tty)))
790 (arguments
791 `(#:configure-flags '("--enable-pinentry-gnome3")))
792 (description
793 "Pinentry provides a console and a GUI designed for use with GNOME@tie{}3
794 that allows users to enter a passphrase when required by @code{gpg} or other
795 software.")))
796
797 (define-public pinentry-qt
798 (package
799 (inherit pinentry-tty)
800 (name "pinentry-qt")
801 (inputs
802 `(("qtbase" ,qtbase)
803 ,@(package-inputs pinentry-tty)))
804 (arguments
805 `(#:configure-flags '("CXXFLAGS=-std=gnu++11")))
806 (description
807 "Pinentry provides a console and a Qt GUI that allows users to enter a
808 passphrase when @code{gpg} is run and needs it.")))
809
810 (define-public pinentry
811 (package (inherit pinentry-gtk2)
812 (name "pinentry")))
813
814 (define-public paperkey
815 (package
816 (name "paperkey")
817 (version "1.5")
818 (source (origin
819 (method url-fetch)
820 (uri (string-append "http://www.jabberwocky.com/"
821 "software/paperkey/paperkey-"
822 version ".tar.gz"))
823 (sha256
824 (base32
825 "1prd2jaf4zjad3xhv160hmi5n408ssljfg7iz90jxs9w111pjwy4"))))
826 (build-system gnu-build-system)
827 (arguments
828 `(#:phases
829 (modify-phases %standard-phases
830 (add-before 'check 'patch-check-scripts
831 (lambda _
832 (substitute* '("checks/roundtrip.sh"
833 "checks/roundtrip-raw.sh")
834 (("/bin/echo") "echo"))
835 #t)))))
836 (home-page "http://www.jabberwocky.com/software/paperkey/")
837 (synopsis "Backup OpenPGP keys to paper")
838 (description
839 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
840 for printing with paper and ink, which have amazingly long retention
841 qualities. To reconstruct a secret key, you re-enter those
842 bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
843 them to transform your existing public key into a secret key.")
844 (license license:gpl2+)))
845
846 (define-public gpa
847 (package
848 (name "gpa")
849 (version "0.9.10")
850 (source (origin
851 (method url-fetch)
852 (uri (string-append "mirror://gnupg/gpa/"
853 name "-" version ".tar.bz2"))
854 (sha256
855 (base32
856 "09xphbi2456qynwqq5n0yh0zdmdi2ggrj3wk4hsyh5lrzlvcrff3"))))
857 (build-system gnu-build-system)
858 (native-inputs
859 `(("pkg-config" ,pkg-config)))
860 (inputs
861 `(("gnupg" ,gnupg)
862 ("gpgme" ,gpgme)
863 ("libassuan" ,libassuan)
864 ("libgpg-error" ,libgpg-error)
865 ("gtk+-2" ,gtk+-2)))
866 (home-page "https://gnupg.org/software/gpa/")
867 (synopsis "Graphical user interface for GnuPG")
868 (description
869 "GPA, the GNU Privacy Assistant, is a graphical user interface for
870 @uref{https://gnupg.org, GnuPG}. It can be used to encrypt, decrypt, and sign
871 files, to verify signatures, and to manage the private and public keys.")
872 (license license:gpl3+)))
873
874 (define-public parcimonie
875 (package
876 (name "parcimonie")
877 (version "0.10.3")
878 (source (origin
879 (method url-fetch)
880 (uri (string-append "https://gaffer.ptitcanardnoir.org/"
881 "intrigeri/files/parcimonie/App-Parcimonie-"
882 version ".tar.gz"))
883 (sha256
884 (base32
885 "1kf891117s1f3k6lxvbjdb21va9gxh29vlp9bd664ssgw266rcyb"))))
886 (build-system perl-build-system)
887 (inputs
888 `(("gnupg" ,gnupg-1) ; This is the version used by perl-gnupg-interface
889 ("perl-config-general" ,perl-config-general)
890 ("perl-clone" ,perl-clone)
891 ("perl-data" ,perl-data)
892 ("perl-exporter-tiny" ,perl-exporter-tiny)
893 ("perl-file-homedir" ,perl-file-homedir)
894 ("perl-file-sharedir" ,perl-file-sharedir)
895 ("perl-file-which" ,perl-file-which)
896 ("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
897 ("perl-gnupg-interface" ,perl-gnupg-interface)
898 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
899 ("perl-list-moreutils" ,perl-list-moreutils)
900 ("perl-libintl-perl" ,perl-libintl-perl) ; Locale::TextDomain
901 ("perl-lwp-online" ,perl-lwp-online)
902 ("perl-module-build" ,perl-module-build)
903 ("perl-module-pluggable-object" ,perl-module-pluggable)
904 ("perl-moo" ,perl-moo)
905 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
906 ("perl-moox-late" ,perl-moox-late)
907 ("perl-moox-options" ,perl-moox-options)
908 ("perl-namespace-clean" ,perl-namespace-clean)
909 ("perl-net-dbus" ,perl-net-dbus)
910 ("perl-net-dbus-glib" ,perl-net-dbus-glib)
911 ("perl-path-tiny" ,perl-path-tiny)
912 ("perl-test-most" ,perl-test-most)
913 ("perl-test-trap" ,perl-test-trap)
914 ("perl-time-duration" ,perl-time-duration)
915 ("perl-time-duration-parse" ,perl-time-duration-parse)
916 ("perl-try-tiny" ,perl-try-tiny)
917 ("perl-type-tiny" ,perl-type-tiny)
918 ("perl-types-path-tiny" ,perl-types-path-tiny)
919 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
920 ("perl-xml-parser" ,perl-xml-parser)
921 ("perl-xml-twig" ,perl-xml-twig)
922 ("torsocks" ,torsocks)))
923 (arguments
924 `(#:phases
925 (modify-phases %standard-phases
926 ;; Needed for using gpg-connect-agent during tests.
927 (add-before 'check 'set-HOME
928 (lambda _ (setenv "HOME" "/tmp") #t))
929 (add-before 'install 'fix-references
930 (lambda* (#:key inputs outputs #:allow-other-keys)
931 (substitute* "lib/App/Parcimonie/GnuPG/Interface.pm"
932 (("gpg2") "gpg")
933 ;; Skip check whether dependencies are in the PATH
934 (("defined which.*") "")
935 (("call\\('parcimonie-torified-gpg'\\)")
936 (string-append "call('" (assoc-ref outputs "out")
937 "/bin/parcimonie-torified-gpg')")))
938 (substitute* "bin/parcimonie-torified-gpg"
939 (("torsocks") (string-append (assoc-ref inputs "torsocks")
940 "/bin/torsocks")))
941 #t))
942 (add-after 'install 'wrap-program
943 (lambda* (#:key inputs outputs #:allow-other-keys)
944 (let* ((out (assoc-ref outputs "out"))
945 (perllib (string-append out "/lib/perl5/site_perl/"
946 ,(package-version perl))))
947 (wrap-program (string-append out "/bin/parcimonie")
948 `("PERL5LIB" ":"
949 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
950 #t))))))
951 (home-page "https://gaffer.ptitcanardnoir.org/intrigeri/code/parcimonie/")
952 (synopsis "Incrementally refreshes a GnuPG keyring")
953 (description "Parcimonie incrementaly refreshes a GnuPG keyring in a way
954 that makes it hard to correlate the keyring content to an individual, and
955 makes it hard to locate an individual based on an identifying subset of her
956 keyring content. Parcimonie is a daemon that fetches one key at a time using
957 the Tor network, waits a bit, changes the Tor circuit being used, and starts
958 over.")
959 (license license:gpl1+)))
960
961 (define-public jetring
962 (package
963 (name "jetring")
964 (version "0.27")
965 (source
966 (origin
967 (method url-fetch)
968 (uri (string-append "mirror://debian/pool/main/j/" name "/"
969 name "_" version ".tar.xz"))
970 (sha256
971 (base32
972 "0jy0x5zj7v87xgyldlsx1knzp0mv10wzamblrw1b61i2m1ii4pxz"))))
973 (build-system gnu-build-system)
974 (arguments
975 '(#:phases
976 (modify-phases %standard-phases
977 (delete 'configure) ; no configure script
978 (add-before 'install 'hardlink-gnupg
979 (lambda* (#:key inputs #:allow-other-keys)
980 (let ((gpg (string-append (assoc-ref inputs "gnupg")
981 "/bin/gpg")))
982 (substitute* (find-files "." "jetring-[[:alpha:]]+$")
983 (("gpg -") (string-append gpg " -"))
984 (("\\\"gpg\\\"") (string-append "\"" gpg "\"")))
985 #t)))
986 (replace 'install
987 (lambda* (#:key outputs #:allow-other-keys)
988 (let* ((out (assoc-ref outputs "out"))
989 (man (string-append out "/share/man")))
990 (for-each (lambda (file)
991 (install-file file (string-append out "/bin/")))
992 (find-files "." "jetring-[[:alpha:]]+$"))
993 (for-each (lambda (file)
994 (install-file file (string-append man "/man1/")))
995 (find-files "." ".*\\.1$"))
996 (install-file "jetring.7" (string-append man "/man7/"))
997 #t))))
998 #:tests? #f)) ; no test phase
999 (inputs
1000 `(("gnupg" ,gnupg)
1001 ("perl" ,perl)))
1002 (home-page "https://joeyh.name/code/jetring/")
1003 (synopsis "GnuPG keyring maintenance using changesets")
1004 (description
1005 "Jetring is a collection of tools that allow for gpg keyrings to be
1006 maintained using changesets. It was developed with the Debian keyring in mind,
1007 and aims to solve the problem that a gpg keyring is a binary blob that's hard
1008 for multiple people to collaboratively edit.
1009
1010 With jetring, changesets can be submitted, reviewed to see exactly what they
1011 will do, applied, and used to build a keyring. The origin of every change made
1012 to the keyring is available for auditing, and gpg signatures can be used for
1013 integrity guarantees.")
1014 (license license:gpl2+)))