From fd27a8a06afa0a3bad79dd1d58ab3b7d2a9dc2af Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 16 Apr 2013 16:34:19 +0200 Subject: [PATCH] new: added ``python-venv`` charm. --- precise/python-venv/hooks/install | 36 +++++++++++++++++++++++++++++++ precise/python-venv/hooks/start | 3 +++ precise/python-venv/hooks/stop | 3 +++ precise/python-venv/metadata.yaml | 6 ++++++ precise/python-venv/revision | 1 + 5 files changed, 49 insertions(+) create mode 100755 precise/python-venv/hooks/install create mode 100755 precise/python-venv/hooks/start create mode 100755 precise/python-venv/hooks/stop create mode 100644 precise/python-venv/metadata.yaml create mode 100644 precise/python-venv/revision diff --git a/precise/python-venv/hooks/install b/precise/python-venv/hooks/install new file mode 100755 index 0000000..612aba1 --- /dev/null +++ b/precise/python-venv/hooks/install @@ -0,0 +1,36 @@ +#!/bin/bash + +set -eux # -x for verbose logging to juju debug-log + +## +## INSTALL Python 2.7.2 +## + +apt-get install wget bzip2 build-essential -y --force-yes +apt-get install libreadline-dev libbz2-dev libz-dev libssl-dev libsqlite3-dev libgdbm-dev libldap2-dev -y --force-yes +cd /tmp +wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 +tar xjf Python-2.7.2.tar.bz2 +cd Python-2.7.2 +./configure --prefix=/opt/apps/python-2.7.2 +make +make install + +## +## INSTALL DISTRIBUTE/PIP/VIRTUALENV +## + +cd /tmp +wget http://python-distribute.org/distribute_setup.py +/opt/apps/python-2.7.2/bin/python ./distribute_setup.py +/opt/apps/python-2.7.2/bin/easy_install pip +/opt/apps/python-2.7.2/bin/pip install virtualenv + +## +## MAKE A DEFAULT VIRTUAL ENV +## + +cd /srv +mkdir -p /srv/virtualenv +/opt/apps/python-2.7.2/bin/virtualenv /srv/virtualenv/default --no-site-packages + diff --git a/precise/python-venv/hooks/start b/precise/python-venv/hooks/start new file mode 100755 index 0000000..9eb7853 --- /dev/null +++ b/precise/python-venv/hooks/start @@ -0,0 +1,3 @@ +#!/bin/bash + +juju-log "Nothing to Start for base." diff --git a/precise/python-venv/hooks/stop b/precise/python-venv/hooks/stop new file mode 100755 index 0000000..170162b --- /dev/null +++ b/precise/python-venv/hooks/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +juju-log "Nothing to stop for base." diff --git a/precise/python-venv/metadata.yaml b/precise/python-venv/metadata.yaml new file mode 100644 index 0000000..04ea36a --- /dev/null +++ b/precise/python-venv/metadata.yaml @@ -0,0 +1,6 @@ +name: python-venv +summary: "Python Virtual Environnement" +maintainer: "Valentin Lab " +inherit: base-0k +description: | + Python Virtual Environnement diff --git a/precise/python-venv/revision b/precise/python-venv/revision new file mode 100644 index 0000000..573541a --- /dev/null +++ b/precise/python-venv/revision @@ -0,0 +1 @@ +0