Commit 5f5d3e79 authored by Chris McDonough's avatar Chris McDonough

Add Zope RPM spec file for reference.

Add an sdist target to the Makefile which builds a tarball source
distribution.
parent ca6eb784
......@@ -10,6 +10,7 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>>
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 @@ RMRF=rm -rf
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
......@@ -104,5 +107,20 @@ 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
%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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment