From 0715455f5bf70eaee619b60eafba58f8abded90b Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Fri, 25 Nov 2016 12:41:30 +0000 Subject: add HashDist post-install script --- tweed.hashdist.post-install | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tweed.hashdist.post-install (limited to 'tweed.hashdist.post-install') diff --git a/tweed.hashdist.post-install b/tweed.hashdist.post-install new file mode 100644 index 0000000..8d29620 --- /dev/null +++ b/tweed.hashdist.post-install @@ -0,0 +1,44 @@ +# Tweed --- Package management for engineering software +# Copyright (C) 2016 Paul Garlick +# +# Tweed is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Tweed. If not, see . + +# create a .hashdist-profile directory if it does not already exist +mkdir -p $HOME/.hashdist-profile + +# set configuration filename +CONFIG_FILE=$HOME/.hashdist-profile/hashdist.sh + +# read link to HashDist profile and confirm HashDist store location +PROFILE=default +PROFILE=$(readlink $PROFILE) +PROFILE=$(basename $PROFILE) +HASHDIST_BUILD_STORE=$(grep build_stores: -A1 ~/.hashdist/config.yaml | tail -1 | cut -f2 -d: | tr -d ' ') +if [ "x$HASHDIST_BUILD_STORE" = "x./bld" ]; then + HASHDIST_BUILD_STORE="$HOME/.hashdist/bld" +fi + +# write environment variables to configuration file +cat << EOF > $CONFIG_FILE +# HashDist configuration file +# created by $0 on $(date) + +export PROFILE="$PROFILE" +export PROFILE_INSTALL_DIR="$HASHDIST_BUILD_STORE/profile/$PROFILE" +export PATH="$PROFILE_INSTALL_DIR/bin:$PATH" +export MANPATH="$PROFILE_INSTALL_DIR/share/man:" +export CMAKE_PREFIX_PATH="$PROFILE_INSTALL_DIR:$CMAKE_PREFIX_PATH" +export PYTHONPATH="$PROFILE_INSTALL_DIR/lib/python2.7/site-packages:$PYTHONPATH" +export INSTANT_CACHE_DIR="$HOME/.cache/instant/$PROFILE" +EOF -- cgit