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