Compare commits

...

5 commits
v1.0 ... master

Author SHA1 Message Date
4ed41d8ac7 Merge branch '07_incprefix' into 'master'
07 Incprefix

I fixed #7 but I'm still not contented with the way the installation is descriped in [INSTALL.md}(INSTALL.md).
@gesina Would you mind taking a look at this?
2015-07-17 12:35:36 +02:00
db37cdfbf5 Merge branch '07_incprefix_install' into '07_incprefix'
07 Incprefix Install

Specified the simple install instructions.
2015-07-17 12:35:08 +02:00
01c2366fef Modified INSTALL.md
- Point out the difference between passing path/incpath as arguments
   and as variables
2015-03-31 15:29:06 +02:00
Gesina Schwalbe
920132ae57 specified simple install instructions 2015-03-31 12:49:22 +02:00
3c67a33459 Fixes #7
- Introduces a second argument "INCPREFIX" used for assets
 - Updated INSTALL.md
2015-03-29 15:56:10 +02:00
2 changed files with 16 additions and 6 deletions

View file

@ -9,6 +9,10 @@ For Pizza to work, you need a running mail service (either server, smarthost or
### The simple way ### The simple way
Install Pizza by running "install.sh" from the base-directory. Install Pizza by running "install.sh" from the base-directory.
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 "<prefix>/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 ### The hard way

View file

@ -6,29 +6,35 @@
if [ "$1" ]; then if [ "$1" ]; then
PREFIX:="$1" PREFIX="$1"
else else
: ${PREFIX:="/usr/local"} : ${PREFIX:="/usr/local"}
fi fi
if [ "$2" ]; then
INCPREFIX="$2"
else
: ${INCPREFIX:="${PREFIX}/share"}
fi
# Create necessary directories # 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 if [ ! -d "$i" ]; then
mkdir -p "$i" mkdir -p "$i"
fi fi
done done
install -m 755 src/pizza "${PREFIX}/bin/pizza" 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 # 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 'Your installation path differs from /usr/local'
echo 'For pizza to run properly, please either modify the script' echo 'For pizza to run properly, please either modify the script'
echo 'or set the PIZZAINC-variable accordingly.' echo 'or set the PIZZAINC-variable accordingly.'
echo '(Add the following to your ${shell}rc:' echo '(Add the following to your ${shell}rc:'
echo -e "\t export PIZZAINC=\"${PREFIX}/share/pizza/\"" echo -e "\t export PIZZAINC=\"${INCPREFIX}/pizza/\""
echo ")" echo ")"
fi fi