Permalink
Browse files

Updated polar2grid_env.sh to use new style of swbundle build, which is

to install polar2grid packages into ShellB3 directly.  Created a simple
first-draft Makefile to help install and package building.  Updated
README just a little bit.
  • Loading branch information...
djhoese committed Nov 30, 2012
1 parent f2b1150 commit bd88e867b716da311fa5262d9549e9e86d736566
Showing with 56 additions and 19 deletions.
  1. +50 −0 py/Makefile
  2. +3 −3 swbundle/README.txt
  3. +3 −16 swbundle/polar2grid_env.sh
View
@@ -0,0 +1,50 @@
+# Makefile to simplify polar2grid package operations
+# Author: David Hoese, SSEC
+
+INSTALL_DIR ?= ./python
+DIST_DIR ?= ./dist
+
+CORE_PKG_DIR = polar2grid_core
+VIIRS_PKG_DIR = polar2grid_viirs
+MAIN_PKG_DIR = polar2grid
+
+# Make sure target names are just the dir name with a suffix
+# See targets for substitution
+ALL_PKG_DIRS = $(CORE_PKG_DIR) $(VIIRS_PKG_DIR) $(MAIN_PKG_DIR)
+ALL_PKG_SDIST = $(ALL_PKG_DIRS:=_sdist)
+#ALL_PKG_SDIST = polar2grid_core_sdist polar2grid_viirs_sdist polar2grid_sdist
+ALL_PKG_DEV = polar2grid_core_dev polar2grid_viirs_dev polar2grid_dev
+
+all: all_sdist
+
+all_sdist: $(ALL_PKG_SDIST) clean_sdist_build
+
+all_dev: $(ALL_PKG_DEV)
+
+$(ALL_PKG_SDIST): $(DIST_DIR)
+ cd $(@:_sdist=); \
+ python setup.py sdist
+ mv $(@:_sdist=)/dist/*.tar.gz $(DIST_DIR)
+
+$(ALL_PKG_DEV): $(INSTALL_DIR)
+ cd $(@:_dev=); \
+ python setup.py develop -d $(INSTALL_DIR)
+
+$(INSTALL_DIR):
+ mkdir -p $(INSTALL_DIR)
+
+$(DIST_DIR):
+ mkdir -p $(DIST_DIR)
+
+### Clean up what we've done ###
+clean_sdist:
+ rm -rf $(DIST_DIR)
+
+# This is ugly, but not sure how to make it better
+clean_sdist_build:
+ for pkg_dir in $(ALL_PKG_DIRS); do \
+ rm -rf $$pkg_dir/dist; \
+ done
+
+clean: clean_sdist clean_sdist_build
+
View
@@ -1,8 +1,8 @@
polar2grid software bundle
==========================
-Author: David Hoese
+Author: David Hoese
Organization: University of Wisconsin - Space Science and Engineering Center
-Rev Id: $Id$
+Copyright: December 2012
Installation
============
@@ -12,7 +12,7 @@ Installation
2. Add the following line to your .bash_profile or .bashrc:
export POLAR2GRID_HOME=/path/to/untarred-swbundle-dir
-To Run A polar2grid Script
+To run a polar2grid glue script
==========================
The polar2grid scripts are usually part of a larger system, but if you want
to run a script manually:
View
@@ -7,23 +7,10 @@ if [ -z "$POLAR2GRID_REV" ]; then
export POLAR2GRID_HOME="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
fi
- EGG_LOC=$POLAR2GRID_HOME/python
-
+ # Add all polar2grid scripts to PATH
export PATH=$POLAR2GRID_HOME/bin:$PATH
- export PYTHONPATH=$EGG_LOC:$PYTHONPATH
-
- # Script config file locations
- #if [ -z "$VIIRS_GRIDS_CONFIG" ]; then
- # export VIIRS_GRIDS_CONFIG=$PKG_BASE/awips/awips_grids.conf
- #fi
-
- #if [ -z "$VIIRS_ANCIL_DIR" ]; then
- # export VIIRS_ANCIL_DIR=$PKG_BASE/grids/
- #fi
-
- #if [ -z "$VIIRS_SHAPE_CONFIG" ]; then
- # export VIIRS_SHAPE_CONFIG=$PKG_BASE/awips/awips_shapes.conf
- #fi
+ # Add ShellB3 to PATH
+ export PATH=$POLAR2GRID_HOME/ShellB3/bin:$PATH
export POLAR2GRID_REV="$Id$"
fi

0 comments on commit bd88e86

Please sign in to comment.