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