diff -r 2dacd360ccb2 requires.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/requires.py	Mon Aug 03 13:51:31 2009 -0400
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+from pkg_resources import Requirement, WorkingSet
+from string import join
+import sys
+import os
+import getopt
+import re
+
+
+install_requires = [
+  "django >= 1.1",
+  "ssl >= 1.14",
+  "pycrypto >= 2.0.1",
+  "reportlab >= 2.1",
+  "django-registration >= 0.7",
+  "django-app-plugins >= 0.1",
+  "trml2pdf >= 1.0",
+  "pyyaml >= 3.0",
+  "django-threaded-multihost >= 1.3",
+  "PIL >= 1.1.6",
+  "sorl >= 3.1",
+]
+
+dependency_links = [
+  "http://ftp.linux.org.uk/pub/people/pakrat/Satchmo/",
+  "http://www.reportlab.org/downloads.html",
+  "http://download.zope.org/distribution/",
+  "http://banjo.assembla.com/spaces/threaded_multihost/documents",
+  "http://code.enthought.com/enstaller/eggs/rhel/3/Reportlab-2.1.0001-py2.5.egg#egg=Reportlab-2.1.001",
+  "http://code.google.com/p/django-command-extensions/downloads/list",
+# reportlab 2.2 won't properly build under setuptools.
+#  "http://www.reportlab.org/ftp/ReportLab_2_2.tgz#egg=Reportlab-2.2",
+#  "http://www.reportlab.org/ftp/ReportLab_2_3.tar.gz#egg=Reportlab-2.3",
+]
+
+extras_require = {
+  'elementtree': ["elementtree >= 1.2.7"],
+  'docutils': ["docutils >= 0.5"],
+  'django-extensions': ["django-extensions >= 0.4", "werkzeug >= 0.5.1" ],
+}
+all=[]
+for req in extra_require.values():
+  all+=req
+extras_require['all']= all
+
+
+def check_requires(requirements):
+  available=dict()
+  missing=dict()
+  w=WorkingSet()
+  for requirement in requirements:
+    r = Requirement.parse(requirement)
+    dist = w.find(r)
+    if dist:
+        available[requirement]=dist
+    else:
+        missing[requirement]=None
+  return (available, missing)
+
+def PIL_kludge():
+  """Kludgery to get a reasonably installable PIL"""
+  global install_requires
+  available, missing = check_requires(install_requires)
+  for m in missing:
+    if re.search('^PIL', m):
+      install_requires.remove(m)
+      install_requires.append('PILwoTk')
+      break
+
+def PIL_kludge():
+  """Kludgery to get a reasonably installable PIL"""
+  global install_requires
+  available, missing = check_requires(install_requires)
+  for m in missing:
+    if re.search('^PIL', m):
+      install_requires.remove(m)
+      install_requires.append('PILwoTk')
+      break
+
+class Usage(Exception):
+  def __init__(self, msg):
+    self.msg = msg
+
+def usage():
+  print >>sys.stderr, "-h for help"
+  print >>sys.stderr, "-a for available"
+  print >>sys.stderr, "-m for missing"
+  print >>sys.stderr, "-p for path"
+
+def main(argv=None):
+  do_available, do_missing, do_path, do_extra = None, None, None, None
+  if argv is None:
+    argv = sys.argv
+  try:
+    try:
+      opts, args = getopt.getopt(argv[1:], "hampe")
+    except getopt.GetoptError, msg:
+      raise Usage(msg)
+  except Usage, err:
+    print >>sys.stderr, err.msg
+    print >>sys.stderr, "for help use -h"
+  for o, a in opts:
+    if o == '-h':
+      return(usage())
+    elif o == '-a':
+      do_available=1
+    elif o == '-m':
+      do_missing=1
+    elif o == '-p':
+      do_path=1
+    elif o == '-e':
+      do_extra=1
+    else:
+      assert Usage, "Unknown option"
+  requires=install_requires[:]
+  if do_extra:
+    for p in extras_require.values():
+      requires+=p
+  available, missing = check_requires(requires)
+  if do_available: 
+    for p in sorted(available.keys()): 
+      print p+':', available[p].__repr__()
+  if do_missing: 
+    for p in sorted(missing.keys()): 
+      print p
+  if do_path:
+    path=dict()
+    for p in sorted(available.values()): 
+      path[p.location]=None
+    print join(path.keys(),os.path.pathsep)
+
+if __name__ == "__main__":
+  sys.exit(main())
diff -r 2dacd360ccb2 setup.py
--- a/setup.py	Sun Aug 02 11:02:46 2009 -0500
+++ b/setup.py	Mon Aug 03 13:51:31 2009 -0400
@@ -8,6 +8,7 @@
 from setuptools import setup, find_packages
 import os, os.path
 import sys
+from requires import install_requires, dependency_links, extras_require, PIL_kludge
 
 DIRNAME = os.path.dirname(__file__)
 APPDIR = os.path.join(DIRNAME, 'satchmo/apps')
@@ -17,7 +18,9 @@
 # Dynamically calculate the version based on django.VERSION.
 version = __import__('satchmo_store').__version__
 packages = find_packages('satchmo/apps')
-packages.append('static')
+#packages.append('static')
+
+PIL_kludge()
 
 setup(name = "Satchmo",
       version = version,
@@ -34,6 +37,9 @@
       'static' : 'satchmo/static'
       },
       setup_requires=["setuptools_hg"],
+      install_requires = install_requires,
+      dependency_links = dependency_links,
+      extras_require = extras_require,
       packages = packages,
       classifiers = [
       'Development Status :: 4 - Beta',
