dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

emacs-install (677B)


      1 #!/bin/bash
      2 
      3 set -eux
      4 
      5 build_dir=${EMACS_BUILD:-.}
      6 apps_dir=~/apps
      7 
      8 cd "${build_dir}"
      9 make install
     10 
     11 # For peace of mind, to make rollbacks trivial, I usually add a date
     12 # to --prefix, and use a symlink to pick a known-good installation.
     13 #
     14 # So if this build is configured to install under ~/apps, assume we
     15 # are following this practice & update the symlink.
     16 
     17 prefix_dir=$(
     18     # Many ways to do this.  Parsing 'config.status --config' might be
     19     # TRT in principle?  For simplicity, just:
     20     sed -n s/'^prefix *= *'//p Makefile
     21 )
     22 
     23 case ${prefix_dir}
     24 in
     25     ${apps_dir}/*) target=${prefix_dir##${apps_dir}/} ;;
     26     *) exit ;;
     27 esac
     28 
     29 cd ${apps_dir}
     30 ln -fsvT "${target}" emacs