[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-appserver ./setup.py scripts/.cvsignore sr...
From: |
Reinhard Mueller |
Subject: |
gnue-appserver ./setup.py scripts/.cvsignore sr... |
Date: |
Mon, 29 Sep 2003 17:57:05 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue-appserver
Branch:
Changes by: Reinhard Mueller <address@hidden> 03/09/29 17:57:05
Modified files:
. : setup.py
scripts : .cvsignore
src : __init__.py
Added files:
scripts : gnue-appserver
Removed files:
. : setup.cfg.in
scripts : gnue-appserver.in
src/_featuretest: __init__.py
Log message:
Use GSetup for setup.py.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/setup.py.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/scripts/gnue-appserver?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/scripts/.cvsignore.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/src/__init__.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: gnue-appserver/scripts/.cvsignore
diff -c gnue-appserver/scripts/.cvsignore:1.2
gnue-appserver/scripts/.cvsignore:1.3
*** gnue-appserver/scripts/.cvsignore:1.2 Wed Sep 17 13:59:13 2003
--- gnue-appserver/scripts/.cvsignore Mon Sep 29 17:57:04 2003
***************
*** 1,2 ****
gacvs
- gnue-appserver
--- 1 ----
Index: gnue-appserver/setup.py
diff -c gnue-appserver/setup.py:1.27 gnue-appserver/setup.py:1.28
*** gnue-appserver/setup.py:1.27 Thu Sep 25 19:36:13 2003
--- gnue-appserver/setup.py Mon Sep 29 17:57:04 2003
***************
*** 21,177 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: setup.py,v 1.27 2003/09/25 23:36:13 reinhard Exp $
import sys
import string
import os
import copy
- from distutils.core import setup
- from distutils.command.build import build
- from distutils.command.install import install
-
from src import PACKAGE, VERSION
! #
-----------------------------------------------------------------------------
! # Check Python version
! #
-----------------------------------------------------------------------------
!
! if sys.hexversion < 0x02010000:
! print "%s needs at least Python version 2.1" % PACKAGE
sys.exit (1)
! #
-----------------------------------------------------------------------------
! # Find out whether or not to use our setup.cfg
! #
-----------------------------------------------------------------------------
!
! have_prefix = 0
! for arg in sys.argv:
! if arg == "--prefix" or arg [:9] == "--prefix=" or \
! arg == "--home" or arg [:7] == "--home=":
! have_prefix = 1
!
! if "install" in sys.argv or "bdist_rpm" in sys.argv:
! if sys.platform != "win32" and not have_prefix:
! os.system ("cp setup.cfg.in setup.cfg")
! else:
! try:
! os.remove ("setup.cfg")
! except:
! pass
! #
-----------------------------------------------------------------------------
! # Build files to be distributed and installed
! #
-----------------------------------------------------------------------------
!
! def build_files ():
! # First check if we have everything installed we need to build the
! # distribution
!
! # Texinfo
! if os.system ("makeinfo --version > /dev/null") != 0:
! print "Could not find 'makeinfo'. Please install Texinfo 4.0 or greater."
! sys.exit (1)
!
! # create-technote-index from gnue-common/utils
! file = "../gnue-common/utils/create-technote-index.py"
! if not os.path.isfile (file):
! print "Could not find file '%s'." % file
! print "Please download gnue-common 0.5.0 or greater."
! sys.exit (1)
!
! # Sablotron
! if os.system ("sabcmd --version > /dev/null") != 0:
! print "Could not find 'sabcmd'. Please install Sablotron."
! sys.exit (1)
!
! # xsl scripts from gnue-common/utils/xml2sql
! for cmd in ["pgsql", "mysql", "mssql", "sybase", "interbase", "display",
! "strip.command"]:
! file = "../gnue-common/utils/xml2sql/%s.xsl" % cmd
if not os.path.isfile (file):
print "Could not find file '%s'." % file
print "Please download gnue-common 0.5.0 or greater."
sys.exit (1)
! # is gacvs available (to build man pages)?
! if not os.path.isfile ("scripts/gacvs"):
! print "Could not find file 'scripts/gacvs'. Please run 'setup-cvs.py'."
! sys.exit (1)
!
! #
---------------------------------------------------------------------------
!
! # Build documentation
! print "building documentation: doc/api"
! if os.system ("cd doc/api && make txt") != 0:
! sys.exit (1)
!
! print "building documentation: doc/whitepaper"
! if os.system ("cd doc/whitepaper && make txt") != 0:
! sys.exit (1)
!
! print "building documentation: doc/technotes"
! if os.system ("cd doc/technotes && make") != 0:
! sys.exit (1)
!
! # Build sample SQL scripts
! print "building sample sql scripts"
! if os.system ("cd samples && make") != 0:
! sys.exit (1)
!
! # Build man page
! print "building man page"
! if os.system ("mkdir -p man && cd man " \
! + "&& ../scripts/gacvs --generate-man-page") != 0:
! sys.exit (1)
!
! #
-----------------------------------------------------------------------------
! # Source distribution: Build files to be distributed
! #
-----------------------------------------------------------------------------
!
! if "sdist" in sys.argv:
! build_files ()
!
! #
-----------------------------------------------------------------------------
! # User can supply a path to the config file
! #
-----------------------------------------------------------------------------
!
! try:
! index = sys.argv.index("--cfg-file")
! site_config = os.path.join(os.path.abspath(sys.argv[index+1]))
! sys.argv.pop(index)
! sys.argv.pop(index)
! config_line = "os.environ['GNUE_INSTALLED_SITE_CFG']='%s'\n" % site_config
! except ValueError:
! config_line = ""
! #
=============================================================================
! # Before build: if done from CVS, build files to be installed
! #
=============================================================================
! class gnue_build (build):
! def finalize_options (self):
! build.finalize_options (self)
! if self.finalized:
! return
! if not os.path.isfile ("PKG-INFO"): # downloaded from CVS?
! if sys.platform != 'win32':
! build_files ()
! #
=============================================================================
! # Before installation: check dependencies and create real scripts
! #
=============================================================================
! class gnue_install (install):
#
---------------------------------------------------------------------------
! # Check dependencies
#
---------------------------------------------------------------------------
! def _check_dependencies (self):
#
-------------------------------------------------------------------------
# xml
--- 21,152 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: setup.py,v 1.28 2003/09/29 21:57:04 reinhard Exp $
import sys
import string
import os
import copy
from src import PACKAGE, VERSION
! try:
! from gnue.common.setup import GSetup
! except ImportError:
! print "You need GNUe-Common 0.5.2 or newer installed to install %s" %
PACKAGE
sys.exit (1)
! class setup (GSetup):
!
! #
---------------------------------------------------------------------------
! # Definition of basic parameters for distribution and installation.
! # Please add new files/directories that should be installed here.
! # Note that you also have to add them to MANIFEST.in.
! #
---------------------------------------------------------------------------
!
! def set_params (self, params):
!
! # The Work
! params ["name"] = PACKAGE
! params ["version"] = VERSION
! params ["description"] = "GNU Enterprise Application Server"
! params ["long_description"] = ""
! params ["license"] = "GPL"
!
! # The Author
! params ["author"] = "GNU Enterprise Team"
! params ["author_email"] = "address@hidden"
! params ["url"] = "http://www.gnue.org"
!
! # The Programs
! params ["package_dir"] = {"gnue.appserver": "src"}
! params ["scripts"] = ["scripts/gnue-appserver"]
!
! # The Data
! datafiles = ["src/classrep/repository.ini"]
! grpcfiles = ["grpc/appserver.grpc"]
! docfiles = ["doc/api/api.txt", "doc/whitepaper/whitepaper.txt"]
! samplefiles = self.allfiles ("samples")
! wfefiles = ["extensions/webfrontend/gnue-forms.js",
! "extensions/webfrontend/vcXMLRPC.js"]
! wfeimages = self.allfiles ("extensions/webfrontend/images")
!
! params ["data_files"] = \
! [("share/gnue-appserver", datafiles),
! ("shared/grpc", grpcfiles),
! ("share/doc/gnue-appserver", docfiles),
! ("share/doc/gnue-appserver/samples", samplefiles),
! ("share/gnue-appserver/webfrontend", wfefiles),
! ("share/gnue-appserver/webfrontend/images", wfeimages)]
!
! #
---------------------------------------------------------------------------
! # Build files to be distributed and installed:
! # Should generate the files that go in a distribution but aren't in CVS.
! # Gets called on sdist (always) and on build/install (only when run from
CVS).
! #
---------------------------------------------------------------------------
! def build_files (self):
!
! # all this only works on posix systems :-(
! if os.name != "posix":
! return
!
! # First check if we have everything installed we need to build the
! # distribution
!
! # Texinfo
! if os.system ("makeinfo --version > /dev/null") != 0:
! print "Could not find 'makeinfo'. Please install Texinfo 4.0 or
greater."
! sys.exit (1)
!
! # create-technote-index from gnue-common/utils
! file = "../gnue-common/utils/create-technote-index.py"
if not os.path.isfile (file):
print "Could not find file '%s'." % file
print "Please download gnue-common 0.5.0 or greater."
sys.exit (1)
! # Sablotron
! if os.system ("sabcmd --version > /dev/null") != 0:
! print "Could not find 'sabcmd'. Please install Sablotron."
! sys.exit (1)
! # xsl scripts from gnue-common/utils/xml2sql
! for cmd in ["pgsql", "mysql", "mssql", "sybase", "interbase", "display",
! "strip.command"]:
! file = "../gnue-common/utils/xml2sql/%s.xsl" % cmd
! if not os.path.isfile (file):
! print "Could not find file '%s'." % file
! print "Please download gnue-common 0.5.0 or greater."
! sys.exit (1)
! #
-------------------------------------------------------------------------
! # Build documentation
! print "building documentation: doc/api"
! if os.system ("cd doc/api && make txt") != 0:
! sys.exit (1)
! print "building documentation: doc/whitepaper"
! if os.system ("cd doc/whitepaper && make txt") != 0:
! sys.exit (1)
! print "building documentation: doc/technotes"
! if os.system ("cd doc/technotes && make") != 0:
! sys.exit (1)
! # Build sample SQL scripts
! print "building sample sql scripts"
! if os.system ("cd samples && make") != 0:
! sys.exit (1)
#
---------------------------------------------------------------------------
! # Check dependencies for installation:
! # Should sys.exit(1) in case any requirement isn't met.
! # Gets called on install.
#
---------------------------------------------------------------------------
! def check_dependencies (self):
#
-------------------------------------------------------------------------
# xml
***************
*** 217,427 ****
"""
sys.exit (1)
! #
-------------------------------------------------------------------------
! # gnue-common
! print "checking GNUe-Common library"
! try:
! import gnue.common
! except ImportError:
! print "---"
! print "Could not import the gnue-common package. " \
! + "Please install GNUe-Common."
! print "Note that GNUe-Appserver has to be installed in the same"
! print "directory as GNUe-Common."
! print "The file 'INSTALL' contains more information about dependencies."
! sys.exit (1)
! if gnue.common.__hexversion__ < 0x00050100:
! print "---"
! print "The gnue-common package you have installed is too old."
! print "Please install GNUe-Common 0.5.1 or greater."
! print "The file 'INSTALL' contains more information about dependencies."
! sys.exit (1)
! appserver_path = os.path.normcase (os.path.dirname (self.install_lib))
! common_path = os.path.normcase (os.path.dirname (gnue.__path__ [0]))
! if appserver_path != common_path:
! print "---"
! print "GNUe-Common is installed in %s." % common_path
! print "You are trying to install GNUe-AppServer in %s." % appserver_path
! print "GNUe-Appserver has to be installed in the same directory as
GNUe-Common."
! sys.exit (1)
!
! #
---------------------------------------------------------------------------
! # Build the commands to place into the scripts
! #
---------------------------------------------------------------------------
!
! def _build_gnue_env (self, path_line, config_line):
! if sys.platform != "win32":
! gnue_env = \
! "#######\n" \
! + "# The following variables were set when GNUe was installed\n" \
! + "INST_GNUE_CONNECTIONS='%s/etc/connections.conf'\n" % self.prefix \
! + path_line \
! + "import os\n" \
! + config_line \
! + "#######\n"
! else:
! gnue_env = \
! "#######\n" \
! + "# The following variables were set when GNUe was installed\n" \
! + "# (Generated for a Win32 system)\n" \
! + "import os, sys\n" \
! + "if __name__ == '__main__': \n" \
! + " _BASE =
os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),'..'))\n" \
! + " try:\n" \
! + " os.environ['PATH']=
os.path.abspath(os.path.dirname(sys.argv[0])) + ';' + os.environ['PATH']\n" \
! + " except KeyError:\n" \
! + " os.environ['PATH']=
os.path.abspath(os.path.dirname(sys.argv[0]))\n" \
! + "else: \n" \
! + " _BASE =
os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))\n" \
! +
"INST_GNUE_CONNECTIONS=os.path.join(_BASE,'etc','connections.conf')\n" \
! + "os.putenv('PYTHONCASEOK','1')\n" \
! + config_line \
! + "if os.path.isdir(os.path.join(_BASE,'extras')):\n" \
! + " sys.path.append(os.path.join(_BASE,'extras'))\n" \
! + "#######\n\n"
! return gnue_env
!
! #
---------------------------------------------------------------------------
! # Generate the real scripts
! #
---------------------------------------------------------------------------
!
! def _generate_scripts (self, path_line, config_line):
! gnue_env = self._build_gnue_env (path_line, config_line)
!
! for script in self.distribution.scripts:
! print "building script %s" % script
!
! fin = open(script+".in", "r")
! fout = open(script, "w")
!
! lines = fin.readlines()
!
! for i in range(0, len(lines)):
! if string.strip(lines[i]) == "__GNUEENV__":
! lines[i] = gnue_env
!
! fout.writelines(lines)
!
! fin.close()
! fout.close()
!
! #
---------------------------------------------------------------------------
! # Do it all - this is called by setup () if option install is given
! #
---------------------------------------------------------------------------
!
! def finalize_options (self):
! install.finalize_options (self)
! if self.finalized:
! return
!
! # if install directory isn't in Python's search path, add it there
! if self.install_lib in sys.path:
! path_line = ""
! else:
! sys.path.append (self.install_lib)
! path_line = "import sys\nsys.path.append('%s')\n" % self.install_lib
!
! self._check_dependencies ()
!
! self._generate_scripts (path_line, config_line)
!
! #
-----------------------------------------------------------------------------
! # GNUE_VERSION_SUFFIX handling
! #
-----------------------------------------------------------------------------
!
! # You can run:
! # $ GNUE_VERSION_SUFFIX=-pre1 ./setup.py sdist
! # and the packages will be created as GNUe-App-0.x.x-pre1.tar.gz
! try:
! suffix = os.environ["GNUE_VERSION_SUFFIX"]
! except KeyError:
! suffix = ""
!
! #
-----------------------------------------------------------------------------
! # Call the actual setup routine
! #
-----------------------------------------------------------------------------
!
! datafiles = ["src/classrep/repository.ini"]
!
! grpcfiles = ["grpc/appserver.grpc"]
!
! # check if warnings should be printed
! phony = 1
! if ('--help' in sys.argv) or (len(sys.argv)==1):
! phony = 0
!
! manfiles = []
! for file in ("man/gnue-appserver.1",):
! if os.path.isfile(file):
! manfiles.append(file)
! else:
! if phony:
! print "WARNING: File %s does not exist... not installing!" % file
!
! docfiles = []
! for file in ("AUTHORS", "COPYING", "INSTALL", "NEWS", "README", "ROADMAP",
! "THANKS", "TODO", "doc/api/api.txt",
! "doc/whitepaper/whitepaper.txt"):
! if os.path.isfile(file):
! docfiles.append(file)
! else:
! if phony:
! print "WARNING: File %s does not exist... not installing!" % file
!
! samplefiles = []
! for file in ("samples/sample.gfd", "samples/GNUe_ClassRepository.gfd",
! "samples/interbase.sql", "samples/mssql.sql",
! "samples/mysql.sql", "samples/pgsql.sql", "samples/sybase.sql",
! "samples/setup-mysql.sh", "samples/setup-pgsql.sh"):
! if os.path.isfile(file):
! samplefiles.append(file)
! else:
! if phony:
! print "WARNING: File %s does not exist... not installing!" % file
!
! wfefiles = ["extensions/webfrontend/gnue-forms.js",
! "extensions/webfrontend/vcXMLRPC.js"]
!
! wfeimages = []
! for file in os.listdir ("extensions/webfrontend/images"):
! if not file == "CVS":
! wfeimages.append ("extensions/webfrontend/images/" + file)
!
! setup (name = "GNUe-AppServer",
! version = VERSION + suffix,
! description = "GNU Enterprise Application Server",
! long_description = "",
! author = "GNUe Application Server Team",
! author_email = "address@hidden",
! url = "http://www.gnue.org",
! license = "GPL",
!
! # Override certain command classes with our own ones
! cmdclass = {"build": gnue_build,
! "install": gnue_install},
!
! data_files = [("share/gnue-appserver", datafiles),
! ("shared/grpc", grpcfiles),
! ("share/man/man1", manfiles),
! ("share/doc/gnue-appserver", docfiles),
! ("share/doc/gnue-appserver/samples", samplefiles),
! ("share/gnue-appserver/webfrontend", wfefiles),
! ("share/gnue-appserver/webfrontend/images", wfeimages)],
!
! packages = ["gnue.appserver",
! "gnue.appserver.classrep",
! "gnue.appserver.language"],
!
! package_dir = {"gnue.appserver" : "src"},
!
! scripts = ["scripts/gnue-appserver"]
! )
!
! #
-----------------------------------------------------------------------------
! # Clean up
! #
-----------------------------------------------------------------------------
!
! if "install" in sys.argv or "bdist_rpm" in sys.argv:
! if sys.platform != "win32":
! os.system ("/bin/rm -rf setup.cfg")
--- 192,198 ----
"""
sys.exit (1)
! #
=============================================================================
! if __name__ == "__main__":
! setup().run()
Index: gnue-appserver/src/__init__.py
diff -c gnue-appserver/src/__init__.py:1.12 gnue-appserver/src/__init__.py:1.13
*** gnue-appserver/src/__init__.py:1.12 Mon Sep 22 16:56:24 2003
--- gnue-appserver/src/__init__.py Mon Sep 29 17:57:04 2003
***************
*** 57,60 ****
__hexversion__ = HEXVERSION
! PACKAGE="GNUe Application Server"
--- 57,60 ----
__hexversion__ = HEXVERSION
! PACKAGE="GNUe-AppServer"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue-appserver ./setup.py scripts/.cvsignore sr...,
Reinhard Mueller <=