dot

packages and services management
Log | Files | Refs | README

commit 866081a12f09ad7558956ce51a003579044220c7
parent e40b1d2dc1aadb786fd3d4ee8cad717c625fe42f
Author: josuah <mail@josuah.net>
Date:   Mon, 10 Oct 2016 23:32:27 -0400

Restructuring ever again

Diffstat:
RBUILD/abduco.sh -> BUILD/abduco | 0
RBUILD/ag.sh -> BUILD/ag | 0
RBUILD/bin.sh -> BUILD/bin | 0
RBUILD/byacc.sh -> BUILD/byacc | 0
RBUILD/dmenu.sh -> BUILD/dmenu | 0
RBUILD/dvtm.sh -> BUILD/dvtm | 0
RBUILD/dwm.sh -> BUILD/dwm | 0
RBUILD/fzf.sh -> BUILD/fzf | 0
RBUILD/git.sh -> BUILD/git | 0
RBUILD/isync.sh -> BUILD/isync | 0
RBUILD/less.sh -> BUILD/less | 0
RBUILD/libevent.sh -> BUILD/libevent | 0
RBUILD/libncurses.sh -> BUILD/libncurses | 0
RBUILD/libutf.sh -> BUILD/libutf | 0
RBUILD/lua.sh -> BUILD/lua | 0
RBUILD/m4.sh -> BUILD/m4 | 0
RBUILD/mmh.sh -> BUILD/mmh | 0
RBUILD/msmtp.sh -> BUILD/msmtp | 0
RBUILD/mujs.sh -> BUILD/mujs | 0
RBUILD/pcre.sh -> BUILD/pcre | 0
RBUILD/reflex.sh -> BUILD/reflex | 0
RBUILD/s-mailx.sh -> BUILD/s-mailx | 0
RBUILD/st.sh -> BUILD/st | 0
RBUILD/tmux.sh -> BUILD/tmux | 0
RBUILD/vim.sh -> BUILD/vim | 0
RBUILD/yasm.sh -> BUILD/yasm | 0
RBUILD/zsh.sh -> BUILD/zsh | 0
MSCRIPTS/build.sh | 120+++++++++++++++++++++++++++++++++++++++----------------------------------------
ASCRIPTS/config | 7+++++++
DSCRIPTS/environment | 14--------------
MSCRIPTS/link.sh | 25+++++--------------------
Rbin/config/agenda -> bin/.config/bin/agenda | 0
Rbin/config/bkm -> bin/.config/bin/bkm | 0
Rbin/config/read -> bin/.config/bin/read | 0
Rbin/config/todo -> bin/.config/bin/todo | 0
Rbin/config/urls -> bin/.config/bin/urls | 0
Rcron/config/jobs/beepnow -> cron/.config/cron/jobs/beepnow | 0
Rcron/config/jobs/checkmail -> cron/.config/cron/jobs/checkmail | 0
Rcron/config/tab -> cron/.config/cron/tab | 0
Rgit/config/config -> git/.config/git/config | 0
Rgit/config/ignore -> git/.config/git/ignore | 0
Ashell/.config/shell/environment | 46++++++++++++++++++++++++++++++++++++++++++++++
Rshell/config/functions -> shell/.config/shell/functions | 0
Dshell/config/environment | 39---------------------------------------
Rtmux/config/new-session -> tmux/.config/tmux/new-session | 0
Rtmux/config/status -> tmux/.config/tmux/status | 0
Rzathura/config/zathurarc -> zathura/.config/zathura/zathurarc | 0
47 files changed, 117 insertions(+), 134 deletions(-)

diff --git a/BUILD/abduco.sh b/BUILD/abduco diff --git a/BUILD/ag.sh b/BUILD/ag diff --git a/BUILD/bin.sh b/BUILD/bin diff --git a/BUILD/byacc.sh b/BUILD/byacc diff --git a/BUILD/dmenu.sh b/BUILD/dmenu diff --git a/BUILD/dvtm.sh b/BUILD/dvtm diff --git a/BUILD/dwm.sh b/BUILD/dwm diff --git a/BUILD/fzf.sh b/BUILD/fzf diff --git a/BUILD/git.sh b/BUILD/git diff --git a/BUILD/isync.sh b/BUILD/isync diff --git a/BUILD/less.sh b/BUILD/less diff --git a/BUILD/libevent.sh b/BUILD/libevent diff --git a/BUILD/libncurses.sh b/BUILD/libncurses diff --git a/BUILD/libutf.sh b/BUILD/libutf diff --git a/BUILD/lua.sh b/BUILD/lua diff --git a/BUILD/m4.sh b/BUILD/m4 diff --git a/BUILD/mmh.sh b/BUILD/mmh diff --git a/BUILD/msmtp.sh b/BUILD/msmtp diff --git a/BUILD/mujs.sh b/BUILD/mujs diff --git a/BUILD/pcre.sh b/BUILD/pcre diff --git a/BUILD/reflex.sh b/BUILD/reflex diff --git a/BUILD/s-mailx.sh b/BUILD/s-mailx diff --git a/BUILD/st.sh b/BUILD/st diff --git a/BUILD/tmux.sh b/BUILD/tmux diff --git a/BUILD/vim.sh b/BUILD/vim diff --git a/BUILD/yasm.sh b/BUILD/yasm diff --git a/BUILD/zsh.sh b/BUILD/zsh diff --git a/SCRIPTS/build.sh b/SCRIPTS/build.sh @@ -1,5 +1,9 @@ # Install sources from build receipes + +# VARIABLES +# ------------------------------------------------------------------------------ + PROGRAMS="${PROGRAMS:-$HOME/Programs}" PREFIX="${LOCAL:-$HOME/.local}" CONFIG="${CONFIG:-$HOME/Config}" @@ -18,7 +22,6 @@ PACKAGES" find "$CONFIG/BUILD" -type f | while read file do name="${file#$CONFIG/BUILD/}" - name="${name%.sh}" printf '\t%-12s ' "$name" sed 's/^# //; q' "$file" @@ -70,10 +73,10 @@ download() esac mkdir -p "$tmp" "$PROGRAMS/$name" - wget -O - "$tar" | tar -xv"$opt" -f - -C "$tmp" &> /dev/null + wget -O - "$tar" | tar -xv"$opt" -f - -C "$tmp" 1> /dev/null mv "$tmp/"* "$PROGRAMS/$name/src" - rm -r "$tmp" + #rm -r "$tmp" fi } @@ -99,68 +102,63 @@ index() done } +# +# Default build function +# +build() +{ + local build="$CONFIG/BUILD/$1" + + for patch in $(find "$CONFIG/$1" -name '*.diff') + do + patch -Np1 < "$patch" + done + + [ -f "$build/config.mk" ] && cp -f "$build/config.mk" . + [ -f "$build/config.h" ] && cp -f "$build/config.h" . + [ -f ./autogen.sh ] && ./autogen.sh + [ -f ./configure ] && ./configure --prefix="$PREFIX" + + make + make prefix="$PREFIX" PREFIX="$PREFIX" install clean + return 0 +} + # ALGORYTHM #------------------------------------------------------------------------------- -mkdir -p "$PROGRAMS" - -opt="$1" -while shift && [ $# -gt 0 ] -do - [ ! -f "$CONFIG/BUILD/$1.sh" ] && error "$1 has no build script" - - tar='' - - # - # Default build function - # - build() - { - local build="$CONFIG/$1/build" - - for patch in $(find "$CONFIG/$1" -name '*.diff') - do - patch -Np1 < "$patch" - done - - [ -f "$build/config.mk" ] && cp -f "$build/config.mk" . - [ -f "$build/config.h" ] && cp -f "$build/config.h" . - [ -f ./autogen.sh ] && ./autogen.sh - [ -f ./configure ] && ./configure --prefix="$PREFIX" - - make - make prefix="$PREFIX" PREFIX="$PREFIX" install clean - return 0 - } - - # Build script specific to the program, with build() and tar='...' - . "$CONFIG/build/$1.sh" - - case "$opt" in - d | download ) - download "$1" "$tar" - index "$1" - ;; - i | compile ) - [ ! -d "$PROGRAMS/$name/src" ] && download "$1" "$tar" - compile "$1" - index "$1" - ;; - r | remove ) - remove "$1" - ;; - u | update ) - remove "$1" - download "$1" - compile "$1" - index "$1" - ;; - * | '' ) - help - ;; - esac -done +mkdir -p "$PROGRAMS" "$PREFIX" + +[ $# -lt 2 ] && help +[ ! -f "$CONFIG/BUILD/$2" ] && error "$2 has no build script" + +# Build script specific to the program, with build() and tar='...' +. "$CONFIG/BUILD/$2" + +case "$1" in +-d | --download ) + download "$2" "$tar" + index "$2" + ;; +-i | --compile ) + [ ! -d "$PROGRAMS/$name/src" ] && download "$2" "$tar" + compile "$2" + index "$2" + ;; +-r | --remove ) + remove "$2" + ;; +-u | --update ) + remove "$2" + download "$2" + compile "$2" + index "$2" + ;; +* | '' ) + help + ;; +esac # Remove broken links from the index find -L "$PREFIX" -type l -exec rm {} \; diff --git a/SCRIPTS/config b/SCRIPTS/config @@ -0,0 +1,7 @@ +# ,--. ,-- * +# | ,--. ---. |- , ,--, +# | | | | | | | | | +# `--' `--' ' ' ' ' `--| 2016-10-10 +#--------------------- `--' ---------------------------------------------------- + + diff --git a/SCRIPTS/environment b/SCRIPTS/environment @@ -1,14 +0,0 @@ -# Environment variables for Config - -# You may want to source this script from your .bashrc, .zshrc, .profile...: - -# . ~/.config/config/environment - -export CONFIG="$HOME/Config" -export PROGRAMS="$HOME/Programs" -export LOCAL="$HOME/.local" - -export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" -export CPATH="$LOCAL/include:$CPATH" -export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" -export LD_RUN_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" diff --git a/SCRIPTS/link.sh b/SCRIPTS/link.sh @@ -4,33 +4,18 @@ CONFIG="${CONFIG:-$HOME/Config}" LOCAL="${LOCAL:-$LOCAL}" # -# Link files that follow XDG '.config' scheme. -# -find "$CONFIG" -type f -path '*/config/*' | while read path -do - name="${name#$CONFIG/}" - name="${name%/config}" - - file="${path#$CONFIG/$name/$xdg/}" - destination="$HOME/.$xdg/$name/$file" - - mkdir -p "$(dirname "$destination")" - ln -sf "$path" "$destination" -done - -# -# Link all other dotfiles +# Link all dotfiles # find "$CONFIG" -type f -path '*/.*' ! -path "*/.git/*" | while read path do - file="${path#$CONFIG/*/}" - destination="$HOME/.$file" + destination="$HOME/${path#$CONFIG/*/}" - mkdir -p "$(dirname "$destination")" + printf '%s\n' "$destination" + mkdir -p "${destination%/*}" ln -sf "$path" "$destination" done # # Delete dead links # -find "$HOME" -L "$PREFIX" -type l -exec rm {} \; +find -L "$HOME" -type l -exec rm {} \; diff --git a/bin/config/agenda b/bin/.config/bin/agenda diff --git a/bin/config/bkm b/bin/.config/bin/bkm diff --git a/bin/config/read b/bin/.config/bin/read diff --git a/bin/config/todo b/bin/.config/bin/todo diff --git a/bin/config/urls b/bin/.config/bin/urls diff --git a/cron/config/jobs/beepnow b/cron/.config/cron/jobs/beepnow diff --git a/cron/config/jobs/checkmail b/cron/.config/cron/jobs/checkmail diff --git a/cron/config/tab b/cron/.config/cron/tab diff --git a/git/config/config b/git/.config/git/config diff --git a/git/config/ignore b/git/.config/git/ignore diff --git a/shell/.config/shell/environment b/shell/.config/shell/environment @@ -0,0 +1,46 @@ +# ---- * | +# |__ ---. . , , .,-- ,--. ---. --.-. ,--. ---. |-- +# | | | \ / | | | | | | | | | |--' | | | +# ---- ' ' ' ' ' `--' ' ' ' ' ' `--' ' ' ' +#------------------------------------------------------------------------------- +# Environment variables + +# The right place would have been '.pam_environment', but Debian prevents +# users to set $PATH in it, considering it as a security threat. + +export EMAIL="mail@josuah.net" + + +# COMMANDS +#------------------------------------------------------------------------------- + +export EDITOR="vim" +export ALTERNATE_EDITOR="vi" +export VISUAL="${EDITOR}" +export FCEDIT="${EDITOR}" +export PAGER="more" # Within tmux, less useless +export FILTER="fzy" # Like fzy, fzf, dmenu... + + +# DIRECTORIES +#------------------------------------------------------------------------------- + +export CONFIG="$HOME/Config" +export PROGRAMS="$HOME/Programs" +export LOCAL="$HOME/.local" +export MAIL="${HOME}/Mail/INBOX" +export ENV="${HOME}/.profile" +export XDG_CONFIG_HOME="${HOME}/.config" # If it is not set by default. +export XDG_CACHE_HOME="${HOME}/.cache" +export XDG_DATA_HOME="${HOME}/.local/share" +export ABDUCO_SOCKET_DIR="${XDG_CACHE_HOME}/" # With a trailing backslash. + + +# PATHS +#------------------------------------------------------------------------------- + +export PATH="${LOCAL}/bin:${CONFIG}/bin:${PATH}" +export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" +export CPATH="$LOCAL/include:$CPATH" +export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" +export LD_RUN_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" diff --git a/shell/config/functions b/shell/.config/shell/functions diff --git a/shell/config/environment b/shell/config/environment @@ -1,39 +0,0 @@ -# ---- * | -# |__ ---. . , , .,-- ,--. ---. --.-. ,--. ---. |-- -# | | | \ / | | | | | | | | | |--' | | | -# ---- ' ' ' ' ' `--' ' ' ' ' ' `--' ' ' ' -#------------------------------------------------------------------------------- -# Environment variables - -# The right place would have been '.pam_environment', but Debian prevents -# users to set $PATH in it, considering it as a security threat. - -export EMAIL="mail@josuah.net" - - -# COMMANDS -#------------------------------------------------------------------------------- - -export EDITOR="vim" -export ALTERNATE_EDITOR="vi" -export VISUAL="${EDITOR}" -export FCEDIT="${EDITOR}" -export PAGER="more" # Within tmux, less useless -export FILTER="fzy" # Like fzy, fzf, dmenu... - - -# DIRECTORIES -#------------------------------------------------------------------------------- - -export MAIL="${HOME}/Mail/INBOX" -export ENV="${HOME}/.profile" -export XDG_CONFIG_HOME="${HOME}/.config" # If it is not set by default. -export XDG_CACHE_HOME="${HOME}/.cache" -export XDG_DATA_HOME="${HOME}/.local/share" -export ABDUCO_SOCKET_DIR="${XDG_CACHE_HOME}/" # With a trailing backslash. - - -# PATHS -#------------------------------------------------------------------------------- - -export PATH="${LOCAL}/bin:${CONFIG}/bin:${PATH}" diff --git a/tmux/config/new-session b/tmux/.config/tmux/new-session diff --git a/tmux/config/status b/tmux/.config/tmux/status diff --git a/zathura/config/zathurarc b/zathura/.config/zathura/zathurarc