v3.1.1 - Improved error handling and new build system
This commit is contained in:
parent
1c62bd5b19
commit
64e58daf40
5
README
5
README
@ -43,9 +43,10 @@ Copy install.conf.def to install.conf
|
|||||||
$ mv install.conf.def install.conf
|
$ mv install.conf.def install.conf
|
||||||
|
|
||||||
Make necessary adjustments to install.conf, then run
|
Make necessary adjustments to install.conf, then run
|
||||||
INSTALL.sh as root.
|
build.sh as root.
|
||||||
|
|
||||||
# ./INSTALL.sh
|
# ./build.sh install # for first time installations
|
||||||
|
# ./build.sh update # for existing installations
|
||||||
|
|
||||||
+-----------------+
|
+-----------------+
|
||||||
| [>_] Usage [>_] |
|
| [>_] Usage [>_] |
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
|
||||||
printf "must be run as root\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
WORKING_DIR=$(pwd)
|
|
||||||
SRC_DIR=$(pwd)/../src
|
|
||||||
|
|
||||||
printf "parsing install.conf\n"
|
|
||||||
source $WORKING_DIR/install.conf
|
|
||||||
if [ "$?" != 0 ]; then
|
|
||||||
printf "install.conf not found\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
printf "installing executable\n"
|
|
||||||
mv $SRC_DIR/glacier $PREFIX/bin
|
|
||||||
if [ "$?" != 0 ]; then
|
|
||||||
mv $SRC_DIR/glacier $PREFIX
|
|
||||||
printf "directory $PREFIX/bin does not exist, moving to $PREFIX instead\n"
|
|
||||||
fi
|
|
||||||
printf "installing configuration files\n"
|
|
||||||
mv $SRC_DIR/glacier.conf $CONFDIR
|
|
||||||
if [ "$?" != 0 ]; then
|
|
||||||
printf "$CONFDIR does not exist\n"
|
|
||||||
printf "this can be corrected by running:\n"
|
|
||||||
printf "# mkdir -pv $CONFDIR\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir /opt/glacier
|
|
||||||
mkdir /opt/glacier/workspace
|
|
||||||
mkdir /var/log/glacier
|
|
||||||
mkdir /var/cache/glacier
|
|
||||||
|
|
||||||
mkdir /etc/glacier
|
|
||||||
mkdir /etc/glacier/pkginfo
|
|
||||||
|
|
||||||
mv $SRC_DIR/hooks $CONFDIR/glacier
|
|
||||||
mv $SRC_DIR/post-hooks $CONFDIR/glacier
|
|
||||||
mv $SRC_DIR/hooks.sh $CONFDIR/glacier
|
|
||||||
mv $SRC_DIR/make.conf $CONFDIR
|
|
||||||
mv $SRC_DIR/glacier-integrity-check $PREFIX/bin
|
|
||||||
if [ "$?" != "0" ]; then
|
|
||||||
mv $SRC_DIR/glacier-integrity-check $PREFIX
|
|
||||||
printf "directory $PREFIX/bin does not exist, moving to $PREFIX instead\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "finished installation\n"
|
|
||||||
exit 0
|
|
62
install/build.sh
Executable file
62
install/build.sh
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
|
printf "must be run as root\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
WORKING_DIR=$(pwd)
|
||||||
|
SRC_DIR=$(pwd)/../src
|
||||||
|
|
||||||
|
printf "parsing install.conf\n"
|
||||||
|
source $WORKING_DIR/install.conf
|
||||||
|
if [ "$?" != 0 ]; then
|
||||||
|
printf "install.conf not found\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
install)
|
||||||
|
printf "installing executable\n"
|
||||||
|
mv $SRC_DIR/glacier $PREFIX/bin
|
||||||
|
if [ "$?" != 0 ]; then
|
||||||
|
mv $SRC_DIR/glacier $PREFIX
|
||||||
|
printf "directory $PREFIX/bin does not exist, moving to $PREFIX instead\n"
|
||||||
|
fi
|
||||||
|
printf "installing configuration files\n"
|
||||||
|
mv $SRC_DIR/glacier.conf $CONFDIR
|
||||||
|
if [ "$?" != 0 ]; then
|
||||||
|
printf "$CONFDIR does not exist\n"
|
||||||
|
printf "this can be corrected by running:\n"
|
||||||
|
printf "# mkdir -pv $CONFDIR\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir /opt/glacier
|
||||||
|
mkdir /opt/glacier/workspace
|
||||||
|
mkdir /var/log/glacier
|
||||||
|
mkdir /var/cache/glacier
|
||||||
|
|
||||||
|
mkdir /etc/glacier
|
||||||
|
mkdir /etc/glacier/pkginfo
|
||||||
|
|
||||||
|
mv $SRC_DIR/hooks $CONFDIR/glacier
|
||||||
|
mv $SRC_DIR/post-hooks $CONFDIR/glacier
|
||||||
|
mv $SRC_DIR/hooks.sh $CONFDIR/glacier
|
||||||
|
mv $SRC_DIR/make.conf $CONFDIR
|
||||||
|
mv $SRC_DIR/glacier-integrity-check $PREFIX/bin
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
mv $SRC_DIR/glacier-integrity-check $PREFIX
|
||||||
|
printf "directory $PREFIX/bin does not exist, moving to $PREFIX instead\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "finished installation\n"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
update)
|
||||||
|
printf "updating executable\n"
|
||||||
|
rm $PREFIX/bin/glacier || rm $PREFIX/glacier
|
||||||
|
mv $SRC_DIR/glacier $PREFIX || mv $SRC_DIR/glacier $PREFIX/bin
|
||||||
|
printf "finished updating\n"
|
||||||
|
exit 0
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user