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