From f9c705fa0e6b6440bcf1d8adf5b58f5030c93e48 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 27 Sep 2016 12:59:44 +0200 Subject: Updated installation script. --- install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 20444252..1a078619 100755 --- a/install.sh +++ b/install.sh @@ -11,9 +11,15 @@ PYTHON_VERSION="3.5" sudo apt-get install -y build-essential git wget > /dev/null sudo apt-get install -y libxml2-dev libxslt1-dev > /dev/null # for lxml +sudo apt-get install -y libssl-dev openssl > /dev/null # for pip echo "Installation of Python..." +if [ "$1" == postgres ]; then + sudo apt-get install -y libpq-dev > /dev/null +elif [ "$1" == sqlite ]; then + sudo apt-get install -y libsqlite3-dev > /dev/null +fi wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz -o /dev/null > /dev/null tar -xf Python-3.5.2.tar.xz > /dev/null rm Python-3.5.2.tar.xz > /dev/null @@ -29,19 +35,21 @@ sudo rm -Rf Python-3.5.2/ echo "Installing required Python libraries..." sed -i '/psycopg2/d' requirements.txt > /dev/null +sudo pip$PYTHON_VERSION install --upgrade pip sudo pip$PYTHON_VERSION install --upgrade -r requirements.txt > /dev/null + # Initializes the configuration file cp src/conf/conf.cfg-sample src/conf/conf.cfg - # Delete default database configuration sed -i '/database/d' src/conf/conf.cfg sed -i '/database_url/d' src/conf/conf.cfg + +# Configuration of the database if [ "$1" == postgres ]; then echo "Installing requirements for PostgreSQL..." sudo apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client > /dev/null - sudo apt-get install -y libpq-dev > /dev/null sudo pip$PYTHON_VERSION install psycopg2 > /dev/null echo "Configuring the database..." echo "127.0.0.1:5433:aggregator:pgsqluser:pgsqlpwd" > ~/.pgpass @@ -57,6 +65,7 @@ if [ "$1" == postgres ]; then elif [ "$1" == sqlite ]; then # Add configuration lines for SQLite echo "Configuring the SQLite database..." + echo '[database]' >> src/conf/conf.cfg echo 'database_url = sqlite:///jarr.db' >> src/conf/conf.cfg fi -- cgit