Commit bca50b9d authored by Ciarán Ó Rourke's avatar Ciarán Ó Rourke
Browse files

flags to separate compilation and running

parent eb464d42
......@@ -3,54 +3,80 @@
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
phobos_dir="${script_dir}/../external/phobos"
apt-get install -y \
libglib2.0-dev \
python-dev python-argparse python-yaml python-psycopg2 \
libjansson-dev \
libini-config5 libini-config-dev \
openssl libssh-dev \
libattr1 libattr1-dev \
libsgutils2-dev \
protobuf-c-compiler libprotobuf-c-dev \
clustershell \
automake autogen autoconf autoconf-archive autotools-dev libtool libev-dev pkg-config \
libconfig-dev \
postgresql-all \
python-pip
# Use the -c flag to only run the compilation part of the script
# Use the -r flag to only run the run part of the script
pip install ClusterShell
COMPILE=true
RUN=true
ln -s /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/
if [[ $# -eq 1 ]]
then
key="$1"
case $key in
-c|--compile)
RUN=false
;;
-r|--run)
COMPILE=false
;;
*)
;;
esac
fi
echo "# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5"\
| tee /etc/postgresql/11/main/pg_hba.conf
if [ "$COMPILE" = true ]
then
apt-get install -y \
libglib2.0-dev \
python-dev python-argparse python-yaml python-psycopg2 \
libjansson-dev \
libini-config5 libini-config-dev \
openssl libssh-dev \
libattr1 libattr1-dev \
libsgutils2-dev \
protobuf-c-compiler libprotobuf-c-dev \
clustershell \
automake autogen autoconf autoconf-archive autotools-dev libtool libev-dev pkg-config \
libconfig-dev \
postgresql-all \
python-pip
pg_ctlcluster 11 main start
pip install ClusterShell
#export PKG_CONFIG_PATH=/usr/pgsql-9.4/lib/pkgconfig
ln -s /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/
cd ${phobos_dir}
echo "# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5"\
| tee /etc/postgresql/11/main/pg_hba.conf
${phobos_dir}/autogen.sh
${phobos_dir}/configure
make
cd ${phobos_dir}
cd ${phobos_dir} && chmod a+rx . .. ../.. ../../.. ./scripts/phobos_db{,_local}
${phobos_dir}/autogen.sh
${phobos_dir}/configure
make
cd ${phobos_dir} && sudo -u postgres bash ./scripts/phobos_db_local setup_db -s -p phobos
cd ${phobos_dir} && chmod a+rx . .. ../.. ../../.. ./scripts/phobos_db{,_local}
cp ${phobos_dir}/src/tests/phobos.conf /etc/
sed -i '/lrs/ a default_family = dir' /etc/phobos.conf
cp ${phobos_dir}/src/tests/phobos.conf /etc/
sed -i '/lrs/ a default_family = dir' /etc/phobos.conf
make install
cd ${phobos_dir}/src/cli && python setup.py install
phobosd
make install
cd ${phobos_dir}/src/cli && python setup.py install
fi
if [ "$RUN" = true ]
then
pg_ctlcluster 11 main start
cd ${phobos_dir} && sudo -u postgres bash ./scripts/phobos_db_local setup_db -s -p phobos
phobosd
mkdir /tmp/phobos_test
phobos dir add --unlock /tmp/phobos_test
phobos dir format --fs posix /tmp/phobos_test
fi
mkdir /tmp/phobos_test
phobos dir add --unlock /tmp/phobos_test
phobos dir format --fs posix /tmp/phobos_test
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment