Fixes #7
- Introduces a second argument "INCPREFIX" used for assets - Updated INSTALL.md
This commit is contained in:
parent
6653151e1b
commit
3c67a33459
2 changed files with 14 additions and 6 deletions
|
@ -9,6 +9,8 @@ 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: PREFIX (defaults to "/usr/local/") and
|
||||||
|
INCPREFIX (defaults to "$PREFIX/share"). To set INCPREFIX, passing PREFIX beforehands is mandatory!
|
||||||
|
|
||||||
### The hard way
|
### The hard way
|
||||||
|
|
||||||
|
|
16
install.sh
16
install.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue