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