From: dbs Date: Tue, 15 Jan 2008 18:34:22 +0000 (+0000) Subject: Add a build flag for Python modules. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8839ca1a3f903070e8cbb915a9b0b12ee784194b;p=Evergreen.git Add a build flag for Python modules. Use setuptools for building and installing Python modules. git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8386 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 91abf1d28a..4dc86516f7 100644 --- a/Open-ILS/src/python/setup.py +++ b/Open-ILS/src/python/setup.py @@ -1,16 +1,13 @@ #!/usr/bin/env python -from distutils.core import setup -import os, os.path - -dir = os.path.dirname(__file__) +from setuptools import setup setup(name='Evergreen', - version='1.2', - requires='OpenSRF', + version='1.4', + install_requires='OpenSRF>=1.0', description='Evergreen Python Modules', author='Bill Erickson', - author_email='open-ils-dev@list.georgialibraries.org', + author_email='erickson@esilibrary.com', + license='GPL', url='http://www.open-ils.org/', packages=['oils', 'oils.utils'], - package_dir={'': 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 \