commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue-appserver setup.py


From: Reinhard Mueller
Subject: gnue-appserver setup.py
Date: Fri, 19 Sep 2003 07:12:52 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-appserver
Branch:         
Changes by:     Reinhard Mueller <address@hidden>       03/09/19 07:12:52

Modified files:
        .              : setup.py 

Log message:
        A setup.py that even works with --prefix and --root.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/setup.py.diff?tr1=1.16&tr2=1.17&r1=text&r2=text

Patches:
Index: gnue-appserver/setup.py
diff -c gnue-appserver/setup.py:1.16 gnue-appserver/setup.py:1.17
*** gnue-appserver/setup.py:1.16        Fri Sep 19 00:01:38 2003
--- gnue-appserver/setup.py     Fri Sep 19 07:12:51 2003
***************
*** 21,32 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: setup.py,v 1.16 2003/09/19 04:01:38 jcater Exp $
  
  import sys
  import string
  import os
- import os.path
  import copy
  
  from distutils.core import setup
--- 21,31 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: setup.py,v 1.17 2003/09/19 11:12:51 reinhard Exp $
  
  import sys
  import string
  import os
  import copy
  
  from distutils.core import setup
***************
*** 43,54 ****
    sys.exit (1)
  
  # 
-----------------------------------------------------------------------------
! # distutils won't allow us to set absolute path prefix on windows
  # 
-----------------------------------------------------------------------------
  
  if "install" in sys.argv or "bdist_rpm" in sys.argv:
!   if sys.platform != 'win32' and '--prefix' not in sys.argv and '--root' not 
in sys.argv:
      os.system ("cp setup.cfg.in setup.cfg")
  
  # 
-----------------------------------------------------------------------------
  # sdist (Source distribution): build documentation, SQL scripts and manpage
--- 42,73 ----
    sys.exit (1)
  
  # 
-----------------------------------------------------------------------------
! # Find out whether or not to use our setup.cfg
  # 
-----------------------------------------------------------------------------
  
+ prefix = None
+ have_prefix = 0
+ i = 0
+ for arg in sys.argv:
+   if arg == "--prefix":
+     try:
+       prefix = sys.argv [i+1]
+       have_prefix = 1
+     except:
+       pass
+   if arg [:9] == "--prefix=":
+     prefix = arg [9:]
+     have_prefix = 1
+   i = i + 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
  
  # 
-----------------------------------------------------------------------------
  # sdist (Source distribution): build documentation, SQL scripts and manpage
***************
*** 177,184 ****
--- 196,211 ----
  except ValueError:
    config_line = ""
  
+ if have_prefix:
+   install_lib = os.path.join (prefix, "lib", "python%s" % sys.version [:3],
+                               "site-packages")
+ else:
+   install_lib = None
+ 
  class my_build_scripts(build_scripts):
    def finalize_options(self):
+     global prefix
+     global install_lib
  
      build_scripts.finalize_options(self)
  
***************
*** 186,202 ****
        return
  
      if sys.platform != "win32":
!       dict = self.distribution.get_option_dict ("install")
!       install_prefix = dict ["prefix"] [1]
!       sys.path.append (dict ["install_lib"] [1])
        gnue_env = \
             "#######\n" \
!          + "# The following variable were set when GNUe was installed\n" \
!          + "import os, sys\n" \
!          + "sys.path.append('%s')\n" % dict["install_lib"][1] \
!          + "INST_GNUE_CONNECTIONS='%s/etc/connections.conf'\n" % 
dict["prefix"][1] \
!          + "os.environ['INSTALL_LIB']='%s'\n" % dict["install_lib"][1] \
!          + "os.environ['INSTALL_PREFIX']='%s'\n" % dict["prefix"][1] \
           + config_line \
           + "#######\n"
      else:
--- 213,237 ----
        return
  
      if sys.platform != "win32":
!       if not have_prefix:
!         dict = self.distribution.get_option_dict ("install")
!         prefix = dict ["prefix"] [1]
!         install_lib = dict ["install_lib"] [1]
! 
!       if install_lib in sys.path:
!         path_line = ""
!       else:
!         sys.path.append (install_lib)
!         path_line = "import sys\nsys.path.append('%s')\n" % install_lib
! 
        gnue_env = \
             "#######\n" \
!          + "# The following variables were set when GNUe was installed\n" \
!          + "import os\n" \
!          + path_line \
!          + "INST_GNUE_CONNECTIONS='%s/etc/connections.conf'\n" % prefix \
!          + "os.environ['INSTALL_LIB']='%s'\n" % install_lib \
!          + "os.environ['INSTALL_PREFIX']='%s'\n" % prefix \
           + config_line \
           + "#######\n"
      else:
***************
*** 269,274 ****
--- 304,314 ----
  samplefiles = ["samples/sample.gfd", "samples/setup-pgsql.sh",
                 "samples/setup-mysql.sh"]
  
+ if have_prefix:
+   classrepdir = os.path.join (install_lib, "gnue", "appserver", "classrep")
+ else:
+   classrepdir = "lib/python/gnue/appserver/classrep"
+ 
  setup (name = "GNUe-AppServer",
         version = VERSION + suffix,
         description = "GNU Enterprise Application Server",
***************
*** 290,297 ****
                        ("samples/appserver/pgsql", ["samples/pgsql/full.sql"]),
                        ("samples/appserver/sybase", 
["samples/sybase/full.sql"]),
                        ("shared/grpc", ["grpc/appserver.grpc"]),
!                       ("lib/python/gnue/appserver/classrep",
!                                                
["src/classrep/repository.ini"])
                         ],
  
         packages = ["gnue.appserver",
--- 330,336 ----
                        ("samples/appserver/pgsql", ["samples/pgsql/full.sql"]),
                        ("samples/appserver/sybase", 
["samples/sybase/full.sql"]),
                        ("shared/grpc", ["grpc/appserver.grpc"]),
!                       (classrepdir, ["src/classrep/repository.ini"])
                         ],
  
         packages = ["gnue.appserver",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]