[Zope-dev] 2.7 installation

Adrian van den Dries zope-dev@zope.org
Wed, 18 Jun 2003 20:18:53 +1000


My company has a business need for better Debian packages of Zope (and
particularly, packages of ZEO).  I have outlined a proposal for an
installation regime that will greatly simplify installation in a UNIX
environment, with a configuration that Debian would use for
installation.

I bring it up here because my proposal probably requires some changes
to the source tree which may suit being accepted upstream, and because
we have a (sponsored) opportunity to hone Zope for a Debian
environment (a not uncommon and very high-quality distrubution).

I am, however, not yet familiar enough with the distutils to know if
this regime is possible, nor am I familiar with the Windows
installation.  Also, it pushes my relentless agenda to get the
standalone packages of Zope packaged as separate dependencies which
may, I sense, not suit everyone! ;-)

It is at http://homepages.flow.com.au/~avdd/zope-newinstall.html and
included here.

Comments?

Cc'ed current Debian maintainers for completeness.

===================================
Zope installation overhaul proposal
===================================

The Problem
+++++++++++

I have some concerns about the new installation mechanism,
particularly how it will work for a UNIX (specifically Debian)
install.

Currently, a configure script (written in Python) writes a makefile,
which installs software into the --prefix, as per custom::

  $ ./configure --prefix=$PREFIX
  $ make
  $ sudo make install

This installs the software under ``$PREFIX``, producing this layout::

  $PREFIX/
          bin/
          doc/
          import/
          lib/
          skel/
          utilities/

You then make an instance::

  $ /usr/lib/zope/bin/mkzopeinstance $INSTANCE

This creates a Zope instance in $INSTANCE, like so::

  $INSTANCE/
            Extensions/
            Products/
            bin/
            etc/
            import/
            log/
            var/

The problems with this procedure are:

  1. one --prefix is too limiting with this tree. You can't install
     into an existing hierarchy like /usr, because of the zope-specific
     directories "import", "skel" and "utilities".

  2. $INSTANCE/bin/* are just shell wrappers for their respective
     scripts in $PREFIX/bin, serving only to point to the correct
     configuration and software paths, also requiring you to supply a
     full path to the script.  This should instead be a global control
     script that takes an instance name as an argument:

     # zopectl -i default start

  3. This installs all of Zope, ZODB, ZEO and zdaemon.  I am
     uncomfortable with this blurring of function between applications
     (runzeo.py) and libraries (ZODB)

... probably more ... skip to solution:

The Solution
++++++++++++

For Zope
========

The make install step::

  EXECPREFIX=$PREFIX
  LIBPREFIX=$PREFIX
  SKELPREFIX=$PREFIX
  DOCPREFIX=$PREFIX

  BIN=$EXECPREFIX/bin
  LIB=$LIBPREFIX/lib # python, etc.
  DOC=$DOCPREFIX/doc
  SKEL=$SKELPREFIX/skel

With ``PREFIX=/zope``, you get::

  /zope/bin/
            zopectl.py
            runzope.py
            utils.py etc.
  
  /zope/doc/
            import/
                   Examples.zexp
            README.txt etc.

  /zope/lib/
           python, etc

  /zope/skel/
             Extensions/
             Products/
             etc/
             import/
             log/
             var/

Then the administrator (or initial installation) runs::

  # mkzopeinstance /var/lib/zope/default/var -l /var/log/zope/default

which copies ``$SKEL/*`` to ``/var/lib/zope/default``.

To start, stop, restart zope::

  # zopectl default (start|stop|status|restart|etc)

Other Z* packages
=================

Note that the above procedure installs only Zope.  It requires ZODB (a
standalone package) to be installed.

ZEO is a separate package.  It installs similarly to Zope, with
instances similarly created with ``$PREFIX/bin/mkzeoinstance``.

This may require some changes to the source tree.

The Debian package
==================
                        
Debian's package would use::

    PREFIX=/usr
    SKEL=$PREFIX/share/zope/skel
    DOC=$PREFIX/share/doc/zope

Producing this layout::

  /usr/bin/
            zopectl.py
            runzope.py
            utils.py etc.
  
  /usr/share/doc/zope/
                     import/
                     Examples.zexp
                     README.txt etc.

  /usr/lib/
           python, etc

  /usr/share/zope/skel/
                       Extensions/
                       Products/
                       etc/
                       import/
                       log/
                       var/


The Debian installation would create a default instance, possibly
prompting for the name (otherwise "default").  It would also create:

 - ``/etc/init.d/zope`` (starts the first instance, or all instances)
 - ``/etc/default/zope`` (lists instances)


Debian's ``mkzopeinstance`` would symlink ``/etc/zope/$INSTANCE`` to
``/var/lib/zope/$INSTANCE/etc`` (like postgresql), and it may provide
the ``-l`` option to override the log location

Debian packages ZEO and the ZODB similarly, and ZEO and Zope depend on
the ZODB.




a.

-- 
 Adrian van den Dries                           avdd@flow.com.au
 Development team                               www.dev.flow.com.au
 FLOW Communications Pty. Ltd.                  www.flow.com.au