<commit_before>#!/usr/bin/env bash

#
#  Install system dependencies
#.............................

dev=false

usage () {
    cat <<- _EOF_
Usage: Install project [OPTIONS]
    -d, --dev    install dev tools
    -h, --help    show this help
_EOF_
    return
}

database_exists () {
    # /!\ Will return false if psql can't list database. Edit your pg_hba.conf
    # as appropriate.
    if [ -z $1 ]
    then
        # Argument is null
        return 0
    else
        # Grep db name in the list of database
        psql -tAl | grep -q "^$1|"
        return $?
    fi
}

while [[ -n $1 ]]; do
    case $1 in
        -d | --dev )        dev=true
                            ;;
        -h | --help )       usage
                            exit
                            ;;
        *)                  usage
                            exit
                            ;;
    esac
    shift
done

function ubuntu_precise {
    set -x

    sudo apt-get install python-software-properties
    sudo apt-add-repository -y ppa:ubuntugis/ubuntugis-unstable
    sudo apt-add-repository -y ppa:sharpie/postgis-stable 
    sudo apt-get update > /dev/null
    sudo apt-get install python-virtualenv build-essential python-dev unzip
    sudo apt-get install libjson0 libgdal1 libgdal-dev libproj0 libgeos-c1 postgresql postgresql-client postgresql-9.1-postgis2 postgresql-server-dev-9.1
    sudo apt-get install gettext

    # Default settings if not any
    mkdir -p etc/
    settingsfile=etc/settings.ini
    if [ ! -f $settingsfile ]; then
        cat > $settingsfile << _EOF_
#
#  Caminae Settings
#..........................
# (Note: If you edit this file out of install process, 
#  run "make deploy" to apply changes, or "make serve" in development)

[settings]
dbname = caminae
dbuser = postgres
dbpassword = <PASSWORD>
dbhost = localhost
dbport = 5432

# URL prefix, leave empty if dedicated server. (example: /ecrins)
rooturl = 
# Cache duration in seconds
cachetimeout = 60 * 60

# Default structure for newly created users
defaultstructure = PNE
# EPSG code of the coordinate system to use<commit_msg>Add missing packages in install process<commit_after>#!/usr/bin/env bash

#
#  Install system dependencies
#.............................

dev=false

usage () {
    cat <<- _EOF_
Usage: Install project [OPTIONS]
    -d, --dev    install dev tools
    -h, --help    show this help
_EOF_
    return
}

database_exists () {
    # /!\ Will return false if psql can't list database. Edit your pg_hba.conf
    # as appropriate.
    if [ -z $1 ]
    then
        # Argument is null
        return 0
    else
        # Grep db name in the list of database
        psql -tAl | grep -q "^$1|"
        return $?
    fi
}

while [[ -n $1 ]]; do
    case $1 in
        -d | --dev )        dev=true
                            ;;
        -h | --help )       usage
                            exit
                            ;;
        *)                  usage
                            exit
                            ;;
    esac
    shift
done

function ubuntu_precise {
    set -x

    sudo apt-get install python-software-properties
    sudo apt-add-repository -y ppa:ubuntugis/ubuntugis-unstable
    sudo apt-add-repository -y ppa:sharpie/postgis-stable 
    sudo apt-get update > /dev/null
    sudo apt-get install python-virtualenv build-essential python-dev unzip
    sudo apt-get install libjson0 libgdal1 libgdal-dev libproj0 libgeos-c1 postgresql postgresql-client postgresql-9.1-postgis2 postgresql-server-dev-9.1
    sudo apt-get install postgis-bin gdal-bin
    sudo apt-get install gettext

    # Default settings if not any
    mkdir -p etc/
    settingsfile=etc/settings.ini
    if [ ! -f $settingsfile ]; then
        cat > $settingsfile << _EOF_
#
#  Caminae Settings
#..........................
# (Note: If you edit this file out of install process, 
#  run "make deploy" to apply changes, or "make serve" in development)

[settings]
dbname = caminae
dbuser = postgres
dbpassword = <PASSWORD>
dbhost = localhost
dbport = 5432

# URL prefix, leave empty if dedicated server. (example: /ecrins)
rooturl = 
# Cache duration in seconds
cachetimeout = 60 * 60

# Default structure for newly created users
defaultstructure = PNE
# EPSG code of the coordinate system to use
{'fraction_non_alphanumeric': 0.10864485981308411, 'fraction_numerical': 0.010280373831775701, 'mean_word_length': 1.8276089828269484, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7001000', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1259, 'n_words': 427}