Backport from acq-experiment branch:
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 Jan 2008 03:37:47 +0000 (03:37 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 Jan 2008 03:37:47 +0000 (03:37 +0000)
Add a build flag for Python modules.
Use setuptools for building and installing Python modules.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@8389 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile
Open-ILS/src/python/Makefile
Open-ILS/src/python/setup.py
config.sh
install.conf.default
install.sh

index d7782c8..fff0bad 100644 (file)
@@ -141,14 +141,12 @@ perl-install:
 # ------------------------------------------------------------------------------
 
 python-build:
-       @echo $@
-       make -C python build
+       if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python build; fi;
 
 # -----------------------------------------------------------------------------------
 
 python-install:
-       @echo $@
-       make -C python install
+       if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python install; fi;
 
 # -----------------------------------------------------------------------------------
 
@@ -216,5 +214,5 @@ clean:
        make -C extras clean
        make -C apachemods clean
        make -C c-apps clean
-       make -C python clean
+       if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python clean --all; fi;
 
index 9eafc3c..6be673c 100644 (file)
@@ -18,5 +18,5 @@ install:      build
 # CLEAN        
 # ------------------------------------------------------------------------------
 clean:
-       /bin/rm -rf build 
+       python setup.py clean --all
 
index 124863a..4dc8651 100644 (file)
@@ -10,5 +10,4 @@ setup(name='Evergreen',
     license='GPL',
     url='http://www.open-ils.org/',
     packages=['oils', 'oils.utils'],
-    package_dir={'': '.'}
 )
index c96d862..7030b4c 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -92,6 +92,13 @@ function buildConfig {
        prompt "Build targets [${TARGETS[@]:0}] "
        read X; if [ ! -z "$X" ]; then TARGETS=("$X"); fi;
 
+       prompt "Should we build Python modules? (Y/N) [$EG_PYTHON_INSTALL] "
+       read X; 
+    if [ "$X" = "Y" ]; 
+        then EG_PYTHON_INSTALL="Y"; 
+        else EG_PYTHON_INSTALL="";
+    fi;
+
        prompt "Database Driver [$DBDRVR] "
        read X; if [ ! -z "$X" ]; then DBDRVR="$X"; fi;
 
@@ -164,6 +171,7 @@ function writeConfig {
        STR="$STR)";
        _write "$STR";
 
+    _write "EG_PYTHON_INSTALL=\"$EG_PYTHON_INSTALL\"";
        _write "OPENILSDIR=\"Open-ILS/src/\"";
        _write "EVERGREENDIR=\"Evergreen/\"";
 
index 3133a88..ccaa4ef 100644 (file)
@@ -36,6 +36,12 @@ TARGETS=("openils_core" "openils_web" "openils_db");
 
 
 # --------------------------------------------------------------------
+# Should we build the Evergreen Python modules?
+# These depend on having the setuptools module installed.
+# --------------------------------------------------------------------
+EG_PYTHON_INSTALL="N"
+
+# --------------------------------------------------------------------
 # Global install prefix.  Binaries will be installed into PREFIX/bin,
 # libraries will be installed into PREFIX/lib, etc.  The user 
 # running 'install.sh install' must have write permissions to PREFIX
index 18da783..74677b3 100755 (executable)
@@ -119,7 +119,7 @@ function runInstall {
 
                MAKE="make $verbose APXS2=$APXS2 PREFIX=$PREFIX TMP=$TMP APR_HEADERS=$APR_HEADERS \
                        APACHE2_HEADERS=$APACHE2_HEADERS LIBXML2_HEADERS=$LIBXML2_HEADERS DBPORT=$DBPORT\
-                       BINDIR=$BINDIR DBI_LIBS=$DBI_LIBS LIBDIR=$LIBDIR PERLDIR=$PERLDIR INCLUDEDIR=$INCLUDEDIR \
+                       BINDIR=$BINDIR DBI_LIBS=$DBI_LIBS LIBDIR=$LIBDIR PERLDIR=$PERLDIR EG_PYTHON_INSTALL=$EG_PYTHON_INSTALL INCLUDEDIR=$INCLUDEDIR \
                        WEBDIR=$WEBDIR TEMPLATEDIR=$TEMPLATEDIR ETCDIR=$ETCDIR REPORTERDIR=$REPORTERDIR\
                        OPENSRF_HEADERS=$OPENSRF_HEADERS OPENSRF_LIBS=$OPENSRF_LIBS OPENILSDIR=$OPENILSDIR EVERGREENDIR=$EVERGREENDIR \
                        CIRCRULESDIR=$CIRCRULESDIR CATALOGSCRIPTDIR=$CATALOGSCRIPTDIR CGIDIR=$CGIDIR \