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 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 Mark H Weaver <mhw@netris.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages gnupg)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages curl)
25 #:use-module (gnu packages openldap)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages pth)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages readline)
30 #:use-module ((gnu packages compression) #:prefix guix:)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages ncurses)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix build-system gnu))
38
39 (define-public libgpg-error
40 (package
41 (name "libgpg-error")
42 (version "1.18")
43 (source
44 (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
47 version ".tar.bz2"))
48 (sha256
49 (base32
50 "0408v19h3h0q6w61g51hgbdg6cyw81nyzkh70qfprvsc3pkddwcz"))))
51 (build-system gnu-build-system)
52 (home-page "http://gnupg.org")
53 (synopsis "Library of error values for GnuPG components")
54 (description
55 "Libgpg-error is a small library that defines common error values
56 for all GnuPG components. Among these are GPG, GPGSM, GPGME,
57 GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
58 Daemon and possibly more in the future.")
59 (license lgpl2.0+)))
60
61 (define-public libgcrypt
62 (package
63 (name "libgcrypt")
64 (version "1.6.2")
65 (source (origin
66 (method url-fetch)
67 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
68 version ".tar.bz2"))
69 (sha256
70 (base32
71 "0k2wi34qhp5hq71w1ab3kw1gfsx7xff79bvynqkxp35kls94826y"))))
72 (build-system gnu-build-system)
73 (propagated-inputs
74 `(("libgpg-error-host" ,libgpg-error)))
75 (native-inputs
76 ;; Needed here for the 'gpg-error' program.
77 `(("libgpg-error-native" ,libgpg-error)))
78 (arguments
79 ;; The '--with-gpg-error-prefix' argument is needed because otherwise
80 ;; 'configure' uses 'gpg-error-config' to determine the '-L' flag, and
81 ;; the 'gpg-error-config' it runs is the native one---i.e., the wrong one.
82 `(#:configure-flags
83 (list (string-append "--with-gpg-error-prefix="
84 (assoc-ref %build-inputs "libgpg-error-host")))))
85 (outputs '("out" "debug"))
86 (home-page "http://gnupg.org/")
87 (synopsis "Cryptographic function library")
88 (description
89 "Libgcrypt is a general-purpose cryptographic library. It provides the
90 standard cryptographic building blocks such as symmetric ciphers, hash
91 algorithms, public key algorithms, large integer functions and random number
92 generation.")
93 (license lgpl2.0+)))
94
95 (define-public libgcrypt-1.5
96 (package (inherit libgcrypt)
97 (version "1.5.4")
98 (source
99 (origin
100 (method url-fetch)
101 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
102 version ".tar.bz2"))
103 (sha256
104 (base32
105 "0czvqxkzd5y872ipy6s010ifwdwv29sqbnqc4pf56sd486gqvy6m"))))))
106
107 (define-public libassuan
108 (package
109 (name "libassuan")
110 (version "2.2.0")
111 (source
112 (origin
113 (method url-fetch)
114 (uri (string-append "mirror://gnupg/libassuan/libassuan-"
115 version ".tar.bz2"))
116 (sha256
117 (base32
118 "1ikf9whfi7rg71qa610ynyv12qrw20zkn7zxgvvr9dp41gbqxxbx"))))
119 (build-system gnu-build-system)
120 (propagated-inputs
121 `(("libgpg-error" ,libgpg-error) ("pth" ,pth)))
122 (home-page "http://gnupg.org")
123 (synopsis
124 "IPC library used by GnuPG and related software")
125 (description
126 "Libassuan is a small library implementing the so-called Assuan
127 protocol. This protocol is used for IPC between most newer
128 GnuPG components. Both, server and client side functions are
129 provided.")
130 (license lgpl2.0+)))
131
132 (define-public libksba
133 (package
134 (name "libksba")
135 (version "1.3.2")
136 (source
137 (origin
138 (method url-fetch)
139 (uri (string-append
140 "mirror://gnupg/libksba/libksba-"
141 version ".tar.bz2"))
142 (sha256
143 (base32
144 "01l4hvcknk9nb4bvyb6aqaid19jg0wv3ik54j1b89hnzamwm75gb"))))
145 (build-system gnu-build-system)
146 (propagated-inputs
147 `(("libgpg-error" ,libgpg-error)))
148 (native-inputs
149 `(("libgpg-error" ,libgpg-error)))
150 (arguments
151 `(#:configure-flags
152 (list ,@(if (%current-target-system)
153 '("CC_FOR_BUILD=gcc")
154 '())
155 (string-append "--with-gpg-error-prefix="
156 (assoc-ref %build-inputs "libgpg-error")))))
157 (home-page "http://www.gnupg.org")
158 (synopsis "CMS and X.509 access library")
159 (description
160 "KSBA (pronounced Kasbah) is a library to make X.509 certificates
161 as well as the CMS easily accessible by other applications. Both
162 specifications are building blocks of S/MIME and TLS.")
163 (license gpl3+)))
164
165 (define-public npth
166 (package
167 (name "npth")
168 (version "1.1")
169 (source
170 (origin
171 (method url-fetch)
172 (uri (string-append
173 "mirror://gnupg/npth/npth-"
174 version ".tar.bz2"))
175 (sha256
176 (base32
177 "0zyzwmk4mp6pas87jz35zx0jvwdz7x5b13w225gs73gcn8g5cv49"))))
178 (build-system gnu-build-system)
179 (home-page "http://www.gnupg.org")
180 (synopsis "Non-preemptive thread library")
181 (description
182 "Npth is a library to provide the GNU Pth API and thus a non-preemptive
183 threads implementation.
184
185 In contrast to GNU Pth is is based on the system's standard threads
186 implementation. This allows the use of libraries which are not
187 compatible to GNU Pth.")
188 (license (list lgpl3+ gpl2+)))) ; dual license
189
190 (define-public gnupg
191 (package
192 (name "gnupg")
193 (version "2.1.2")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
197 ".tar.bz2"))
198 (sha256
199 (base32
200 "14k7c5spai3yppz6izf1ggbnffskl54ln87v1wgy9pwism1mlks0"))))
201 (build-system gnu-build-system)
202 (inputs
203 `(("bzip2" ,guix:bzip2)
204 ("curl" ,curl)
205 ("libassuan" ,libassuan)
206 ("libgcrypt" ,libgcrypt)
207 ("libgpg-error" ,libgpg-error)
208 ("libksba" ,libksba)
209 ("npth" ,npth)
210 ("openldap" ,openldap)
211 ("zlib" ,guix:zlib)
212 ("readline" ,readline)))
213 (arguments
214 `(#:phases
215 (alist-cons-before
216 'configure 'patch-config-files
217 (lambda _
218 (substitute* "tests/openpgp/defs.inc"
219 (("/bin/pwd") (which "pwd"))))
220 %standard-phases)))
221 (home-page "http://gnupg.org/")
222 (synopsis "GNU Privacy Guard")
223 (description
224 "The GNU Privacy Guard is a complete implementation of the OpenPGP
225 standard. It is used to encrypt and sign data and communication. It
226 features powerful key management and the ability to access public key
227 servers. It includes several libraries: libassuan (IPC between GnuPG
228 components), libgpg-error (centralized GnuPG error values), and
229 libskba (working with X.509 certificates and CMS data).")
230 (license gpl3+)))
231
232 (define-public gnupg-2.0
233 (package (inherit gnupg)
234 (version "2.0.26")
235 (source (origin
236 (method url-fetch)
237 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
238 ".tar.bz2"))
239 (sha256
240 (base32
241 "1q5qcl5panrvcvpwvz6nl9gayl5a6vwvfhgdcxqpmbl2qc6y6n3p"))))
242 (inputs
243 `(("bzip2" ,guix:bzip2)
244 ("curl" ,curl)
245 ("libassuan" ,libassuan)
246 ("libgcrypt" ,libgcrypt)
247 ("libgpg-error" ,libgpg-error)
248 ("libksba" ,libksba)
249 ("pth" ,pth)
250 ("openldap" ,openldap)
251 ("zlib" ,guix:zlib)
252 ("readline" ,readline)))
253 (arguments
254 `(#:phases
255 (alist-cons-before
256 'configure 'patch-config-files
257 (lambda _
258 (substitute* "tests/openpgp/Makefile.in"
259 (("/bin/sh") (which "bash"))))
260 %standard-phases)))))
261
262 (define-public gnupg-1
263 (package (inherit gnupg)
264 (version "1.4.18")
265 (source (origin
266 (method url-fetch)
267 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
268 ".tar.bz2"))
269 (sha256
270 (base32
271 "1233bppjvdpbbl425ii6l7xvgy0879ghhnmwrph5b6c4g3dgvddp"))))
272 (inputs
273 `(("zlib" ,guix:zlib)
274 ("bzip2" ,guix:bzip2)
275 ("curl" ,curl)
276 ("readline" ,readline)
277 ("libgpg-error" ,libgpg-error)))
278 (arguments
279 `(#:phases (alist-cons-after
280 'unpack 'patch-check-sh
281 (lambda _
282 (substitute* "checks/Makefile.in"
283 (("/bin/sh") (which "bash"))))
284 %standard-phases)))))
285
286 (define-public gpgme
287 (package
288 (name "gpgme")
289 (version "1.5.3")
290 (source
291 (origin
292 (method url-fetch)
293 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
294 ".tar.bz2"))
295 (sha256
296 (base32
297 "1jgwmra6cf0i5x2prj92w77vl7hmj276qmmll3lwysbyn32l1c0d"))))
298 (build-system gnu-build-system)
299 (propagated-inputs
300 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
301 `(("libgpg-error" ,libgpg-error)))
302 (inputs
303 `(("gnupg" ,gnupg)
304 ("libassuan" ,libassuan)))
305 (arguments '(#:make-flags '("GPG=gpg2")))
306 (home-page "http://www.gnupg.org/related_software/gpgme/")
307 (synopsis "Library providing simplified access to GnuPG functionality")
308 (description
309 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
310 easier for applications. It provides a High-Level Crypto API for encryption,
311 decryption, signing, signature verification and key management. Currently
312 it uses GnuPG as its backend but the API isn't restricted to this engine.
313
314 Because the direct use of GnuPG from an application can be a complicated
315 programming task, it is suggested that all software should try to use GPGME
316 instead. This way bug fixes or improvements can be done at a central place
317 and every application benefits from this.")
318 (license lgpl2.1+)))
319
320 (define-public pius
321 (package
322 (name "pius")
323 (version "2.0.11")
324 (source (origin
325 (method url-fetch)
326 (uri (string-append "mirror://sourceforge/pgpius/pius/"
327 version "/pius-"
328 version ".tar.bz2"))
329 (sha256 (base32
330 "0pdbyqz6k0bm182cz81ss7yckmpms5qhrrw0wcr4a1srzcjyzf5f"))))
331 (build-system gnu-build-system)
332 (inputs `(("perl" ,perl)
333 ("python" ,python-2) ; uses the Python 2 'print' syntax
334 ("gpg" ,gnupg)))
335 (arguments
336 `(#:tests? #f
337 #:phases
338 (alist-delete
339 'configure
340 (alist-delete
341 'build
342 (alist-replace
343 'install
344 (lambda* (#:key inputs outputs #:allow-other-keys)
345 (let* ((out (assoc-ref outputs "out"))
346 (gpg (string-append (assoc-ref inputs "gpg")
347 "/bin/gpg2")))
348 (mkdir out)
349 (mkdir (string-append out "/bin"))
350 (for-each (lambda (file)
351 (substitute* file
352 (("/usr/bin/gpg") gpg))
353 (copy-file file (string-append out "/bin/" file)))
354 '("pius" "pius-keyring-mgr" "pius-party-worksheet"))))
355 %standard-phases)))))
356 (synopsis "Programs to simplify GnuPG key signing")
357 (description
358 "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
359 parties. It is the main utility and makes it possible to quickly and easily
360 sign each UID on a set of PGP keys. It is designed to take the pain out of
361 the sign-all-the-keys part of PGP Keysigning Party while adding security
362 to the process.
363
364 pius-keyring-mgr and pius-party-worksheet help organisers of
365 PGP keysigning parties.")
366 (license gpl2)
367 (home-page "http://www.phildev.net/pius/index.shtml")))
368
369 (define-public signing-party
370 (package
371 (name "signing-party")
372 (version "1.1.4")
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "http://ftp.debian.org/debian/pool/main/s/signing-party/signing-party_"
376 version ".orig.tar.gz"))
377 (sha256 (base32
378 "188gp0prbh8qs29lq3pbf0qibfd6jq4fk7i0pfrybl8aahvm84rx"))))
379 (build-system gnu-build-system)
380 (inputs `(("perl" ,perl)))
381 (arguments
382 `(#:tests? #f
383 #:phases
384 (alist-cons-after
385 'unpack 'remove-spurious-links
386 (lambda _ (delete-file "keyanalyze/pgpring/depcomp"))
387 (alist-replace
388 'configure
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let ((out (assoc-ref outputs "out")))
391 (substitute* "keyanalyze/Makefile"
392 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
393 (substitute* "keyanalyze/Makefile"
394 (("./configure") (string-append "./configure --prefix=" out)))
395 (substitute* "keyanalyze/pgpring/configure"
396 (("/bin/sh") (which "bash")))
397 (substitute* "gpgwrap/Makefile"
398 (("\\} clean") (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
399 out "/bin/gpgwrap\n")))
400 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
401 "keylookup/Makefile" "sig2dot/Makefile"
402 "springgraph/Makefile")
403 (("/usr") out))))
404 (alist-replace
405 'install
406 (lambda* (#:key outputs #:allow-other-keys #:rest args)
407 (let ((out (assoc-ref outputs "out"))
408 (install (assoc-ref %standard-phases 'install)))
409 (apply install args)
410 (for-each
411 (lambda (dir file)
412 (copy-file (string-append dir "/" file)
413 (string-append out "/bin/" file)))
414 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
415 "gpglist" "gpg-mailkeys" "gpgparticipants")
416 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
417 "gpglist" "gpg-mailkeys" "gpgparticipants"))
418 (for-each
419 (lambda (dir file)
420 (copy-file (string-append dir "/" file)
421 (string-append out "/share/man/man1/" file)))
422 '("caff" "caff" "caff" "gpgdir"
423 "gpg-key2ps" "gpglist" "gpg-mailkeys"
424 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
425 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
426 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
427 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
428 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
429 "process_keys.1" "pgpring.1" "keyanalyze.1"))))
430 %standard-phases)))))
431 (synopsis "Collection of scripts for simplifying gnupg key signing")
432 (description
433 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
434 including tools for signing keys, keyring analysis, and party preparation.
435
436 * caff: CA - Fire and Forget signs and mails a key
437
438 * pgp-clean: removes all non-self signatures from key
439
440 * pgp-fixkey: removes broken packets from keys
441
442 * gpg-mailkeys: simply mail out a signed key to its owner
443
444 * gpg-key2ps: generate PostScript file with fingerprint paper strips
445
446 * gpgdir: recursive directory encryption tool
447
448 * gpglist: show who signed which of your UIDs
449
450 * gpgsigs: annotates list of GnuPG keys with already done signatures
451
452 * gpgparticipants: create list of party participants for the organiser
453
454 * gpgwrap: a passphrase wrapper
455
456 * keyanalyze: minimum signing distance (MSD) analysis on keyrings
457
458 * keylookup: ncurses wrapper around gpg --search
459
460 * sig2dot: converts a list of GnuPG signatures to a .dot file
461
462 * springgraph: creates a graph from a .dot file")
463 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
464 ;; and caff and gpgsigs: bsd-3, see
465 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
466 (license gpl2)
467 (home-page "http://pgp-tools.alioth.debian.org/")))
468
469 (define-public pinentry
470 (package
471 (name "pinentry")
472 (version "0.9.0")
473 (source (origin
474 (method url-fetch)
475 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
476 version ".tar.bz2"))
477 (sha256
478 (base32
479 "1awhajq21hcjgqfxg9czaxg555gij4bba6axrwg8w6lfmc3ml14h"))))
480 (build-system gnu-build-system)
481 (inputs
482 `(("ncurses" ,ncurses)
483 ("gtk+" ,gtk+-2)
484 ("glib" ,glib)))
485 (native-inputs
486 `(("pkg-config" ,pkg-config)))
487 (home-page "http://gnupg.org/aegypten2/")
488 (synopsis "GnuPG's interface to passphrase input")
489 (description
490 "Pinentry provides a console and a GTK+ GUI that allows users to
491 enter a passphrase when `gpg' or `gpg2' is run and needs it.")
492 (license gpl2+)))
493
494 (define-public paperkey
495 (package
496 (name "paperkey")
497 (version "1.3")
498 (source (origin
499 (method url-fetch)
500 (uri (string-append "http://www.jabberwocky.com/"
501 "software/paperkey/paperkey-"
502 version ".tar.gz"))
503 (sha256
504 (base32
505 "1yybj8bj68v4lxwpn596b6ismh2fyixw5vlqqg26byrn4d9dfmsv"))))
506 (build-system gnu-build-system)
507 (arguments
508 `(#:phases
509 (alist-cons-before
510 'check 'patch-check-scripts
511 (lambda _
512 (substitute* '("checks/roundtrip.sh"
513 "checks/roundtrip-raw.sh")
514 (("/bin/echo") "echo")))
515 %standard-phases)))
516 (home-page "http://www.jabberwocky.com/software/paperkey/")
517 (synopsis "Backup OpenPGP keys to paper")
518 (description
519 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
520 for printing with paper and ink, which have amazingly long retention
521 qualities. To reconstruct a secret key, you re-enter those
522 bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
523 them to transform your existing public key into a secret key.")
524 (license gpl2+)))