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