You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/05/20 16:28:57 UTC
[1/5] git commit: CLIMATE-370 - Add conda dependencies file
Repository: climate
Updated Branches:
refs/heads/master 4929e2cfb -> 62d303f53
CLIMATE-370 - Add conda dependencies file
- Add ocw-conda-dependencies to simply conda install of OCW
dependencies. Any packages that should be conda installed can be listed
here and they will be picked up by the install scripts (assuming they
use this file).
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/9353d89c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/9353d89c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/9353d89c
Branch: refs/heads/master
Commit: 9353d89c3ff23082df69d4e3b998d5905b66a25f
Parents: 4929e2c
Author: Michael Joyce <jo...@apache.org>
Authored: Mon May 12 10:40:36 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon May 19 08:22:04 2014 -0700
----------------------------------------------------------------------
easy-ocw/ocw-conda-dependencies.txt | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/9353d89c/easy-ocw/ocw-conda-dependencies.txt
----------------------------------------------------------------------
diff --git a/easy-ocw/ocw-conda-dependencies.txt b/easy-ocw/ocw-conda-dependencies.txt
new file mode 100644
index 0000000..c751c36
--- /dev/null
+++ b/easy-ocw/ocw-conda-dependencies.txt
@@ -0,0 +1,5 @@
+numpy
+scipy
+matplotlib
+basemap
+netcdf4
[5/5] git commit: Resolve CLIMATE-370. Merge PR #29
Posted by jo...@apache.org.
Resolve CLIMATE-370. Merge PR #29
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/62d303f5
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/62d303f5
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/62d303f5
Branch: refs/heads/master
Commit: 62d303f538879c566a7698ff9d5441629b6b6f47
Parents: 4929e2c fccf47f
Author: Michael Joyce <jo...@apache.org>
Authored: Tue May 20 07:28:11 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Tue May 20 07:28:11 2014 -0700
----------------------------------------------------------------------
easy-ocw/bootstrap.py | 262 ---------------------
easy-ocw/buildout.cfg | 377 -------------------------------
easy-ocw/etc/dependencies.cfg | 84 -------
easy-ocw/install-osx.sh | 184 +++++++++++++++
easy-ocw/install-ubuntu-12_04.sh | 219 ++++++++++++++++++
easy-ocw/install.sh | 198 ----------------
easy-ocw/ocw-conda-dependencies.txt | 5 +
7 files changed, 408 insertions(+), 921 deletions(-)
----------------------------------------------------------------------
[4/5] git commit: CLIMATE-370 - Remove old easy-ocw Buildout code
Posted by jo...@apache.org.
CLIMATE-370 - Remove old easy-ocw Buildout code
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/fccf47f5
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/fccf47f5
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/fccf47f5
Branch: refs/heads/master
Commit: fccf47f5b10916eec9b77cf8e17e960bb87144f0
Parents: 629630a
Author: Michael Joyce <jo...@apache.org>
Authored: Mon May 19 08:34:48 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon May 19 08:45:39 2014 -0700
----------------------------------------------------------------------
easy-ocw/bootstrap.py | 262 --------------------------
easy-ocw/buildout.cfg | 377 -------------------------------------
easy-ocw/etc/dependencies.cfg | 84 ---------
easy-ocw/install.sh | 198 -------------------
4 files changed, 921 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/fccf47f5/easy-ocw/bootstrap.py
----------------------------------------------------------------------
diff --git a/easy-ocw/bootstrap.py b/easy-ocw/bootstrap.py
deleted file mode 100644
index 7647cbb..0000000
--- a/easy-ocw/bootstrap.py
+++ /dev/null
@@ -1,262 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-"""
-
-import os, shutil, sys, tempfile, urllib, urllib2, subprocess
-from optparse import OptionParser
-
-if sys.platform == 'win32':
- def quote(c):
- if ' ' in c:
- return '"%s"' % c # work around spawn lamosity on windows
- else:
- return c
-else:
- quote = str
-
-# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
-stdout, stderr = subprocess.Popen(
- [sys.executable, '-Sc',
- 'try:\n'
- ' import ConfigParser\n'
- 'except ImportError:\n'
- ' print 1\n'
- 'else:\n'
- ' print 0\n'],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
-has_broken_dash_S = bool(int(stdout.strip()))
-
-# In order to be more robust in the face of system Pythons, we want to
-# run without site-packages loaded. This is somewhat tricky, in
-# particular because Python 2.6's distutils imports site, so starting
-# with the -S flag is not sufficient. However, we'll start with that:
-if not has_broken_dash_S and 'site' in sys.modules:
- # We will restart with python -S.
- args = sys.argv[:]
- args[0:0] = [sys.executable, '-S']
- args = map(quote, args)
- os.execv(sys.executable, args)
-# Now we are running with -S. We'll get the clean sys.path, import site
-# because distutils will do it later, and then reset the path and clean
-# out any namespace packages from site-packages that might have been
-# loaded by .pth files.
-clean_path = sys.path[:]
-import site # imported because of its side effects
-sys.path[:] = clean_path
-for k, v in sys.modules.items():
- if k in ('setuptools', 'pkg_resources') or (
- hasattr(v, '__path__') and
- len(v.__path__) == 1 and
- not os.path.exists(os.path.join(v.__path__[0], '__init__.py'))):
- # This is a namespace package. Remove it.
- sys.modules.pop(k)
-
-is_jython = sys.platform.startswith('java')
-
-setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py'
-distribute_source = 'http://python-distribute.org/distribute_setup.py'
-
-
-# parsing arguments
-def normalize_to_url(option, opt_str, value, parser):
- if value:
- if '://' not in value: # It doesn't smell like a URL.
- value = 'file://%s' % (
- urllib.pathname2url(
- os.path.abspath(os.path.expanduser(value))),)
- if opt_str == '--download-base' and not value.endswith('/'):
- # Download base needs a trailing slash to make the world happy.
- value += '/'
- else:
- value = None
- name = opt_str[2:].replace('-', '_')
- setattr(parser.values, name, value)
-
-usage = '''\
-[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
-
-Bootstraps a buildout-based project.
-
-Simply run this script in a directory containing a buildout.cfg, using the
-Python that you want bin/buildout to use.
-
-Note that by using --setup-source and --download-base to point to
-local resources, you can keep this script from going over the network.
-'''
-
-parser = OptionParser(usage=usage)
-parser.add_option("-v", "--version", dest="version",
- help="use a specific zc.buildout version")
-parser.add_option("-d", "--distribute",
- action="store_true", dest="use_distribute", default=False,
- help="Use Distribute rather than Setuptools.")
-parser.add_option("--setup-source", action="callback", dest="setup_source",
- callback=normalize_to_url, nargs=1, type="string",
- help=("Specify a URL or file location for the setup file. "
- "If you use Setuptools, this will default to " +
- setuptools_source + "; if you use Distribute, this "
- "will default to " + distribute_source + "."))
-parser.add_option("--download-base", action="callback", dest="download_base",
- callback=normalize_to_url, nargs=1, type="string",
- help=("Specify a URL or directory for downloading "
- "zc.buildout and either Setuptools or Distribute. "
- "Defaults to PyPI."))
-parser.add_option("--eggs",
- help=("Specify a directory for storing eggs. Defaults to "
- "a temporary directory that is deleted when the "
- "bootstrap script completes."))
-parser.add_option("-t", "--accept-buildout-test-releases",
- dest='accept_buildout_test_releases',
- action="store_true", default=False,
- help=("Normally, if you do not specify a --version, the "
- "bootstrap script and buildout gets the newest "
- "*final* versions of zc.buildout and its recipes and "
- "extensions for you. If you use this flag, "
- "bootstrap and buildout will get the newest releases "
- "even if they are alphas or betas."))
-parser.add_option("-c", None, action="store", dest="config_file",
- help=("Specify the path to the buildout configuration "
- "file to be used."))
-
-options, args = parser.parse_args()
-
-# if -c was provided, we push it back into args for buildout's main function
-if options.config_file is not None:
- args += ['-c', options.config_file]
-
-if options.eggs:
- eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
-else:
- eggs_dir = tempfile.mkdtemp()
-
-if options.setup_source is None:
- if options.use_distribute:
- options.setup_source = distribute_source
- else:
- options.setup_source = setuptools_source
-
-if options.accept_buildout_test_releases:
- args.append('buildout:accept-buildout-test-releases=true')
-args.append('bootstrap')
-
-try:
- import pkg_resources
- import setuptools # A flag. Sometimes pkg_resources is installed alone.
- if not hasattr(pkg_resources, '_distribute'):
- raise ImportError
-except ImportError:
- ez_code = urllib2.urlopen(
- options.setup_source).read().replace('\r\n', '\n')
- ez = {}
- exec ez_code in ez
- setup_args = dict(to_dir=eggs_dir, download_delay=0)
- if options.download_base:
- setup_args['download_base'] = options.download_base
- if options.use_distribute:
- setup_args['no_fake'] = True
- ez['use_setuptools'](**setup_args)
- if 'pkg_resources' in sys.modules:
- reload(sys.modules['pkg_resources'])
- import pkg_resources
- # This does not (always?) update the default working set. We will
- # do it.
- for path in sys.path:
- if path not in pkg_resources.working_set.entries:
- pkg_resources.working_set.add_entry(path)
-
-cmd = [quote(sys.executable),
- '-c',
- quote('from setuptools.command.easy_install import main; main()'),
- '-mqNxd',
- quote(eggs_dir)]
-
-if not has_broken_dash_S:
- cmd.insert(1, '-S')
-
-find_links = options.download_base
-if not find_links:
- find_links = os.environ.get('bootstrap-testing-find-links')
-if find_links:
- cmd.extend(['-f', quote(find_links)])
-
-if options.use_distribute:
- setup_requirement = 'distribute'
-else:
- setup_requirement = 'setuptools'
-ws = pkg_resources.working_set
-setup_requirement_path = ws.find(
- pkg_resources.Requirement.parse(setup_requirement)).location
-env = dict(
- os.environ,
- PYTHONPATH=setup_requirement_path)
-
-requirement = 'zc.buildout'
-version = options.version
-if version is None and not options.accept_buildout_test_releases:
- # Figure out the most recent final version of zc.buildout.
- import setuptools.package_index
- _final_parts = '*final-', '*final'
-
- def _final_version(parsed_version):
- for part in parsed_version:
- if (part[:1] == '*') and (part not in _final_parts):
- return False
- return True
- index = setuptools.package_index.PackageIndex(
- search_path=[setup_requirement_path])
- if find_links:
- index.add_find_links((find_links,))
- req = pkg_resources.Requirement.parse(requirement)
- if index.obtain(req) is not None:
- best = []
- bestv = None
- for dist in index[req.project_name]:
- distv = dist.parsed_version
- if _final_version(distv):
- if bestv is None or distv > bestv:
- best = [dist]
- bestv = distv
- elif distv == bestv:
- best.append(dist)
- if best:
- best.sort()
- version = best[-1].version
-if version:
- requirement = '=='.join((requirement, version))
-cmd.append(requirement)
-
-if is_jython:
- import subprocess
- exitcode = subprocess.Popen(cmd, env=env).wait()
-else: # Windows prefers this, apparently; otherwise we would prefer subprocess
- exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
-if exitcode != 0:
- sys.stdout.flush()
- sys.stderr.flush()
- print ("An error occurred when trying to install zc.buildout. "
- "Look above this message for any errors that "
- "were output by easy_install.")
- sys.exit(exitcode)
-
-ws.add_entry(eggs_dir)
-ws.require(requirement)
-import zc.buildout.buildout
-zc.buildout.buildout.main(args)
-if not options.eggs: # clean up temporary egg directory
- shutil.rmtree(eggs_dir)
http://git-wip-us.apache.org/repos/asf/climate/blob/fccf47f5/easy-ocw/buildout.cfg
----------------------------------------------------------------------
diff --git a/easy-ocw/buildout.cfg b/easy-ocw/buildout.cfg
deleted file mode 100644
index 6342c9f..0000000
--- a/easy-ocw/buildout.cfg
+++ /dev/null
@@ -1,377 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http:#www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-[buildout]
-
-extends =
- etc/dependencies.cfg
-
-unzip = true
-
-#develop = ./src/main/python/rcmes
-
-parts =
- zlib
- curl
- szip
- jpeg
- libpng
- freetype
- numpy
- numpy-build
- scipy
- scipy-build
- matplotlib
- matplotlib-build
- hdf5
- netcdf
- netcdf4
- netcdf4-build
- ncl-bin
- pynio-bin
- pyngl-bin
- bottle
- requests
-
-[zlib]
-recipe = hexagonit.recipe.cmmi
-url = ${external:zlibURL}
-md5sum = ${external:zlibMD5}
-configure-options =
- --prefix=/usr/local
- --shared
-make-target =
- all install
-
-[curl]
-recipe = hexagonit.recipe.cmmi
-url = ${external:curlURL}
-md5sum = ${external:curlMD5}
-configure-options =
- --bindir=${buildout:bin-directory}
- --with-zlib=${zlib:location}
-
-[libpng]
-recipe = hexagonit.recipe.cmmi
-url = ${external:libpngURL}
-md5sum = ${external:libpngMD5}
-configure-options =
- --prefix=/usr/local
- --with-pic
-make-target =
- all install
-
-[freetype]
-recipe = hexagonit.recipe.cmmi
-url = ${external:freetypeURL}
-md5sum = ${external:freetypeMD5}
-configure-options =
- --prefix=/usr/local
-
-[jpeg]
-recipe = hexagonit.recipe.cmmi
-url = ${external:jpegURL}
-md5sum = ${external:jpegMD5}
-configure-options =
- --prefix=/usr/local
-make-target =
- all install
- install-lib
- install-headers
-
-[szip]
-recipe = hexagonit.recipe.cmmi
-url = ${external:szipURL}
-md5sum = ${external:szipMD5}
-
-[hdf5]
-recipe = hexagonit.recipe.cmmi
-url = ${external:hdf5URL}
-md5sum = ${external:hdf5MD5}
-environment = CPPFLAGS=-D__BSD_VISIBLE
-configure-options =
- --bindir=${buildout:bin-directory}
- --enable-production
- --enable-threadsafe
- --enable-hl
- --enable-shared
- --with-pthread
- --with-szlib=${szip:location}
- --with-zlib=${zlib:location}
-
-[netcdf]
-recipe = hexagonit.recipe.cmmi
-url = ${external:netcdfURL}
-md5sum = ${external:netcdfMD5}
-environment =
- CPPFLAGS=-I${szip:location}/include -I${hdf5:location}/include -I${zlib:location}/include -I${curl:location}/include
- LDFLAGS=-L${szip:location}/lib -L${hdf5:location}/lib -L${zlib:location}/lib -L${curl:location}/lib
-configure-options =
- --bindir=${buildout:bin-directory}
- --enable-dap
- --enable-cxx-4
- --enable-ncgen4
- --enable-shared
- --enable-netcdf-4
-
-[netcdf4]
-recipe = hexagonit.recipe.download
-url = ${external:netCDF4-pythonURL}
-md5sum = ${external:netCDF4-pythonMD5}
-
-[netcdf4-build]
-recipe = cp.recipe.cmd
-shell = /bin/bash
-install_cmd =
- export HDF5_DIR=${hdf5:location}
- export NETCDF4_DIR=${netcdf:location}
- export SZIP_DIR=${szip:location}
- cd ${netcdf4:location}/netCDF4-1.0.2
- python setup.py build
- python setup.py install
-
-[numpy]
-recipe = hexagonit.recipe.download
-url = ${external:numpyURL}
-md5sum = ${external:numpyMD5}
-
-[numpy-build]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- cd ${numpy:location}
- ${buildout:directory}/bin/buildout setup numpy-1.6.2 install
-
-[scipy]
-recipe = hexagonit.recipe.download
-url = ${external:scipyURL}
-md5sum = ${external:scipyMD5}
-
-[scipy-build]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- cd ${scipy:location}
- ${buildout:directory}/bin/buildout setup scipy-0.11.0 install
-
-[matplotlib]
-recipe = hexagonit.recipe.download
-url = ${external:matplotlibURL}
-md5sum = ${external:matplotlibMD5}
-
-[matplotlib-build]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- cd ${matplotlib:location}/matplotlib
- python setup.py build
- python setup.py install
-
-[ncl-bin]
-recipe = cp.recipe.cmd
-shell = /bin/bash
-install_cmd =
- OS=`uname -s`
- VER=`uname -m`
-
- cd ${buildout:directory}/parts
- mkdir -p ~/NCL
-
- if [ "$OS" == "Darwin" ]
- then
- if [ "$VER" == "x86_64" ]
- then
- ${buildout:bin-directory}/curl ${external:nclBinURL_OSX64} -o "ncl.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:nclBinURL_OSX32} -o "ncl.tar.gz"
- fi
- elif [ "$OS" == "Linux" ]
- then
- if [ "$VER" == "x86_64" ]
- then
- ${buildout:bin-directory}/curl ${external:nclBinURL_Linux64} -o "ncl.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:nclBinURL_Linux32} -o "ncl.tar.gz"
- fi
- else
- echo "Unable to properly detect your OS. Please report this problem."
- echo "Cancelling installation of NCL..."
- exit
- fi
-
- if [ ! -e ${buildout:directory}/parts/ncl.tar.gz ]
- then
- echo "Unable to download NCL. Cancelling installation..."
- exit 2
- fi
-
- cd ~/NCL
- tar xzf ${buildout:directory}/parts/ncl.tar.gz
-
- if [ -e ~/.cshrc ]
- then
- echo "setenv NCARG_ROOT ~/NCL" >> ~/.cshrc
- echo "setenv PATH \$NCARG_ROOT/bin:\$PATH" >> ~/.cshrc
- fi
-
- if [ -e ~/.bashrc ]
- then
- echo "export NCARG_ROOT=~/NCL" >> ~/.bashrc
- echo "export PATH=\$NCARG_ROOT/bin:\$PATH" >> ~/.bashrc
- fi
-update_cmd = ${ncl-bin:install_cmd}
-
-[pynio]
-recipe = hexagonit.recipe.download
-url = ${external:pynioURL}
-md5sum = ${external:pynioMD5}
-
-[pynio-build]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- cd ${pynio:location}/PyNIO-1.4.1
- export NCARG_ROOT=${ncl:location}/ncl_ncarg-6.0.0-patched
- export HAS_GRIB2=1
- export HAS_OPENDAP=0
- export NETCDF_PREFIX=${netcdf:location}
- export GRIB2_PREFIX=/usr/local
- export F2CLIBS=gfortran
- export F2CLIBS_PREFIX=/usr/local/Cellar/gfortran/4.7.2/gfortran/lib
- python setup.py install
-
-[pynio-bin]
-recipe = cp.recipe.cmd
-shell = /bin/bash
-install_cmd =
- OS=`uname -s`
- VER=`uname -m`
-
- mkdir -p ~/Downloads/PyNIO
- cd ~/Downloads/PyNIO
-
- if [ "$OS" == "Darwin" ]
- then
- if [ "$VER" == "x86_64" -o "$VER" == "i386" ]
- then
- ${buildout:bin-directory}/curl ${external:pynioBinURL_OSX64} -o "PyNIO.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:pynioBinURL_OSX32} -o "PyNIO.tar.gz"
- fi
- elif [ "$OS" == "Linux" ]
- then
- if [ "$VER" == "x86_64" ]
- then
- ${buildout:bin-directory}/curl ${external:pynioBinURL_Linux64} -o "PyNIO.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:pynioBinURL_Linux32} -o "PyNIO.tar.gz"
- fi
- else
- echo "Unable to properly detect your OS. Please report this problem."
- echo "Cancelling installation of PyNIO..."
- exit
- fi
-
- if [ ! -e ~/Downloads/PyNIO/PyNIO.tar.gz ]
- then
- echo "Unable to download PyNIO. Cancelling installation..."
- exit 2
- fi
-
- libDir=`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
-
- if [ ! -z "$VIRTUAL_ENV" ]
- then
- libDir="$VIRTUAL_ENV/lib/python2.7/site-packages"
- fi
-
- tar xzf PyNIO.tar.gz
- \cp -rf lib/python2.7/site-packages/* $libDir
-update_cmd = ${pynio-bin:install_cmd}
-
-# Why package your code properly? Who knows!!! So now we get to have this gem here...
-[pyngl-bin]
-recipe = cp.recipe.cmd
-shell = /bin/bash
-install_cmd =
- OS=`uname -s`
- VER=`uname -m`
-
- mkdir -p ~/Downloads/PyNGL
- cd ~/Downloads/PyNGL
-
- if [ "$OS" == "Darwin" ]
- then
- if [ "$VER" == "x86_64" -o "$VER" == "i386" ]
- then
- ${buildout:bin-directory}/curl ${external:pynglBinURL_OSX64} -o "PyNGL.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:pynglBinURL_OSX32} -o "PyNGL.tar.gz"
- fi
- elif [ "$OS" == "Linux" ]
- then
- if [ "$VER" == "x86_64" ]
- then
- ${buildout:bin-directory}/curl ${external:pynglBinURL_Linux64} -o "PyNGL.tar.gz"
- else
- ${buildout:bin-directory}/curl ${external:pynglBinURL_Linux32} -o "PyNGL.tar.gz"
- fi
- else
- echo "Unable to properly detect your OS. Please report this problem."
- echo "Cancelling installation of PyNGL..."
- exit
- fi
-
- if [ ! -e ~/Downloads/PyNGL/PyNGL.tar.gz ]
- then
- echo "Unable to download PyNGL. Cancelling installation..."
- exit 2
- fi
-
- libDir=`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
-
- if [ ! -z "$VIRTUAL_ENV" ]
- then
- libDir="$VIRTUAL_ENV/lib/python2.7/site-packages"
- fi
-
- tar xzf PyNGL.tar.gz
- \cp -rf bin/* ${buildout:bin-directory}
- \cp -rf lib/python2.7/site-packages/* $libDir
-update_cmd = ${pyngl-bin:install_cmd}
-
-# This is a bit hacked around because buildout wouldn't cooperate and install the egg
-[bottle]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- pip install bottle
-
-# Simple pip installation of Requests
-[requests]
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-cmds =
- pip install requests
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/climate/blob/fccf47f5/easy-ocw/etc/dependencies.cfg
----------------------------------------------------------------------
diff --git a/easy-ocw/etc/dependencies.cfg b/easy-ocw/etc/dependencies.cfg
deleted file mode 100644
index 60b80bd..0000000
--- a/easy-ocw/etc/dependencies.cfg
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http:#www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-[external]
-
-zlibURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/zlib-1.2.7.tar.gz
-zlibMD5 = 60df6a37c56e7c1366cca812414f7b85
-
-curlURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/curl-7.29.0.tar.gz
-curlMD5 = 4f57d3b4a3963038bd5e04dbff385390
-
-szipURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/szip-2.1.tar.gz
-szipMD5 = 902f831bcefb69c6b635374424acbead
-
-jpegURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/jpegsrc.v8.tar.gz
-jpegMD5 = 9c6b3514e922ad42298706163bb5e2d7
-
-libpngURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/libpng-1.5.13.tar.gz
-libpngMD5 = 9c5a584d4eb5fe40d0f1bc2090112c65
-
-freetypeURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/freetype-2.4.11.tar.gz
-freetypeMD5 = 5af8234cf36f64dc2b97f44f89325117
-
-numpyURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/numpy.1.6.2.tar.gz
-numpyMD5 = 95ed6c9dcc94af1fc1642ea2a33c1bba
-
-scipyURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/scipy-0.11.0.tar.gz
-scipyMD5 = 842c81d35fd63579c41a8ca21a2419b9
-
-# matplotlib has an issue with compiling on OS X with 1.1.0. Once, 1.1.1 is released this will be
-# fixed. For now, stick with the latest pull from github and it should be fine.
-#matplotlibURL = https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz
-#matplotlibMD5 = 57a627f30b3b27821f808659889514c2
-#
-# This was pulled from https://github.como/matplotlib/matplotlib on 17 Jan 2013 at 0746
-# and mirrored to avoid changes breaking the install.
-# SHA: a6af0b22769da3d34d43a77457f250bb7cc9a5f1
-matplotlibURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/matplotlib.zip
-matplotlibMD5 = e809fa57efb9c3782e1bd4e019dd38fc
-
-hdf5URL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/hdf5-1.8.10-patch1.tar.gz
-hdf5MD5 = 2147a289fb33c887464ad2b6c5a8ae4c
-
-netcdfURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/netcdf-4.2.1.1.tar.gz
-netcdfMD5 = 5eebcf19e6ac78a61c73464713cbfafc
-
-netCDF4-pythonURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/netCDF4-1.0.2.tar.gz
-netCDF4-pythonMD5 = 22bfe58aefa177f7ab34dd12e70c7679
-
-nclBinURL_OSX32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/ncl_ncarg-6.0.0.MacOS_10.5_i386_gcc401.tar.gz
-nclBinURL_OSX64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/ncl_ncarg-6.0.0.MacOS_10.6_64bit_gcc421.tar.gz
-nclBinURL_Linux32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/ncl_ncarg-6.0.0.Linux_Debian_i686_gcc445.tar.gz
-nclBinURL_Linux64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/ncl_ncarg-6.0.0.Linux_Debian_x86_64_gcc445.tar.gz
-
-pynioURL = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNIO-1.4.1.tar.gz
-pynioMD5 = eec7b6b7ed960de253632d0636d0cc2d
-
-pynioBinURL_OSX32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNIO-1.4.1.macos-10.5-i386-py271-numpy160.tar.gz
-pynioBinURL_OSX64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNIO-1.4.1.macos-10.6-x86_64-py271-numpy160.tar.gz
-pynioBinURL_Linux32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNIO-1.4.1.linux-debian-i686-gcc445-py267-numpy160.tar.gz
-pynioBinURL_Linux64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNIO-1.4.1.linux-debian-x86_64-gcc445-py271-numpy160.tar.gz
-
-pynglBinURL_OSX32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNGL-1.4.0.macos-10.5-i386-py271-numpy160.tar.gz
-pynglBinURL_OSX64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNGL-1.4.0.macos-10.6-x86_64-py271-numpy160.tar.gz
-pynglBinURL_Linux32 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNGL-1.4.0.linux-debian-i686-gcc445-py271-numpy160.tar.gz
-pynglBinURL_Linux64 = http://zipper.jpl.nasa.gov/dist/easy-rcmet/PyNGL-1.4.0.linux-debian-x86_64-gcc445-py271-numpy160.tar.gz
-
-
http://git-wip-us.apache.org/repos/asf/climate/blob/fccf47f5/easy-ocw/install.sh
----------------------------------------------------------------------
diff --git a/easy-ocw/install.sh b/easy-ocw/install.sh
deleted file mode 100755
index c860809..0000000
--- a/easy-ocw/install.sh
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-WITH_VIRTUAL_ENV=0
-WITH_INTERACT=1
-
-help()
-{
-cat << ENDHELP
-
-Easy OCW assists with the building of the Apache Open Climate Workbench and its dependencies
-
-Flags:
- -h Display this help message.
- -e Install and configure a virtualenv environment before installation.
- -q Quiet install. User prompts are removed (when possible).
-
-It is recommended that you pass -e when running this script. If you don't, parts
-of this installation will pollute your global Python install. If you're unsure,
-pass -e just to be safe!
-
-ENDHELP
-}
-
-header()
-{
- echo
- echo "---------------------------------------------------------------------------"
- echo "" $1
- echo "---------------------------------------------------------------------------"
- echo
-}
-
-subheader()
-{
- echo
- echo ">" $1
- echo
-}
-
-### Argument Parsing
-while getopts "heq" FLAG
-do
- case $FLAG in
- h)
- help
- exit 1
- ;;
- e)
- WITH_VIRTUAL_ENV=1
- ;;
- q)
- WITH_INTERACT=0
- ;;
- ?)
- help
- exit 1
- ;;
- esac
-done
-
-###
-echo
-echo "---------------------------------------------------------------------------"
-echo " Welcome to Easy OCW"
-echo "---------------------------------------------------------------------------"
-echo
-
-if [ $WITH_INTERACT == 1 ]
-then
-cat << ENDINTRO
-The following packages will be installed:
- zlib curl
- szip jpeg
- libpng freetype
- numpy scipy
- matplotlib hdf5
- NetCDF NetCDF4-Python
- NCL PyNIO
- PyNGL Bottle
-
-It is highly recommended that you allow this script to install and configure a
-virtualenv environment for you. If you passed the -e flag when running
-this script you're fine! Otherwise, know what you're doing! Parts of this
-script will pollute your global Python install if you don't run within a
-virtualenv environment. If you already have a virtualenv environment into which
-you want installs to go then make sure you don't pass -e!
-
-ENDINTRO
-
-read -p "Press [ENTER] to being installation..."
-fi
-
-### virtualenv install (if required)
-if [ $WITH_VIRTUAL_ENV == 1 ]
-then
- if ! command -v pip >/dev/null
- then
- subheader "Installing Pip (and distribute just in case)"
- subheader "Distribute"
- curl http://python-distribute.org/distribute_setup.py | python
-
- subheader "Pip"
- curl -O http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
- tar xzf pip-1.2.1.tar.gz
- cd pip-1.2.1/
- python setup.py install
- fi
-
- subheader "Installing virtualenv..."
- pip install virtualenv
- subheader "Installing virtualenvwrapper..."
- pip install virtualenvwrapper
-
- # Need to setup environment for virtualenv
- export WORKON_HOME=$HOME/.virtualenvs
- virtualEnvLoc=`which virtualenv`
- source "${virtualEnvLoc}wrapper.sh"
-
- # Create a new environment for OCW work
- mkvirtualenv ocw
- workon ocw
-fi
-
-### Install the latest OCW code for development!
-header "Grabbing OCW code"
-svn co https://svn.apache.org/repos/asf/incubator/climate/trunk/rcmet/src/main/python/rcmes/ src/ocw
-
-### Build
-header "Begin Buildout"
-python bootstrap.py -d
-./bin/buildout -vvvvv
-
-### Outro
-header "Easy OCW installation complete."
-
-cat << OUTRO
-If this installed virtualenv for you, make sure you set the following in
-your shell's RC file.
-
- export WORKON_HOME=$HOME/.virtualenvs
-
-Additionally, you need to source the virtualenvwrapper script in your shell's
-RC file. Run the following to find the location of the file.
-
- which virtualenv
-
-Take the output from the above, add "wrapper.sh" to the end and place it in your
-shell's RC file. As an example, if the result of 'which virtualenv' gives you
-'/usr/local/bin' then you place the following in your shell's RC file:
-
- source /usr/local/bin/virtualenvwrapper.sh
-
-If you have a hard time finding the location of the virtualenvwrapper script
-with the above method you can also run the following. Be aware that this could
-take a while to finish.
-
- find / -name "virtualenvwrapper.sh"
-
-The default virtualenv environment that this script creates for you
-to use during OCW work is called "ocw". Whenever you want to work on OCW
-tasks be sure to run
-
- workon ocw
-
-This will activate the OCW environment. When you're done, run
-
- deactivate ocw
-
-If you would like to read more about how to use virtualenv and
-virtualenvwrapper please look to the following websites for documentation.
-
- http://www.virtualenv.org/en/latest/
- http://virtualenvwrapper.readthedocs.org/en/latest/
-
-Additonally, you should set your PYTHONPATH environment variable to point to the
-OCW code base that was downloaded into ./src/ocw For example:
-
- export PYTHONPATH=/path/to/this/script/src/ocw:$PYTHONPATH
-
-OUTRO
[3/5] git commit: CLIMATE-370 - Add Ubuntu 12.04 helper install script
Posted by jo...@apache.org.
CLIMATE-370 - Add Ubuntu 12.04 helper install script
- Add Ubuntu 12.04 helper install script. Due to a problem encountered
using conda to install dependencies, the Anaconda Python distribution
is used instead. For the most part, this just means that additional
dependencies that aren't 100% necessary are downloaded as well.
- The Anaconda distribution that is used needs to be "versioned" at some
level to ensure that new versions of the libraries don't break toolkit
functionality.
- Further testing needs to be done to make the conda install work so
that there is minimal difference between the OS X and Ubuntu install
scripts.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/629630a9
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/629630a9
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/629630a9
Branch: refs/heads/master
Commit: 629630a9c36c960c92671cd00a01908f2440040d
Parents: 41e1298
Author: Michael Joyce <jo...@apache.org>
Authored: Mon May 19 07:30:41 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon May 19 08:45:39 2014 -0700
----------------------------------------------------------------------
easy-ocw/install-ubuntu-12_04.sh | 219 ++++++++++++++++++++++++++++++++++
1 file changed, 219 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/629630a9/easy-ocw/install-ubuntu-12_04.sh
----------------------------------------------------------------------
diff --git a/easy-ocw/install-ubuntu-12_04.sh b/easy-ocw/install-ubuntu-12_04.sh
new file mode 100755
index 0000000..9b9ff0b
--- /dev/null
+++ b/easy-ocw/install-ubuntu-12_04.sh
@@ -0,0 +1,219 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+help()
+{
+cat << ENDHELP
+
+Easy OCW assists with the building of the Apache Open Climate Workbench and its dependencies
+
+Flags:
+ -h Display this help message.
+ -e Install and configure a virtualenv environment before installation.
+ -q Quiet install. User prompts are removed (when possible).
+
+It is recommended that you pass -e when running this script. If you don't, parts
+of this installation will pollute your global Python install. If you're unsure,
+pass -e just to be safe!
+
+ENDHELP
+}
+
+header()
+{
+ echo
+ echo $1
+}
+
+task()
+{
+ echo " - " $1
+}
+
+subtask()
+{
+ echo " " $1
+}
+
+echo
+echo "---------------------------------------------------------------------------"
+echo " Welcome to Easy OCW"
+echo "---------------------------------------------------------------------------"
+echo
+
+WITH_VIRTUAL_ENV=0
+WITH_HOMEBREW=0
+WITH_INTERACT=1
+
+while getopts ":h :e :q" FLAG
+do
+ case $FLAG in
+ h)
+ help
+ exit 1
+ ;;
+ e)
+ WITH_VIRTUAL_ENV=1
+ ;;
+ q)
+ WITH_INTERACT=0
+ ;;
+ ?)
+ help
+ exit 1
+ ;;
+ esac
+done
+
+if [ $WITH_INTERACT == 1 ]; then
+cat << ENDINTRO
+A number of dependencies for OCW will now be installed. Please check the wiki
+for a complete list of dependencies. Additionally, please read the wiki for
+useful installation guidelines and information that may be pertinent.
+
+ENDINTRO
+
+if [ $WITH_VIRTUAL_ENV != 1 ]; then
+cat << VIRTUALENV_WARNING
+It is highly recommended that you allow Easy OCW to install the dependencies
+into a virtualenv environment to ensure that your global Python install is
+not affected. If you're unsure, you should pass the -e flag
+to this script. If you aren't concerned, or you want to create your own
+virtualenv environment, then feel free to ignore this message.
+
+VIRTUALENV_WARNING
+fi
+
+read -p "Press [ENTER] to begin installation ..."
+fi
+
+header "Checking for pip ..."
+if [ ! command -v pip >/dev/null 2>&1 ]; then
+ task "Unable to locate pip."
+ task "Installing Pip"
+ sudo apt-get install python-pip >> install_log
+ subtask "done"
+fi
+
+if [ $WITH_VIRTUAL_ENV == 1 ]; then
+ header "Setting up a virtualenv ..."
+
+ # Check if virtualenv is installed. If it's not, we'll install it for the user.
+ if ! command -v virtualenv >/dev/null 2>&1; then
+ task "Installing virtualenv ..."
+ sudo apt-get install -y python-virtualenv >> install_log
+ subtask "done"
+ fi
+
+ # Create a new environment for OCW work
+ task "Creating a new environment ..."
+ virtualenv ocw >> install_log
+ source ocw/bin/activate
+ subtask "done"
+fi
+
+# Install Continuum Analytics Anaconda Python distribution. This gives
+# almost all the dependencies that OCW needs in a single, easy to
+# install package.
+
+header "Installing Anaconda Python distribution ..."
+echo
+echo "*** NOTE *** When asked to update your PATH, you should respond YES."
+read -p "Press [ENTER] to continue ..."
+
+cd
+task "Downloading Anaconda ..."
+wget -O Anaconda-1.9.2-Linux-x86_64.sh "http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-1.9.2-Linux-x86_64.sh" 2> install_log
+subtask "done"
+
+task "Installing ..."
+bash Anaconda-1.9.2-Linux-x86_64.sh
+export PATH="/home/vagrant/anaconda/bin:$PATH"
+subtask "done"
+
+# Install Basemap. Conda cannot be used for this install since
+# it fails to analyse the dependencies (at the time of writing). This
+# will install it manually. At some point, this should be replaced with
+# 'conda install basemap' once it is working again!
+header "Handling Basemap install ..."
+
+cd
+task "Downloading basemap ..."
+wget -O basemap-1.0.7.tar.gz "http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.7/basemap-1.0.7.tar.gz/download" 2> install_log
+tar xzf basemap-1.0.7.tar.gz >> install_log
+subtask "done"
+
+# Install GEOS
+task "Installing GEOS dependency ..."
+cd basemap-1.0.7/geos-3.3.3
+export GEOS_DIR=/usr/local
+./configure --prefix=$GEOS_DIR >> install_log
+sudo make >> install_log
+sudo make install >> install_log
+subtask "done"
+
+# Install basemap
+task "Installing Basemap ..."
+cd ..
+python setup.py install >> install_log
+subtask "done"
+
+# Install NetCDF4
+header "Installing NetCDF4 ..."
+echo | conda install netcdf4
+subtask "done"
+
+# Install miscellaneous Python packages needed for OCW. Some of these
+# can be installed with Conda, but since none of them have an annoying
+# compiled component we just installed them with Pip.
+header "Installing additional Python packages"
+task "Installing requests ..."
+pip install requests >> install_log
+subtask "done"
+
+task "Installing bottle ..."
+pip install bottle >> install_log
+subtask "done"
+
+task "Installing pydap ..."
+pip install pydap >> install_log
+subtask "done"
+
+task "Installing webtest ..."
+pip install webtest >> install_log
+subtask "done"
+
+task "Installing nose ..."
+pip install nose >> install_log
+subtask "done"
+
+task "Installing pylint ..."
+pip install pylint >> install_log
+subtask "done"
+
+# Grab the latests OCW code
+header "Grabbing the latest OCW code ..."
+cd
+git clone http://www.github.com/apache/climate
+subtask "done"
+
+# Ensure that the climate code is included in the Python Path
+header "Updating PYTHONPATH ..."
+echo "export PYTHONPATH=/home/vagrant/climate:/home/vagrant/climate/ocw/:/home/vagrant/climate/rcmet/src/main/python/rcmes" >> /home/vagrant/.bashrc
+subtask "done"
[2/5] git commit: CLIMATE-370 - Add OS X install script
Posted by jo...@apache.org.
CLIMATE-370 - Add OS X install script
- Add OS X helper install script. Note that this uses the conda
dependencies file for installation of some of the components. At the
moment, specific versions aren't grabbed (just the latest versions of
the components are).
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/41e12989
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/41e12989
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/41e12989
Branch: refs/heads/master
Commit: 41e12989e8bf66eace60b6276e1d65813b545768
Parents: 9353d89
Author: Michael Joyce <jo...@apache.org>
Authored: Mon May 12 10:40:48 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon May 19 08:42:04 2014 -0700
----------------------------------------------------------------------
easy-ocw/install-osx.sh | 184 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 184 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/41e12989/easy-ocw/install-osx.sh
----------------------------------------------------------------------
diff --git a/easy-ocw/install-osx.sh b/easy-ocw/install-osx.sh
new file mode 100755
index 0000000..a45f784
--- /dev/null
+++ b/easy-ocw/install-osx.sh
@@ -0,0 +1,184 @@
+#!/bin/bash
+#
+# PUT HEADER HERE
+
+export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
+
+help()
+{
+cat << ENDHELP
+
+Easy OCW assists with the building of the Apache Open Climate Workbench and its dependencies
+
+Flags:
+ -h Display this help message.
+ -e Install and configure a virtualenv environment before installation.
+ -q Quiet install. User prompts are removed (when possible).
+
+It is recommended that you pass -e when running this script. If you don't, parts
+of this installation will pollute your global Python install. If you're unsure,
+pass -e just to be safe!
+
+ENDHELP
+}
+
+header()
+{
+ echo
+ echo $1
+}
+
+task()
+{
+ echo " - " $1
+}
+
+subtask()
+{
+ echo " " $1
+}
+
+echo
+echo "---------------------------------------------------------------------------"
+echo " Welcome to Easy OCW"
+echo "---------------------------------------------------------------------------"
+echo
+
+WITH_VIRTUAL_ENV=0
+WITH_HOMEBREW=0
+WITH_INTERACT=1
+
+while getopts ":h :e :q" FLAG
+do
+ case $FLAG in
+ h)
+ help
+ exit 1
+ ;;
+ e)
+ WITH_VIRTUAL_ENV=1
+ ;;
+ q)
+ WITH_INTERACT=0
+ ;;
+ ?)
+ help
+ exit 1
+ ;;
+ esac
+done
+
+if [ $WITH_INTERACT == 1 ]; then
+cat << ENDINTRO
+A number of dependencies for OCW will now be installed. Please check the wiki
+for a complete list of dependencies. Additionally, please read the wiki for
+useful installation guidelines and information that may be pertinent to your
+situation.
+
+ENDINTRO
+
+if [ $WITH_VIRTUAL_ENV != 1 ]; then
+cat << VIRTUALENV_WARNING
+It is highly recommended that you allow Easy OCW to install the dependencies
+into a virtualenv environment to ensure that your global Python install is
+not affected. If you're unsure, you should pass the -e flag
+to this script. If you aren't concerned, or you want to create your own
+virtualenv environment, then feel free to ignore this message.
+
+VIRTUALENV_WARNING
+fi
+
+read -p "Press [ENTER] to begin installation ..."
+fi
+
+header "Checking for pip ..."
+if [ ! command -v pip >/dev/null 2>&1 ]; then
+ task "Unable to locate pip."
+ task "Installing Distribute"
+ curl http://python-distribute.org/distribute_setup.py | python >> install_log
+ subtask "done"
+
+ task "Installing Pip"
+ curl -O http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz >> install_log
+ tar xzf pip-1.2.1.tar.gz >> install_log
+ cd pip-1.2.1/
+ python setup.py install >> install_log
+ subtask "done"
+fi
+
+if [ $WITH_VIRTUAL_ENV == 1 ]; then
+ header "Setting up a virtualenv ..."
+
+ # Check if virtualenv is installed. If it's not, we'll install it for the user.
+ if ! command -v virtualenv >/dev/null 2>&1; then
+ task "Installing virtualenv ..."
+ pip install virtualenv >> install_log
+ subtask "done"
+ fi
+
+ # Check if virtualenvwrapper is installed or not. If it's not, we'll
+ # install it for the user. Why wouldn't you want to use virtualenvwrapper?!?!
+ # It's super awesome! By default, virtualenvwrapper installs to the same place
+ # as virtualenv so we'll look for the necessary scripts there. This is fairly
+ # brittle, but it should be sufficient for the majority of cases.
+ virtualEnvLoc=`which virtualenv`
+ virtualEnvWrapperLoc="${virtualEnvLoc}wrapper.sh"
+
+ if [ ! -f $virtualEnvWrapperLoc ]; then
+ task "Installing virtualenvwrapper ..."
+ pip install virtualenvwrapper >> install_log
+ subtask "done"
+
+ task "Setting/sourcing necessary virtualenv things ..."
+ # Need to setup environment for virtualenv
+ export WORKON_HOME=$HOME/.virtualenvs
+ subtask "done"
+ fi
+
+ # Just to be safe, we'll source virtualenvwrapper. This is really only
+ # necessary if we installed it for the user.
+ source $virtualEnvWrapperLoc
+
+ # Create a new environment for OCW work
+ task "Creating a new environment ..."
+ mkvirtualenv ocw >> install_log
+ workon ocw >> install_log
+ subtask "done"
+fi
+
+header "Installing conda for package management ..."
+
+pip install conda >> install_log
+conda init >> install_log
+
+
+header "Installing dependencies with conda ..."
+echo | conda install --file ocw-conda-dependencies.txt
+
+# We only use conda for the annoying dependencies like numpy,
+# scipy, matplotlib, and basemap. For everything else, we stick
+# with pip.
+header "Installing additional Python packages"
+task "Installing requests ..."
+pip install requests >> install_log
+subtask "done"
+
+task "Installing bottle ..."
+pip install bottle >> install_log
+subtask "done"
+
+task "Installing pydap ..."
+pip install pydap >> install_log
+subtask "done"
+
+task "Installing webtest ..."
+pip install webtest >> install_log
+subtask "done"
+
+task "Installing nose ..."
+pip install nose >> install_log
+subtask "done"
+
+task "Installing pylint ..."
+pip install pylint >> install_log
+subtask "done"