[Zope-Checkins] CVS: Zope/inst - Makefile.in:1.1.2.9 Zope.spec.in:1.1.2.3

Chris McDonough chrism@zope.com
Sat, 12 Oct 2002 16:29:05 -0400


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv22640/inst

Modified Files:
      Tag: chrism-install-branch
	Makefile.in Zope.spec.in 
Log Message:
RPM install now creates an instance_home (in /var/opt/zope).

Changes to initial user stuff based on requirements for RPM install.


=== Zope/inst/Makefile.in 1.1.2.8 => 1.1.2.9 ===
--- Zope/inst/Makefile.in:1.1.2.8	Sat Oct 12 03:47:37 2002
+++ Zope/inst/Makefile.in	Sat Oct 12 16:28:34 2002
@@ -83,6 +83,7 @@
 	${CD} "${SKEL_DIR}/inst" && \
            ${INSTALL_COPY} ../../file_from_infile.py file_from_infile.py && \
            ${INSTALL_COPY} ../../install.py install.py && \
+           ${INSTALL_COPY} ../../versions.py versions.py && \
            ${WRITE_INFILE} ../../in/make_instance.py.in make_instance.py
 
 install: build
@@ -98,7 +99,7 @@
 	"${PYTHON}" "${SKEL_DIR}/inst/make_instance.py" \
           --zopehome="${BUILD_DIR}"
 
-rpmbuild: clean
+rpmdist: clean
 	${RM} "${RPM_SRC_DIR}/${PACKAGE_NAME}"
 	${RM} "${RPM_SRC_DIR}/${PACKAGE_NAME}.spec"
 	${LN} "${BUILD_DIR}" "${RPM_SRC_DIR}/${PACKAGE_NAME}"
@@ -121,6 +122,7 @@
 	${RM} "${SKEL_DIR}/inst/make_instance.py"
 	${RM} "${SKEL_DIR}/inst/file_from_infile.py"
 	${RM} "${SKEL_DIR}/inst/install.py"
+	${RM} "${SKEL_DIR}/inst/versions.py"
 
 clean: rmlinks
 	${RM} "${BUILD_DIR}/build"


=== Zope/inst/Zope.spec.in 1.1.2.2 => 1.1.2.3 ===
--- Zope/inst/Zope.spec.in:1.1.2.2	Sat Oct 12 03:47:37 2002
+++ Zope/inst/Zope.spec.in	Sat Oct 12 16:28:34 2002
@@ -1,3 +1,4 @@
+%define id $Id$
 %define name Zope
 %define majorversion <<ZOPE_MAJOR_VERSION>>
 %define minorversion <<ZOPE_MINOR_VERSION>>
@@ -6,6 +7,9 @@
 %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}
@@ -20,7 +24,10 @@
 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
+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
 
 %description
 Zope is an application server framework that enables developers to quickly
@@ -43,6 +50,20 @@
 # 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
+
+%post
+/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"
+
+%postun
+echo Note that the Zope instance files in "%{inst_target_dir}" were not \
+uninstalled, nor was the '%{zopeuser}' user removed from the system.
 
 %clean
 rm -rf %{buildroot}