Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

Commit

Permalink
Closes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm committed Jan 7, 2013
1 parent 83be940 commit e26bf97
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions install/install.sh
@@ -1,8 +1,35 @@
#!/bin/bash
echo 'You must have pip >= 1.2.1 which is not in Ubuntu 12.04'
echo These two lines will upgrade pip and fix the path using a symlink
echo pip install --upgrade pip
echo ln -s /usr/local/bin/pip /usr/bin/pip
function pip_version_check()
{
# jnm 20130107
local pip_path="$1"
local minimum_required_version="$2"

local installed_version=$("$pip_path" --version | sed -E 's/^pip ([0-9.]+) from.*$/\1/')
local IFS='.'
local -a installed_version_array=($installed_version)
local -a required_version_array=($minimum_required_version)

for i in 0 1 2 # array elements: major, minor, revision
do
[ -z ${installed_version_array[$i]} ] && installed_version_array[$i]=0
[ -z ${required_version_array[$i]} ] && required_version_array[$i]=0
[ ${installed_version_array[$i]} -gt ${required_version_array[$i]} ] && return 0
[ $? -gt 1 ] && return 2 # invalid input; comparison failed
[ ${installed_version_array[$i]} -lt ${required_version_array[$i]} ] && return 1
[ $? -gt 1 ] && return 2 # invalid input; comparison failed
done
return 0
}
if ! pip_version_check 'pip' '1.2.1'
then
echo 'You must have pip >= 1.2.1, which may not be provided by your distribution.'
echo "If you have already installed your distribution's latest version of pip, try running:"
echo -e '\tpip install --upgrade pip'
echo 'as root. Afterwards, you may need to run `hash -d pip` for your shell to recognize'
echo 'the newly-installed pip executable.'
exit 1
fi

# install everything needed to run this application, start with deb files, should be run as root
apt-get install apache2 mysql-server python-uno python-xlwt python-reportlab python-mysqldb python-ldap python-pip python-feedparser python-xlrd python-mysqldb mysql-client python2.7-dev
Expand Down

0 comments on commit e26bf97

Please sign in to comment.