From 3c67a3345958ef609309df62561232806437b8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Sun, 29 Mar 2015 15:56:10 +0200 Subject: [PATCH 1/3] Fixes #7 - Introduces a second argument "INCPREFIX" used for assets - Updated INSTALL.md --- INSTALL.md | 4 +++- install.sh | 16 +++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c8d7ac7..3d58446 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,6 +9,8 @@ For Pizza to work, you need a running mail service (either server, smarthost or ### The simple way Install Pizza by running "install.sh" from the base-directory. +install.sh takes two arguments: PREFIX (defaults to "/usr/local/") and +INCPREFIX (defaults to "$PREFIX/share"). To set INCPREFIX, passing PREFIX beforehands is mandatory! ### The hard way @@ -20,4 +22,4 @@ mkdir -p $SHAREDIR/pizza install -m 644 assets/* $SHAREDIR/pizza/ ``` -Afterwards, you have to set the variable `$PIZZAINC` to `$SHAREDIR` accordingly. \ No newline at end of file +Afterwards, you have to set the variable `$PIZZAINC` to `$SHAREDIR` accordingly. diff --git a/install.sh b/install.sh index c223806..b000307 100755 --- a/install.sh +++ b/install.sh @@ -6,29 +6,35 @@ if [ "$1" ]; then - PREFIX:="$1" + PREFIX="$1" else : ${PREFIX:="/usr/local"} fi +if [ "$2" ]; then + INCPREFIX="$2" +else + : ${INCPREFIX:="${PREFIX}/share"} +fi + # Create necessary directories -for i in "${PREFIX}/bin" "${PREFIX}/share/pizza"; do +for i in "${PREFIX}/bin" "${INCPREFIX}/share/pizza"; do if [ ! -d "$i" ]; then mkdir -p "$i" fi done install -m 755 src/pizza "${PREFIX}/bin/pizza" -install -m 644 assets/* "${PREFIX}/share/pizza/" +install -m 644 assets/* "${INCPREFIX}/share/pizza/" # Tell the user what to do next, if he used another PREFIX -if [ "${PREFIX}" != "/usr/local" ]; then +if [ "${INCPREFIX}" != "/usr/local" ]; then echo 'Your installation path differs from /usr/local' echo 'For pizza to run properly, please either modify the script' echo 'or set the PIZZAINC-variable accordingly.' echo '(Add the following to your ${shell}rc:' - echo -e "\t export PIZZAINC=\"${PREFIX}/share/pizza/\"" + echo -e "\t export PIZZAINC=\"${INCPREFIX}/pizza/\"" echo ")" fi From 920132ae5747ef8f56d8647ece833be996cb612b Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 31 Mar 2015 12:49:22 +0200 Subject: [PATCH 2/3] specified simple install instructions --- INSTALL.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 3d58446..df6de3c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,8 +9,10 @@ For Pizza to work, you need a running mail service (either server, smarthost or ### The simple way Install Pizza by running "install.sh" from the base-directory. -install.sh takes two arguments: PREFIX (defaults to "/usr/local/") and -INCPREFIX (defaults to "$PREFIX/share"). To set INCPREFIX, passing PREFIX beforehands is mandatory! +install.sh takes two arguments (values can be set via environment variables instead): +PREFIX (the path where to place the executable parts; defaults to "/usr/local/") and +INCPREFIX (the path where to place the message contents/ASCII-images; defaults to "$PREFIX/share"). +To set INCPREFIX, passing PREFIX beforehands is mandatory! ### The hard way From 01c2366feff26582c2b40b775a3c8260839c76ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Tue, 31 Mar 2015 15:29:06 +0200 Subject: [PATCH 3/3] Modified INSTALL.md - Point out the difference between passing path/incpath as arguments and as variables --- INSTALL.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index df6de3c..d9fe743 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,10 +9,10 @@ For Pizza to work, you need a running mail service (either server, smarthost or ### The simple way Install Pizza by running "install.sh" from the base-directory. -install.sh takes two arguments (values can be set via environment variables instead): -PREFIX (the path where to place the executable parts; defaults to "/usr/local/") and -INCPREFIX (the path where to place the message contents/ASCII-images; defaults to "$PREFIX/share"). -To set INCPREFIX, passing PREFIX beforehands is mandatory! +install.sh takes two arguments: a prefix (the path where to place the executable parts; defaults to "/usr/local/") and +an incprefix (the path where to place the message contents/ASCII-images; defaults to "/share"). +To set incprefix, passing prefix beforehands is mandatory! +You may also pass the environement variables "$PATH" and "$INCPATH", even though given arguments take precedence. ### The hard way