Use distutils to install Python into the standard location
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 23 Dec 2007 02:31:38 +0000 (02:31 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 23 Dec 2007 02:31:38 +0000 (02:31 +0000)
Correct a syntax error in http_translator.py

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1183 9efc2488-bf62-4759-914b-345cdb29e865

src/Makefile
src/python/Makefile [new file with mode: 0644]
src/python/osrf/http_translator.py
src/python/setup.py [new file with mode: 0644]

index c1862b1..9a7e767 100644 (file)
@@ -1,12 +1,10 @@
 # TOP level 'src' makefile for OpenSRF
 
-
 export TMPDIR  = $(TMP)/opensrf
 export OPENSRF = opensrf
 export BINDIR  = $(PREFIX)/bin
 export LIBDIR  = $(PREFIX)/lib
 export PERLDIR = $(LIBDIR)/perl5
-export PYTHON25DIR     = $(LIBDIR)/python25
 export JSDIR   = $(LIBDIR)/javascript
 export INCLUDEDIR= $(PREFIX)/include
 
@@ -34,7 +32,7 @@ install:      install-prep \
                jserver-install \
                javascript-install \
                perl-install \
-               python25-install \
+               python-install \
                java-install
 
 
@@ -81,7 +79,6 @@ install-prep:
        mkdir -p $(BINDIR)
        mkdir -p $(JSDIR)
        mkdir -p $(PERLDIR)
-       mkdir -p $(PYTHON25DIR)
        mkdir -p $(INCLUDEDIR)
        mkdir -p $(ETCDIR)
 
@@ -125,9 +122,8 @@ perl-install:       install-prep
        @echo $@
        cp -r perlmods/* $(PERLDIR)/
 
-python25-install:      install-prep
-       @echo $@
-       cp -r python/* $(PYTHON25DIR)/
+python-install:
+       make -C python install
 
 java-install:
        if [ -n "$(OSRF_INSTALL_JAVA)" ]; then echo $@; cd java && . deps.inc && make install; fi;
@@ -143,6 +139,7 @@ clean:
        make -C srfsh clean
        make -C c-apps clean
        make -C java clean
+       make -C python clean
        /bin/rm -rf $(TMPDIR) *.o
 
 
diff --git a/src/python/Makefile b/src/python/Makefile
new file mode 100644 (file)
index 0000000..5b3039c
--- /dev/null
@@ -0,0 +1,21 @@
+# makefile for OpenSRF Python modules and scripts
+
+install:       python-install
+
+# --------------------------------------------------------------------------------
+# INSTALL
+# --------------------------------------------------------------------------------
+python-build:
+       @echo $@
+       python setup.py build
+
+python-install:        python-build
+       @echo $@
+       python setup.py install
+
+# --------------------------------------------------------------------------------
+# CLEAN        
+# --------------------------------------------------------------------------------
+clean:
+       /bin/rm -rf build 
+
index 5c954be..bbed325 100644 (file)
@@ -8,7 +8,7 @@ import osrf.conf
 import osrf.set
 import sys
 from osrf.const import OSRF_MESSAGE_TYPE_DISCONNECT, OSRF_STATUS_CONTINUE, \
-    OSRF_STATUS_TIMEOUT, OSRF_MESSAGE_TYPE_STATUS,
+    OSRF_STATUS_TIMEOUT, OSRF_MESSAGE_TYPE_STATUS
 import osrf.net
 import osrf.log
 
diff --git a/src/python/setup.py b/src/python/setup.py
new file mode 100644 (file)
index 0000000..fdbca95
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+from distutils.core import setup
+import os, os.path
+
+dir = os.path.dirname(__file__)
+
+setup(name='OpenSRF',
+    version='1.2',
+# requires is not actually implemented in distutils
+#    requires=['memcache', 'pyxmpp', 'simplejson'],
+    description='OpenSRF Python Modules',
+    author='Bill Erickson',
+    author_email='open-ils-dev@list.georgialibraries.org',
+    url='http://www.open-ils.org/',
+    packages=['osrf'],
+    package_dir={'': dir},
+    scripts=[os.path.join(dir, 'srfsh.py')]
+)