dot

packages and services management
Log | Files | Refs | README

commit bca1277d04450228507d85baccb402536dc64b42
parent dec96afe664bad7d115896235c6ffeb1a48abb7b
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 28 Apr 2017 00:03:53 +0200

updated build.1

Diffstat:
M.profile | 24+++++++++++++++++++++---
Mbin/build | 5+++--
Mman/build.1 | 116++++++++++++++++++++++++++++++++++---------------------------------------------
3 files changed, 74 insertions(+), 71 deletions(-)

diff --git a/.profile b/.profile @@ -1,33 +1,45 @@ -# --- plan 9 ------------------------------------------------------------------- +# plan 9 + PLAN9="$HOME/9" export PLAN9 -# --- build packages ----------------------------------------------------------- + +# build packages + OPT="$HOME/opt" SRC="$HOME/src" ETC="$HOME/etc" ROOT="$HOME/.local" export OPT SRC ETC ROOT + # paths + +ENV="$HOME/.profile" PATH="$ETC/bin:$ROOT/sbin:$ROOT/bin:$PATH:$PLAN9/bin" MANPATH="$ETC/man:$ROOT/share/man:$ROOT/man:$MANPATH" MAIL="$HOME/mail/INBOX" -export PATH MANPATH MAIL +export ENV PATH MANPATH MAIL + # libraries + LIBPATH="$ROOT/lib:$LIBPATH" LD_RUN_PATH="$ROOT/lib:$LD_RUN_PATH" LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" export MANPATH LIBPATH LD_RUN_PATH LD_LIBRARY_PATH + # info + NAME='Josuah Demangeon' EMAIL='mail@josuah.net' TZ='Europe/Paris' export NAME EMAIL TZ + # default commands + EDITOR='vis' VISUAL='vis' PAGER='less' @@ -36,7 +48,9 @@ DVTM_PAGER='less -R' BROWSER='chromium' export EDITOR VISUAL PAGER MANPAGER DVTM_PAGER BROWSER + # prompts + PS1=' $(date +"[%H:%M]" ) $PWD/$(git-status)${SSH_TTY:+ $(hostname)}${ABDUCO:+ $ABDUCO} ${?#0} @@ -45,12 +59,16 @@ PS2=' ❯ ' PS3=' ❯ ' export PS1 PS2 PS3 + # startup + case "$(tty)" in ( /dev/tty* ) setfont "$ETC/consolefonts/lode-16.psf" printf '\033]P0000000\033]P7ffddaa\033[J' # color theme ;; esac + # aliases + . "$ETC/alias" diff --git a/bin/build b/bin/build @@ -22,7 +22,8 @@ build() compile() { - PREFIX="$OPT/$1" + PREFIX="$OPT/$1" + export PREFIX cd "$PREFIX" && mkdir -p bin doc etc include lib libexec share man cd "$SRC/$1" || exit 1 @@ -59,7 +60,7 @@ download() remove() { - rm -rf "${OPT:?}/$1" + rm -rf "${OPT:?}/$1" "${SRC:?}/$1" find -L "$ROOT" -type l -exec rm {} \; } diff --git a/man/build.1 b/man/build.1 @@ -18,8 +18,6 @@ .Op Fl i Ar pkg .Op Fl r Ar pkg .Op Fl u Ar pkg -.Op Fl l -.Op Fl v . . .Sh DESCRIPTION @@ -29,6 +27,28 @@ helps with the compilation of software in the home directory of an user. It downloads an archive from a specified URL and extracts it. . +.Pp +. +Every program is installed in its own subdirectory in +.Ev SRC , +then every file is linked to a global index in +.Ev OPT . +. +.Pp +. +The +.Ev PATH , +.Ev MANPATH , +.Ev LIBPATH , +.Ev LD_RUN_PATH , +.Ev LD_LIBRARY_PATH , +may be updated to the location of the +.Pa bin , +.Pa man , +.Pa lib +subdirectories of this index. +.Pp +. .Bl -tag -width indent . .It Fl d Ar pkg @@ -50,60 +70,27 @@ Delete, then download and install .Ar pkg again. . -.It Fl l -Update links from -.Ev PROGRAMS -to -.Ev LOCAL . -. -.It Fl v -View the list of available packages. -. .El . . .Sh ENVIRONMENT . . -Every program is installed in its own directory, then every file is -linked to a global index. -. -The -.Ev PATH -and -.Ev MANPATH -have to be updated to the location of the -.Pa bin -and -.Pa man -subdirectories of this index in order to access the binaries and manual -pages interactively. -.Pp -This can be done by sourcing -.Nm -as a regular shell script, with the command: -. -.Bd -literal -offset indent -\&. path/to/build -.Ed -. -.Pp +.Bl -tag -width indent . -This will export the following environment variables: +.It Ev ROOT +Directory the files get linked into. . -.Bl -column xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +.It Ev ETC +Directory containing the +.Pa ./build +directory. . -.It Sy Name Ta Sy Default value +.It Ev SRC +Directory containing the sources of programs. . -.It Ev LOCAL Ta Pa $HOME/.local -.It Ev CONFIG Ta Pa $HOME/.config -.It Ev PROGRAMS Ta Pa $HOME/programs -.It Ev PATH Ta Pa $LOCAL/sbin:$LOCAL/bin:$PATH -.It Ev MANPATH Ta Pa $LOCAL/share/man:$LOCAL/man:$MANPATH -.It Ev CPATH Ta Pa $LOCAL/include:$CPATH -.It Ev LIBPATH Ta Pa $LOCAL/lib:$LIBPATH -.It Ev LD_RUN_PATH Ta Pa $LOCAL/lib:$LD_RUN_PATH -.It Ev LD_LIBRARY_PATH Ta Pa $LOCAL/lib:$LD_LIBRARY_PATH +.It Ev OPT +Directory programs get build into. . .El . @@ -111,28 +98,25 @@ This will export the following environment variables: .Sh FILES . . -The packages descriptions, URLs, and build rules are stored into files, stored into the -.Pa $CONFIG/build -directory, with one file per package. -.Pp -These are shell scripts sourced by -.Nm -, and their format is as following: -. -.Bd -literal -offset indent -# single line description (no shebang) - -tar=http://url.to/package.tar.gz - -build() { - # Optionnal build recipe -} -.Ed +.Bl -tag -width indent . -.Pp +.It Pa $ETC/build/ +Contains one subdirectory per package. . -The build recipe is optionnal, and if it is not provided, a default -build recipe will be used instead. +.It Pa $ETC/build/*/build.sh +Build recipes executed at build time. If none exist for a given package, +a default recipe is used. +. +.It Pa $ETC/build/*/url +File containing the url to download the archive, in the +.Pa .tar , +.Pa .tar.gz , +.Pa .tar.bz2 +or +.Pa .tar.xz +format. +. +.El . . .Sh AUTHOR