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