2017-08-27

(sph install)

program and library installer

a generic installer and installer file copy utilities

includes extra bindings for installing guile modules

part of sph-lib

usage example

"install-cli-guile" creates a command-line interface that can be distributed with files to install

$ ./install --help

parameters
  options ...
options
  --dry-run  make no changes and only show the commands that would be executed
  --help | -h
  --interface
  --mode-directory=integer  default permissions in octal notation
  --mode-regular=integer  default permissions in octal notation
  --path-lib-scheme=string  path for installed guile modules. default is "/usr/share/guile/site"
  --prefix=string  prepended to each destination path
  --symlink  create symlinks instead of file copies

contents of the file "install"

#!/usr/bin/guile
!#

(import (sph install))

(install-cli-guile ("/usr/lib" "temp/libguile-dg.so")
  ((path-lib-scheme "sph/storage") "source/dg.scm") ((path-lib-scheme "test") "test/sph"))

library description

features

  install with a specific file mode. using "cp" or the like usually uses owner and permissions

    for the current user, which might be root and undesired.

  dry-run for listing what is to be done

  optional, automatically created, command-line interface with --help and other options

  list data-structure to define sources and destinations, with some placeholders available like the default guile module directory

  option to symlink files instead of copying them, for development and updates in a versioned repository

  data structures

    destination: string:path/symbol:placeholder/install-spec

    source: destination/integer:mode-for-following

    install-spec: (destination source ...)

syntax

  install-cli-guile :: install-spec ...

    quasiquotes install-spec literals and calls install-cli-guile-p with the current program arguments

example config

  (install-cli-guile

    (path-lib-scheme "modules/sph" "modules/sph.scm")

    ("/usr/lib" "temp/libguile-sph-lib.so"))

example config with custom mode and nested paths

  (install-cli-guile

    (path-lib-scheme "modules/a" #o770 "modules/a.scm" "modules/b.scm")

    ("/usr"

      ("local"

        ("lib" "temp/libguile-a.so")

        ("bin" "temp/atool"))))

import name

(sph install)

exports

install

syntax

signature

(install-one-arguments ...) install-spec ...

install-cli-guile

syntax

signature

install-spec ...

install-cli-guile-p

procedure

signature

program-arguments install-specs ->

((list/string string ...) ...) -> boolean:success-status

description

a command-line interface for installation scripts for guile based projects.

currently depends on the common "cp" utility.

parses command-line arguments and installs source files to destinations given via "install-specs".

can install multiple files and directories with default or customised filesystem permissions.

the symbol "path-lib-scheme" can be used as a placeholder in "install-specs".

see also "install".

usage example:

(install-cli-guile-p (tail (program-arguments))

(list

(list ("/usr/lib" "temp/libguile-dg.so"))

(list (list (quote path-lib-scheme) "test") "test/sph")))

install-one

procedure

signature

destination sources #:path-destination-prefix #:symlink? #:mode-directory #:mode-regular #:dry-run? ->

description

automatically creates missing directories in destination and sets permissions.

prepends path-destination-prefix to all target paths.

symlinks source files instead of copying if "symlink?" is true.

currently depends on the "cp" utility

install-p

procedure

signature

install-one-arguments install-specs ->

list list -> boolean

description

install multiple files or directory trees with files.

automatically creates missing destination directories and sets file

permissions to default or custom specified values.

currently depends on the "cp" utility.

allows empty lists in install-specs for conditional values

sph-install-description

variable

tags: programming guile documentation library scheme sph-lib q1 install highlight sph-install