#!/bin/sh # @licence app begin@ # SPDX-License-Identifier: MPL-2.0 # # \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen # # \file prepare # # \brief This file is part of the Build System. # # \author Philippe Colliot # # \version 1.0 # # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # For further information see http://www.genivi.org/. # # List of changes: # # , , # # @licence end@ CURDIR=$PWD ROOT_DIR=$CURDIR BIN_DIR=$ROOT_DIR/bin SCRIPT_DIR=$ROOT_DIR/script CONFIG_DIR=$HOME"/.config/poi-service" CHK_DIR_EXISTS='test -d' MKDIR='mkdir -p' echo '------------------------localize the project and prepare the database------------------------' #by default area set to paris area="paris" language='en' while getopts c:h opt do case $opt in c) case "$OPTARG" in switzerland) area="switzerland" language='en' ;; paris) area="paris" language='en' ;; tokyo) area="tokyo" language='jp' ;; san-diego) area="san-diego" language='en' ;; *) echo "Unsupported area $OPTARG" >&2 exit 1 ;; esac ;; h) echo "Usage:" echo "$0 [-c area]" echo "-c: Set area (supported values: paris,tokyo,san-diego). Default is paris" echo "-h: Help" exit 1 esac done echo 'generate the databases' $SCRIPT_DIR/make-database $area echo 'set the config file' if [ ! -d $CONFIG_DIR ] then echo create config directory mkdir -p $CONFIG_DIR fi CONFIG_FILE=$SCRIPT_DIR/$area/poi-client.conf cp $CONFIG_FILE $CONFIG_DIR/poi-client.conf echo 'set the language for the content access module' rm -rf $BIN_DIR/language.txt echo "$language" > $BIN_DIR/language.txt