[Zope-Checkins] CVS: Zope/inst - Zope.spec.in:1.2 Makefile.in:1.11

Chris McDonough chrism@zope.com
Fri, 13 Jun 2003 15:30:39 -0400


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

Modified Files:
	Makefile.in 
Added Files:
	Zope.spec.in 
Log Message:
Add Zope RPM spec file for reference.

Add an sdist target to the Makefile which builds a tarball source
distribution.


=== Zope/inst/Zope.spec.in 1.1 => 1.2 ===
--- /dev/null	Fri Jun 13 15:30:39 2003
+++ Zope/inst/Zope.spec.in	Fri Jun 13 15:30:38 2003
@@ -0,0 +1,82 @@
+%define fileid $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 <zope@zope.org>
+Url: http://www.zope.org
+
+Requires: python2 >= 2.2.2, /usr/sbin/useradd
+BuildRequires: python2 >= 2.2.2
+
+%description
+Zope is an application server framework that enables developers to quickly
+build web applications such as intranets, portals, and content management
+systems.
+
+%prep
+rm -rf $RPM_BUILD_DIR/%{package_name}
+tar xvzf $RPM_SOURCE_DIR/%{package_name}.tar.gz
+
+%build
+cd %{package_name}
+./configure --prefix="%{buildroot}%{target_dir}" --optimize \
+   --with-python=/usr/bin/python2.2
+make build
+
+%install
+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
+
+%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/mkzopeinstance --user= %{inst_target_dir} > /dev/null 2>&1"
+
+# inform the user he will need to write an inituser file
+echo Note that before being able to log in to Zope via a web browser, you\'ll
+echo need to define a Zope \"initial user\" by running:
+echo
+echo     cd %{inst_target_dir}
+echo     %{inst_target_dir}/bin/zopectl write_inituser <username> <password>
+
+%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}
+
+%files -f %{package_name}/INSTALLED_FILES
+%defattr(-,root,root)
+
+%changelog
+* Fri Oct 11 2002 chrism <chrism@james.zope.com>
+- Initial release
+


=== Zope/inst/Makefile.in 1.10 => 1.11 ===
--- Zope/inst/Makefile.in:1.10	Fri Jun 13 02:32:07 2003
+++ Zope/inst/Makefile.in	Fri Jun 13 15:30:38 2003
@@ -10,6 +10,7 @@
 PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
 
 PYTHON="<<PYTHON>>"
+TMPDIR=/tmp
 PREFIX=<<PREFIX>>
 BASE_DIR=<<BASE_DIR>>
 BUILD_BASE=<<BUILD_BASE>>
@@ -26,8 +27,10 @@
 FIND=find
 XARGS=xargs
 CD=cd
-LN=ln -sf
+LN=ln -sfn
 CP=cp
+TAR=tar
+MKDIR=mkdir -p
 
 .PHONY : clean install uninstall instance untestinst testinst build unbuild
 .PHONY : default
@@ -103,6 +106,21 @@
 clean: unbuild
 	${FIND} "${BASE_DIR}" \
          -name '*.py[co]' -o -name '*.so' -o -name '*.o' | ${XARGS} ${RM}
+
+# sdist:       Create a source distribution file (implies clobber).
+#
+sdist: clobber sdist_tgz
+
+# sdist_tgz:   Create a tgz archive file as a source distribution.
+#
+sdist_tgz:
+	${MKDIR} ${TMPDIR}
+	${CD} ${TMPDIR} && ${LN} ${BASE_DIR} ${PACKAGE_NAME} && \
+          ${TAR} czfh ${BASE_DIR}/${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME} \
+           --exclude=${PACKAGE_NAME}.tar.gz\
+           --exclude=CVS --exclude=.cvsignore \
+           --exclude=makefile
+	${RMRF} ${TMPDIR}/${PACKAGE_NAME}
 
 # clobber:     Make the source tree 'pristine' again.
 clobber: clean uninstance