unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#31839] [PATCH] gnu: Add dehydrated.
@ 2018-06-15  1:05 Clément Lassieur
  2018-06-16 16:10 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Clément Lassieur @ 2018-06-15  1:05 UTC (permalink / raw)
  To: 31839

* gnu/packages/tls.scm (dehydrated): New variable.
---
 gnu/packages/tls.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index a934a5087..b54cd1526 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,10 +39,14 @@
   #:use-module (guix build-system python)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system haskell)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages dns)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages haskell-check)
@@ -873,3 +878,69 @@ implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and
 Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many
 extensions.")
     (license license:bsd-3)))
+
+(define-public dehydrated
+  (package
+    (name "dehydrated")
+    (version "0.6.2")
+    (source (origin
+              (method url-fetch/tarbomb)
+              (uri (string-append
+                    "https://github.com/lukas2511/dehydrated/archive/v"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "03p80yj6bnzjc6dkp5hb9wpplmlrla8n5src71cnzw4rj53q8cqn"))
+              (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let* ((source (assoc-ref %build-inputs "source"))
+                (out (assoc-ref %outputs "out"))
+                (bin (string-append out "/bin"))
+                (bash (in-vicinity (assoc-ref %build-inputs "bash") "bin")))
+           (mkdir-p bin)
+           (with-directory-excursion bin
+             (copy-file
+              (in-vicinity source (string-append "/dehydrated-" ,version
+                                                 "/dehydrated"))
+              (in-vicinity bin "dehydrated"))
+             (patch-shebang "dehydrated" (list bash))
+
+             ;; Do not try to write in the store.
+             (substitute* "dehydrated"
+               (("SCRIPTDIR=\"\\$.*\"") "SCRIPTDIR=~/.dehydrated"))
+
+             (setenv "PATH" bash)
+             (wrap-program "dehydrated"
+               `("PATH" ":" prefix
+                 ,(map (lambda (dir)
+                         (string-append dir "/bin"))
+                       (map (lambda (input)
+                              (assoc-ref %build-inputs input))
+                            '("coreutils"
+                              "curl"
+                              "diffutils"
+                              "gawk"
+                              "grep"
+                              "openssl"
+                              "sed"))))))
+           #t))))
+    (inputs
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("curl" ,curl)
+       ("diffutils" ,diffutils)
+       ("gawk" ,gawk)
+       ("grep" ,grep)
+       ("openssl" ,openssl)
+       ("sed" ,sed)))
+    (home-page "https://dehydrated.io/")
+    (synopsis "Let's Encrypt/ACME client implemented as a shell script")
+    (description "Dehydrated is a client for signing certificates with an
+ACME-server (currently only provided by Let's Encrypt) implemented as a
+relatively simple Bash script.")
+    (license license:expat)))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#31839] [PATCH] gnu: Add dehydrated.
  2018-06-15  1:05 [bug#31839] [PATCH] gnu: Add dehydrated Clément Lassieur
@ 2018-06-16 16:10 ` Ludovic Courtès
  2018-06-16 18:47   ` bug#31839: " Clément Lassieur
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-06-16 16:10 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 31839

Salut Clément,

Clément Lassieur <clement@lassieur.org> skribis:

> * gnu/packages/tls.scm (dehydrated): New variable.

LGTM, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#31839: [PATCH] gnu: Add dehydrated.
  2018-06-16 16:10 ` Ludovic Courtès
@ 2018-06-16 18:47   ` Clément Lassieur
  0 siblings, 0 replies; 3+ messages in thread
From: Clément Lassieur @ 2018-06-16 18:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31839-done

Ludovic Courtès <ludo@gnu.org> writes:

> Salut Clément,
>
> Clément Lassieur <clement@lassieur.org> skribis:
>
>> * gnu/packages/tls.scm (dehydrated): New variable.
>
> LGTM, thanks!
>
> Ludo'.

Pushed, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-16 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15  1:05 [bug#31839] [PATCH] gnu: Add dehydrated Clément Lassieur
2018-06-16 16:10 ` Ludovic Courtès
2018-06-16 18:47   ` bug#31839: " Clément Lassieur

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).