From f1335eb38bdc06e47d8ee91b9ce79d3a0439b4ac Mon Sep 17 00:00:00 2001 From: dbs Date: Wed, 16 Jan 2008 03:37:47 +0000 Subject: [PATCH] Backport from acq-experiment branch: 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 | 8 +++----- Open-ILS/src/python/Makefile | 2 +- Open-ILS/src/python/setup.py | 1 - config.sh | 8 ++++++++ install.conf.default | 6 ++++++ install.sh | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index d7782c8654..fff0bad178 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -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; diff --git a/Open-ILS/src/python/Makefile b/Open-ILS/src/python/Makefile index 9eafc3c793..6be673c2f8 100644 --- a/Open-ILS/src/python/Makefile +++ b/Open-ILS/src/python/Makefile @@ -18,5 +18,5 @@ install: build # CLEAN # ------------------------------------------------------------------------------ clean: - /bin/rm -rf build + python setup.py clean --all diff --git a/Open-ILS/src/python/setup.py b/Open-ILS/src/python/setup.py index 124863ae7f..4dc86516f7 100644 --- a/Open-ILS/src/python/setup.py +++ b/Open-ILS/src/python/setup.py @@ -10,5 +10,4 @@ setup(name='Evergreen', license='GPL', url='http://www.open-ils.org/', packages=['oils', 'oils.utils'], - package_dir={'': '.'} ) diff --git a/config.sh b/config.sh index c96d8623c0..7030b4c685 100755 --- 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/\""; diff --git a/install.conf.default b/install.conf.default index 3133a886cc..ccaa4ef932 100644 --- a/install.conf.default +++ b/install.conf.default @@ -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 diff --git a/install.sh b/install.sh index 18da78311d..74677b3928 100755 --- a/install.sh +++ b/install.sh @@ -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 \ -- 2.11.0