Hi all,

I am working towards a unified Zope configuration and installation
system on a branch of Zope named the 'chrism-install-branch'.

I have given the buildout process on that branch the ability to create
an RPM distribution of Zope.  I intend later to give the buildout
process the ability to create Debian .debs as well and maybe Solaris
packages...  I am doing this with the expectation that we might be able
to provide RPM and .deb distros of Zope from zope.org instead of our
current "generic Linux as tarball" distro.  I haven't looked yet at the
Debian packaging of Zope (by Gregor Hoffleit), but I intend to do that
next to get some more ideas.

I know there are already at least two flavors of Zope RPMs which Jeff
Rush helped to package.  There are a number of differences between the
packaging of the RPMs generated by my branch and the packaging of Jeff's

- One of Jeff's distros breaks Zope up into many different packages,
  while another installs it as one or two.  Mine only has one
  distribution flavor: a single package. 

- Jeff's puts some stuff into the current prevailing python's
  site-packages directory and some other stuff into /usr/share/zope.
  Mine puts nothing into site-packages, and installs all Zope software
  into /opt/zope.

- Jeff's creates an INSTANCE_HOME in /var/zope.  Mine creates an
  INSTANCE_HOME in /var/opt/zope.  I don't know if this is the right
  thing but in reading the Linux FHS, it advises to not create
  subdirectories of var directly... so I don't.

- Jeff's puts pid files into /var/run, while mine creates pid files
  directly in INSTANCE_HOME/var.

- Jeff's puts log files into /var/log while mine puts them into

I am wondering if:

- anybody has opinions on the packaging layout.  Why is it advantageous
  to have many packages rather than one?

- anybody has any opinions of where Zope files distributed via RPMs and
  debs should really go, especially wrt to the Linux FHS.  I'm not sure
  there is a right answer, but I don't know beans about this, so I 
  figure I'll ask.  A file named 'Zope.spec.in' is attached to this 
  email which is the input file to create a Zope RPM spec file during 
  the make process, to give a better idea of how this works.


- C

%define id $Id$
%define name Zope
%define majorversion <<ZOPE_MAJOR_VERSION>>
%define minorversion <<ZOPE_MINOR_VERSION>>
%define release <<VERSION_RELEASE_TAG>>
%define version %{majorversion}.%{minorversion}
%define package_name %{name}-%{version}-%{release}
%define buildroot %{_tmppath}/%{package_name}-buildroot
%define target_dir /opt/%{name}-%{majorversion}
%define inst_target_dir /var/opt/zope
%define python /usr/bin/python2.2
%define zopeuser zope

Summary: Zope, the open source web application server
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{package_name}.tar.gz
License: Zope Public License (ZPL)
Group: Applications/Internet
BuildRoot: %{buildroot}
Prefix: %{_prefix}
Vendor: Zope Corporation and Contributors <[EMAIL PROTECTED]>
Url: http://www.zope.org
# python2.2 packages from RedHat don't have 'compiler' package, but
# 2.2.1 packages do, so we require 2.2.1
Requires: python2 >= 2.2.1, /usr/sbin/useradd
# we don't require 2.2.1 for building, mainly because I don't
# actually have it. ;-)
BuildRequires: python2 >= 2.2, python2-devel > 2.2

Zope is an application server framework that enables developers to quickly
build web applications such as intranets, portals, and content management

rm -rf $RPM_BUILD_DIR/%{package_name}
tar xvzf $RPM_SOURCE_DIR/%{package_name}.tar.gz

cd %{package_name}
./configure --prefix="%{buildroot}%{target_dir}" --optimize \
make build

cd %{package_name}
make install
# XXX - need to figure out a way to byte-compile after install instead
# of during install
find %{buildroot}%{target_dir} | sed -e 's@^%{buildroot}@@' > INSTALLED_FILES

/usr/sbin/useradd -M -r -s /bin/bash -d /var/opt/zope -c "Zope server user"\
   %{zopeuser} > /dev/null 2>&1
mkdir -p %{inst_target_dir}
chown %{zopeuser}.%{zopeuser} %{inst_target_dir}
chmod 755 %{inst_target_dir}
# blank inituser below causes an inituser file to not be written
su - %{zopeuser} -c \
  "%{python} %{target_dir}/inst/make_instance.py --insthome=%{inst_target_dir} 
--zopehome=%{target_dir} --inituser= > /dev/null 2>&1"

echo Note that the Zope instance files in "%{inst_target_dir}" were not \
uninstalled, nor was the '%{zopeuser}' user removed from the system.

rm -rf %{buildroot}

%files -f %{package_name}/INSTALLED_FILES

* Fri Oct 11 2002 chrism <[EMAIL PROTECTED]>
- Initial release

Reply via email to