<commit_before>#!/bin/sh
# Copyright (c) 2009 The Open Source Geospatial Foundation.
# Licensed under the GNU LGPL.
# 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version.  This program is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LICENSE.LGPL.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".

# About:
# =====
# This script will install ushahidi

# Running:
# =======
# sudo ./install_ushahidi.sh

# Requires: Apache2, PHP5
#
# Uninstall:
# ============
# sudo rm -rf /var/www/ushahidi/

# live disc's username is "user"
USER_NAME="user"
USER_HOME="/home/$USER_NAME"
TMP_DIR="/tmp/build_ushahidi"
mkdir -p "$TMP_DIR"

# Install ushahidi dependencies.
echo "Installing ushahidi"

apt-get install --yes  php5 php5-mcrypt php5-curl 

if [ ! -x "`which wget`" ] ; then
    echo "ERROR: wget is required, please install it and try again"
    exit 1
fi

cd "$TMP_DIR"
if [ ! -e "ushahidi.tgz" ] ; then 
   wget -O ushahidi.tgz --progress=dot:mega \
      "http://assets.ushahidi.com/downloads/ushahidi.tgz"
else
    echo "... Ushahidi already downloaded"
fi

# uncompress ushahidi
tar xzf "ushahidi.tgz"
cp -R ushahidi/ /var/www/
chmod -R uga+r /var/www/ushahidi
chown -R www-data:www-data /var/www/ushahidi

#Add Launch icon to desktop
if [ ! -e /usr/share/applications/ushahidi.desktop ] ; then
   cat << EOF > /usr/share/applications/ushahidi.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Ushahidi
Comment=Ushahidi
Categories=Application;Internet;Relief;
Exec=firefox /var/www/ushahidi/readme.html
Icon=access
Terminal=false
StartupNotify=false
EOF
fi
cp /usr/share/applications/ushahidi.desktop "$USER_HOME/Desktop/"

echo "Done installing Ushahidi"<commit_msg>Improved ushahidi installer to install more dependencies and changed launcher path<commit_after>#!/bin/sh
# Copyright (c) 2009 The Open Source Geospatial Foundation.
# Licensed under the GNU LGPL.
# 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version.  This program is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LICENSE.LGPL.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".

# About:
# =====
# This script will install ushahidi

# Running:
# =======
# sudo ./install_ushahidi.sh

# Requires: Apache2, PHP5 mysql-server
#
# more install instructions can be found here /usr/share/ushahidi/readme.html
#
# Uninstall:
# ============
# sudo rm -rf /var/www/ushahidi/

# live disc's username is "user"
USER_NAME="user"
USER_HOME="/home/$USER_NAME"
BUILD_DIR=`pwd`
TMP_DIR="/tmp/build_ushahidi"
mkdir -p "$TMP_DIR"

# Install ushahidi dependencies.
echo "Installing ushahidi"

apt-get --assume-yes install php5 php5-mcrypt php5-curl apache2 mysql-server libapache2-mod-php5 php5-mysql 
if [ ! -x "`which wget`" ] ; then
    echo "ERROR: wget is required, please install it and try again"
    exit 1
fi

cd "$TMP_DIR"

if [ ! -e "ushahidi.tgz" ] ; then 
   wget -O ushahidi.tgz --progress=dot:mega \
      "http://assets.ushahidi.com/downloads/ushahidi.tgz"
else
    echo "... Ushahidi already downloaded"
fi

# uncompress ushahidi
tar xzf "ushahidi.tgz"
mkdir /usr/local/share/ushahidi

cp -R ushahidi/ /usr/local/share/

ln -s /usr/local/share/ushahidi /var/www/ushahidi

chown -R www-data:www-data /usr/local/share/ushahidi

#Add Launch icon to desktop
cp "$BUILD_DIR"/../app-conf/ushahidi/ushahidi-gnome.png /usr/share/pixmaps/
if [ ! -e /usr/share/applications/ushahidi.desktop ] ; then
   cat << EOF > /usr/share/applications/ushahidi.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Ushahidi
Comment=Ushahidi
Categories=Application;Internet;Relief;
Exec=firefox http://localhost/ushahidi
Icon=access
Terminal=false
StartupNotify=false
EOF
fi
cp /usr/share/applications/ushahidi.desktop "$USER_HOME/Desktop/"

echo "Done installing Ushahidi"
{'fraction_non_alphanumeric': 0.11496746203904555, 'fraction_numerical': 0.006507592190889371, 'mean_word_length': 4.1925675675675675, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 13, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5774156', 'n_tokens_mistral': 1609, 'n_tokens_neox': 1533, 'n_words': 492}