[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging "single file"

From: Jack Hill
Subject: Re: Packaging "single file"
Date: Mon, 4 Nov 2019 17:37:23 -0500 (EST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)

On Mon, 4 Nov 2019, Tanguy Le Carrour wrote:

Hi Guix!

I intended to ask this question later, but now that ungoogled-chromium
has been superseded by icecat, I find myself stuck!

Is it possible to package a single file? The "file" being a bash script or
a binary. Is there a package definition I can look into for an example?

I've had a need to package a bash wrapper around scp, and the module with it is below. It it, I use the trivial-build-system, and replaced occurrences of commands the script calls with full store paths.

Does this help? Where are you getting stuck?


(define-module (guix-at-duke packages utils)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages ssh)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))

(define-public duo-scp
   (name "duo-scp")
   (version "0")
     (method url-fetch)
     (uri "";)
      (base32 "1mrf5451cj8010iq76866dli1hxa31rk8i993arf9dfyzws26v2b"))
     (file-name name)))
   (build-system trivial-build-system)
    `(#:modules ((guix build utils))
        (use-modules (guix build utils))
        (let ((source (assoc-ref %build-inputs "source"))
              (ssh (assoc-ref %build-inputs "openssh"))
              (bash (assoc-ref %build-inputs "bash"))
              (script "duo-scp")
              (out (assoc-ref %outputs "out")))
          (copy-file source script)
          (substitute* script
                       (("/bin/bash") (string-append bash "/bin/bash"))
                       (("scp") (string-append ssh "/bin/scp")))
          (chmod script #o555)
          (install-file script (string-append out "/bin"))))))
    `(("bash" ,bash)
      ("openssh" ,openssh)))
   (home-page "";)
   (synopsis "User Duo Passcode with scp and login_duo")
   (description "Wrapper script for scp that prompts for a passcode
before calling scp.  This allows the user to supply a passcode from e.g. a 
to avoid getting a Duo push or phone call when talking to an ssh server that 
the login_duo script for multifactor.")
   (license license:cc0)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]