Skip to content

Commit

Permalink
merging some install improvements from master
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Aug 11, 2011
1 parent 8d650f0 commit 84d1612
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 77 deletions.
2 changes: 1 addition & 1 deletion djangoWsgi.py
Expand Up @@ -10,7 +10,7 @@
import re
from django.core.handlers.wsgi import WSGIHandler

def getEnvironmentFromSourceMe(thisDir):
def getEnvironmentFromSourceMe(thisDir='.'):
# pick up environment variables from sourceme
fd, tmp = tempfile.mkstemp('djangoWsgiSourceMe.txt')
os.close(fd)
Expand Down
49 changes: 13 additions & 36 deletions docs/install.rst
Expand Up @@ -28,8 +28,9 @@ We have also successfully installed parts of GeoCam Share on RedHat
Enterprise Linux 5.5, Mac OS X 10.6 (Snow Leopard), and an Ubuntu
virtual machine running under VMWare on a Windows host. However, we do
not officially support those platforms. Our installation instructions
below mostly assume Ubuntu, so if you want to use another platform you
may need to improvise more during installation.
below assume Ubuntu. We also have `tips for other operating systems`_.

.. _tips for other operating systems: http://github.com/geocam/geocamShare/tree/master/docs/otherOperatingSystems.rst

Set Up an Install Location
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -44,23 +45,10 @@ in the instructions below::
Get the Source
~~~~~~~~~~~~~~

Visit the `GeoCam Share repository on GitHub`_, click on the Downloads_
button, and click on "Download .tar.gz" to get a tarball. Then drop the
tarball into the ``$GEOCAM_DIR`` directory and run::

cd $GEOCAM_DIR
tar xfz geocam-geocamShare-*.tar.gz
# rename the resulting directory to "geocamShare"
mv `ls -d geocam-geocamShare-* | head -1` geocamShare

.. _GeoCam Share repository on GitHub: http://github.com/geocam/geocamShare/
.. _Downloads: http://github.com/geocam/geocamShare/archives/master

**Advanced version:** If you're interested in contributing code to GeoCam
Share, you can check out our latest revision with::
Check out our latest source revision with::

cd $GEOCAM_DIR
git clone http://github.com/geocam/geocamShare.git geocamShare
git clone git://github.com/geocam/geocamShare.git geocamShare

For more information on the Git version control system, visit `the Git home page`_.
You can install Git on Ubuntu with::
Expand Down Expand Up @@ -94,8 +82,8 @@ interpreter will know how to import packages installed in your sandbox.
You'll need to source the ``activate`` script every time you log in
to reactivate the sandbox.

Install Dependencies
~~~~~~~~~~~~~~~~~~~~
Install Non-Python Packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~

First install Ubuntu packages::

Expand All @@ -108,27 +96,16 @@ First install Ubuntu packages::
# rendering icons and reading image metadata
sudo apt-get install libjpeg-dev libimage-exiftool-perl imagemagick

Then install Python dependencies. For this command to work, you will
either need to make sure your virtualenv environment is activated (as
explained above, recommended) or run with ``sudo``::

pip install -r $GEOCAM_DIR/geocamShare/make/pythonRequirements.txt

Set Up GeoCam Share
~~~~~~~~~~~~~~~~~~~

To render icons and collect media for the server, run::
To install Python dependencies, render icons and collect media for the
server, run::

cd $GEOCAM_DIR/geocamShare
python setup.py install

Note that, maybe confusingly, this is not a standard Python install
script. The action it takes is more like "build" than "install". It
does not modify anything outside the ``geocamShare`` directory.

To set up your shell environment to run Share::

./manage.py bootstrap --yes
source $GEOCAM_DIR/geocamShare/sourceme.sh
./manage.py prep

You'll need to source the ``sourceme.sh`` file every time you open a new
shell if you want to run Share-related Python scripts such as starting
Expand All @@ -149,10 +126,10 @@ Import Sample Data

To download and import 37 sample photos::

cd $GEOCAM_DIR
cd $GEOCAM_DIR/geocamShare
curl http://geocamshare.org/downloads/geocamShareSampleData.tar.gz -O
tar xfz geocamShareSampleData.tar.gz
python geocamDisasterStyle/simpleImport.py --user root geocamShareSampleData
python apps/geocamLens/bin/simpleImport.py --user=root geocamShareSampleData/

You can also clean out all the photos in the database by running
``simpleImport.py`` with the ``-c`` "clean" option. This is handy if
Expand Down
45 changes: 45 additions & 0 deletions docs/otherOperatingSystems.rst
@@ -0,0 +1,45 @@
=========================================
Other Operating Systems
=========================================

Mac OS X
~~~~~~~~

The most straightforward (if slow) way to install the non-Python
dependencies of Share under Mac OS X is using `MacPorts`_. After you've
installed MacPorts, here's a command that installs the more vital
dependencies::

sudo port -vn install py27-virtualenv py27-pip git-core sqlite3 jpeg p5-image-exiftool
sudo port select python python27

.. _MacPorts: http://www.macports.org

If you are just starting with MacPorts, note that that command will
install a massive software stack including both Python and Perl
interpreters, and could take hours of compilation time. Once you've
installed it, you will want to make sure ``/opt/local/bin`` is in
your PATH and you're using the MacPorts Python 2.7 interpreter.

An additional set of dependencies is needed to render the map marker
icons from SVG source files. You can either install those dependencies
(another large software stack including X11)::

sudo port -vn install ImageMagick

Or you can install pre-rendered icons instead::

cd $GEOCAM_DIR/geocamShare
curl http://geocamshare.org/downloads/geocamLensRenderedIcons-2011-08-11.tgz -O
tar xvfzm geocamLensRenderedIcons-2011-08-11.tgz

(Note the 'm' option to tar instructs it to set the mtime of the
extracted files to the current time instead of the mtime stored in the
archive. That way the the pre-rendered icons will be newer than the
source icons and the rendering script will not try to regenerate them.)

| __BEGIN_LICENSE__
| Copyright (C) 2008-2010 United States Government as represented by
| the Administrator of the National Aeronautics and Space Administration.
| All Rights Reserved.
| __END_LICENSE__
10 changes: 8 additions & 2 deletions manage.py
Expand Up @@ -9,8 +9,14 @@
import sys

# try to bootstrap before hooking into django management stuff
ret = os.spawnl(os.P_WAIT, sys.executable, sys.executable, '%s/management/bootstrap.py' % os.path.dirname(__file__), '-v')
if ret != 0:
if 'bootstrap' in sys.argv:
extraArgs = sys.argv[2:]
else:
extraArgs = []
ret = os.spawnl(os.P_WAIT, sys.executable, sys.executable,
'%s/management/bootstrap.py' % os.path.dirname(__file__),
*extraArgs)
if ret != 0 or extraArgs:
sys.exit(ret)

from django.core.management import execute_manager
Expand Down

0 comments on commit 84d1612

Please sign in to comment.