[Zope-Checkins] CVS: Zope2 - compile_all.py:1.1.2.1 make_instance.py:1.1.2.1 zctl.py.in:1.1.2.1 build_pcgi.py:1.1.158.1

evan@serenade.digicool.com evan@serenade.digicool.com
Thu, 19 Apr 2001 15:46:19 -0400


Update of /cvs-repository/Zope2/inst
In directory serenade.digicool.com:/home/evan/Zope/trunk/inst

Modified Files:
      Tag: evan-makefile-branch
	build_pcgi.py 
Added Files:
      Tag: evan-makefile-branch
	compile_all.py make_instance.py zctl.py.in 
Log Message:
Add makefile-driven installation process



--- Added File compile_all.py in package Zope2 ---
##############################################################################
# 
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
# 
# Copyright (c) Digital Creations.  All rights reserved.
# 
# This license has been certified as Open Source(tm).
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions in source code must retain the above copyright
#    notice, this list of conditions, and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions, and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 
# 3. Digital Creations requests that attribution be given to Zope
#    in any manner possible. Zope includes a "Powered by Zope"
#    button that is installed by default. While it is not a license
#    violation to remove this button, it is requested that the
#    attribution remain. A significant investment has been put
#    into Zope, and this effort will continue if the Zope community
#    continues to grow. This is one way to assure that growth.
# 
# 4. All advertising materials and documentation mentioning
#    features derived from or use of this software must display
#    the following acknowledgement:
# 
#      "This product includes software developed by Digital Creations
#      for use in the Z Object Publishing Environment
#      (http://www.zope.org/)."
# 
#    In the event that the product being advertised includes an
#    intact Zope distribution (with copyright and license included)
#    then this clause is waived.
# 
# 5. Names associated with Zope or Digital Creations must not be used to
#    endorse or promote products derived from this software without
#    prior written permission from Digital Creations.
# 
# 6. Modified redistributions of any form whatsoever must retain
#    the following acknowledgment:
# 
#      "This product includes software developed by Digital Creations
#      for use in the Z Object Publishing Environment
#      (http://www.zope.org/)."
# 
#    Intact (re-)distributions of any official Zope release do not
#    require an external acknowledgement.
# 
# 7. Modifications are encouraged but must be packaged separately as
#    patches to official Zope releases.  Distributions that do not
#    clearly separate the patches from the original work must be clearly
#    labeled as unofficial distributions.  Modifications which do not
#    carry the name Zope may be packaged in any form, as long as they
#    conform to all of the clauses above.
# 
# 
# Disclaimer
# 
#   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
#   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# 
# 
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations.  Specific
# attributions are listed in the accompanying credits file.
# 
##############################################################################
"""Try to do all of the installation steps."""

import sys, os

def setup(me):
    home=os.path.split(me)[0]
    if not home or home=='.': home=os.getcwd()
    home=os.path.split(home)[0]
    return home

def main(me):
    home=setup(me)

    import compilezpy
    import build_extensions
    user=group=''
    import default_content; default_content.main(home, user, group)
    
    print '-'*78
    print
    print 'Done! Use "make install" to set up your instance home.'

if __name__=='__main__': main(sys.argv[0])

--- Added File make_instance.py in package Zope2 ---
##############################################################################
# 
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
# 
# Copyright (c) Digital Creations.  All rights reserved.
# 
# This license has been certified as Open Source(tm).
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions in source code must retain the above copyright
#    notice, this list of conditions, and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions, and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 
# 3. Digital Creations requests that attribution be given to Zope
#    in any manner possible. Zope includes a "Powered by Zope"
#    button that is installed by default. While it is not a license
#    violation to remove this button, it is requested that the
#    attribution remain. A significant investment has been put
#    into Zope, and this effort will continue if the Zope community
#    continues to grow. This is one way to assure that growth.
# 
# 4. All advertising materials and documentation mentioning
#    features derived from or use of this software must display
#    the following acknowledgement:
# 
#      "This product includes software developed by Digital Creations
#      for use in the Z Object Publishing Environment
#      (http://www.zope.org/)."
# 
#    In the event that the product being advertised includes an
#    intact Zope distribution (with copyright and license included)
#    then this clause is waived.
# 
# 5. Names associated with Zope or Digital Creations must not be used to
#    endorse or promote products derived from this software without
#    prior written permission from Digital Creations.
# 
# 6. Modified redistributions of any form whatsoever must retain
#    the following acknowledgment:
# 
#      "This product includes software developed by Digital Creations
#      for use in the Z Object Publishing Environment
#      (http://www.zope.org/)."
# 
#    Intact (re-)distributions of any official Zope release do not
#    require an external acknowledgement.
# 
# 7. Modifications are encouraged but must be packaged separately as
#    patches to official Zope releases.  Distributions that do not
#    clearly separate the patches from the original work must be clearly
#    labeled as unofficial distributions.  Modifications which do not
#    carry the name Zope may be packaged in any form, as long as they
#    conform to all of the clauses above.
# 
# 
# Disclaimer
# 
#   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
#   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# 
# 
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations.  Specific
# attributions are listed in the accompanying credits file.
# 
##############################################################################
"""Make an INSTANCE_HOME."""

import sys, os, string

def setup(me):
    home=os.path.abspath(os.path.split(me)[0])
    return os.path.split(home)[0]

def main(me):
    home=setup(me)

    print 'The instance home is the directory from which you will run Zope.'
    print 'Several instance homes, each with their own data and'
    print 'configuration, can share one copy of Zope.'
    while 1:
        print
        ih = raw_input('Instance home [%s]: ' % home)
        if ih == '': ih = home
        else: ih = os.path.abspath(ih)
        if not os.path.exists(ih):
            print '"%s" does not exist.' % ih
            make_ih = raw_input('Shall I create it [y]? ')
            if make_ih and make_ih[0] not in 'yY': continue
            try:
                os.mkdir(ih, 0775)
                break
            except:
                print 'Unable to create "%s"' % ih
            continue
        elif not os.path.isdir(ih):
            print '"%s" is not a directory.' % ih
            continue
        break

    for dirname in ('Extensions', 'import', 'Products', 'var'):
        mode = (dirname == 'var') and 0711 or 0775
        dirname = os.path.join(ih, dirname)
        if not os.path.isdir(dirname):
            os.mkdir(dirname, mode)
    
    db_path = os.path.join(ih, 'var', 'Data.fs')
    dd_path = os.path.join(home, 'var', 'Data.fs.in')
    if not os.path.exists(db_path) and os.path.exists(dd_path):
        print '-'*78
        print 'Creating default database'
        open(db_path,'wb').write(open(dd_path,'rb').read())

    zctl = os.path.join(home, 'inst', 'zctl.py.in')
    zctl_txt = open(zctl).read() % (sys.executable, home)
    zctl = os.path.join(ih, 'zctl.py')
    open(zctl, 'w').write(zctl_txt)
    os.chmod(zctl, 0700)

    print '-'*78
    print
    print 'Done!'
    sys.path.insert(0, home)
    import zpasswd; zpasswd.choose_inituser(ih, '', '')

if __name__=='__main__': main(sys.argv[0])

--- Added File zctl.py.in in package Zope2 ---
#!%s
# -*- python -*-

# ZOPE_HOME is the directory containing the Zope software.
# You must set this, so we can load the zctl library.
ZOPE_HOME = '%s'

# These two lines load the zctl library, and should be left alone:
import os
execfile(os.path.join(ZOPE_HOME, 'utilities', 'zctl_lib.py'))

# The following names are now available for use in your configuration code:
#
# modules: sys, os, socket, time, string
# functions: isfile, isdir, abspath
# HERE = the directory this file is in, also known as the INSTANCE_HOME
#
# Everything below, except the last line, is your configuration code.

# ZOPE[OPTS] may be used to provide additional z2.py command-line arguments.
#ZOPE[OPTS] = '-X -w 8080'

# ZOPE[PORT] may be used to specify the z2.py "-P" base services port
#ZOPE[PORT] = 8000

# ZOPE[LOG] may be used to specify a STUPID_LOG file
#ZOPE[LOG] = HERE + '/var/debug.log'

# ZOPE_ENV may be used to provide additional environment variables to Zope
#ZOPE_ENV['TMPDIR'] = '/tmp'


# ZEO

# If ZEO is installed, then ZEO[SOCKET] is required.
#ZEO[SOCKET] = '10.0.0.1:2221'

# ZEO[WAIT] may be used to specify how many seconds to wait for ZEO
# to start before giving up. (default: 60)
#ZEO[WAIT] = 60

# If ZEO[CONTROL] is the filename of a script that can start and
# stop ZEO, then you can use 'start_zeo' and 'stop_zeo', and
# automatically start ZEO when your client starts.
#ZEO[CONTROL] = HERE + '/zeo_ctl.py'

# ZEO[OPTS] may be used to provide additional arguments to the ZEO_CTL
# script.
#ZEO[OPTS] = ''

main() # This should be the last line of the file.

--- Updated File build_pcgi.py in package Zope2 --
--- build_pcgi.py	1999/07/22 20:01:09	1.1
+++ build_pcgi.py	2001/04/19 19:46:19	1.1.158.1
@@ -96,3 +96,6 @@
 do('./configure')
 do('make')
 os.chdir('..')
+print '-'*78
+print
+print 'Done! After installing your instance home, use "./zctl.py make_cgi".'