Add support for Debian, merge Debian/Ubuntu platforms

This commit is contained in:
Roberto Rosario
2012-06-03 02:46:41 -04:00
parent cf88bf759e
commit 4b4dc9d96f
6 changed files with 84 additions and 70 deletions

View File

@@ -1,48 +1,3 @@
from fabric.api import run, sudo, cd, env, task, settings
from ..literals import DB_MYSQL, WEB_APACHE
def install_dependencies():
"""
Install Ubuntu dependencies
"""
sudo('apt-get install -y git-core gcc tesseract-ocr unpaper python-virtualenv ghostscript libjpeg-dev libpng-dev poppler-utils')
def install_database_manager():
"""
Install the database manager on an Ubuntu system
"""
if env.database_manager == DB_MYSQL:
sudo('apt-get install -y mysql-server libmysqlclient-dev')
with cd(env.virtualenv_path):
sudo('source bin/activate; pip install MySQL-python')
def install_webserver():
"""
Installing the Ubuntu packages for the webserver
"""
if env.webserver == WEB_APACHE:
sudo('apt-get install -y apache2 libapache2-mod-wsgi')
with settings(warn_only=True):
# Get rid of Apache's default site
sudo('a2dissite default')
def fix_permissions():
"""
Fix installation files' permissions on an Ubuntu system
"""
sudo('chmod 770 %s -R' % env.virtualenv_path)
sudo('chgrp www-data %s -R' % env.virtualenv_path)
def post_install():
"""
Post install operations on an Ubuntu system