Commit 058d236c authored by Chris McDonough's avatar Chris McDonough

Remove RPM spec file in favor of creating a ZC repository on an internal...

Remove RPM spec file in favor of creating a ZC repository on an internal server with the necessary spec and data files for building RPMs.  The spec file will be available within a srpm if needed.
parent 3a0c451b
%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 packagename %{name}-%{version}-%{release}
%define buildroot %{_tmppath}/%{packagename}-root
%define targetdir /opt/%{name}-%{majorversion}
%define instancedir /var/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: %{packagename}.tgz
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
# The autorequire script sticks "/usr/local/bin/python"
# into the required list due to script shebangs in Zope. Turn off auto
# requires/provides for this reason and roll our own Requires/Provides lists
AutoReqProv: no
Requires: python2 >= 2.2.3, /usr/sbin/useradd, ld-linux.so.2, libc.so.6, /bin/sh, /usr/bin/env, /sbin/chkconfig
Provides: Acquisition.so, BTree.so, cAccessControl.so, cDocumentTemplate.so, ComputedAttribute.so, coptimizations.so, cPersistence.so, cPickleCache.so, dcpyexpat.so, ExtensionClass.so, _fsBTree.so, _helper.so, _IIBTree.so, IIBTree.so, initgroups.so, intSet.so, _IOBTree.so, IOBTree.so, ISO_8859_1_Splitter.so, MethodObject.so, Missing.so, MultiMapping.so, _OIBTree.so, OIBTree.so, okascore.so, _OOBTree.so, Record.so, Splitter.so, stopper.so, ThreadLock.so, TimeStamp.so, UnicodeSplitter.so, winlock.so, ZopeSplitter.so
BuildRequires: python2 >= 2.2.3
%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/%{packagename}
tar xvzf $RPM_SOURCE_DIR/%{packagename}.tgz
%build
cd %{packagename}
mkdir build
cd build
../configure \
--with-python=%{python} \
--prefix="%{buildroot}%{targetdir}" \
--no-compile
make build
%install
cd %{packagename}/build
make install
%post
# byte-compile installed Python files
pushd "%{targetdir}" > /dev/null 2>&1
%{python} "%{targetdir}/lib/python/Zope/Startup/compilezpy.py" > /dev/null 2>&1
popd > /dev/null 2>&1
# add a Zope user if one doesn't already exist
user=`cut -f1 -d: /etc/passwd|grep "^%{zopeuser}$"`
if [ -z "$user" ]; then
/usr/sbin/useradd -M -r -s /sbin/nologin -d /var/zope -c \
"Zope service user" %{zopeuser}
fi
# make the instance directory and change its ownership/mode if it doesn't
# already exist
if [ ! -f "%{instancedir}" ]; then
mkdir -p %{instancedir}
chown %{zopeuser}.%{zopeuser} %{instancedir}
chmod 755 %{instancedir}
# 10 digit random default admin password
passwd=`head -c4 /dev/urandom | od -tu4 -N4 | sed -ne '1s/.* //p'`
su - %{zopeuser} -s /bin/sh -c \
"%{python} %{targetdir}/bin/mkzopeinstance.py --user=admin:$passwd \
--dir=%{instancedir}"
# inform the user of the default username/password combo
echo
echo A Zope instance has been installed in \"%{instancedir}\" with a
echo default administrative username/password combination. The
echo administrative username is \"admin\" and the password is \"$passwd\".
echo Please remember this so you are able to log in for the first time.
echo
else
echo
echo An instance home directory could not be created at \"%{instancedir}\"
echo because a directory or file by that name already existed. You will
echo need to create a new Zope instance manually by invoking the
echo \"mkzopeinstance.py\" script within "%{targetdir}/bin".
echo
fi
if [ ! -f "/etc/rc.d/init.d/zope" ]; then
cat >> /etc/rc.d/init.d/zope << EOF
#!/bin/sh
# RedHat startup script for a Zope instance using zopectl
# by Chris McDonough (chrism@zope.com)
#
# :AUTO_UNINSTALL_MARKER: (do not remove)
#
# chkconfig: 2345 80 20
# description: Zope, the web application server
# Source function library.
. /etc/rc.d/init.d/functions
instancedir="%{instancedir}"
zopectl="\$instancedir/bin/zopectl"
name="zope"
[ -f \$zopectl ] || exit 1
RETVAL=0
start() {
echo -n "Starting \$name: "
"\$zopectl" start
RETVAL=\$?
echo
return \$RETVAL
}
stop() {
echo -n "Stopping \$name: "
"\$zopectl" stop
RETVAL=\$?
echo
return \$RETVAL
}
case "\$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: \$0 {start|stop|restart}"
exit 1
esac
exit \$REVAL
EOF
chmod 755 /etc/rc.d/init.d/zope
/sbin/chkconfig --add zope
fi
%preun
if [ -f "/etc/rc.d/init.d/zope"]; then
/etc/rc.d/init.d/zope stop > /dev/null 2>&1
fi
find "%{targetdir}" -name "*.py[co]"|xargs rm -f
%postun
# uninstall the rc file if we installed it
installedrc=`grep ":AUTO_UNINSTALL_MARKER:" /etc/rc.d/init.d/zope` \
> /dev/null 2>&1
if [ ! -z "$installedrc" ]; then
/sbin/chkconfig --del zope
rm -f /etc/rc.d/init.d/zope
fi
echo
echo Note that the Zope instance files in \"%{instancedir}\" were not
echo uninstalled, nor was the \"%{zopeuser}\" user removed from the system.
echo
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%dir %{targetdir}
%{targetdir}/bin
%{targetdir}/doc
%{targetdir}/import
%{targetdir}/lib
%{targetdir}/skel
%{targetdir}/utilities
%changelog
* Tue Jul 22 2003 Chris McDonough <chrism@zope.com>
- Update for Zope 2.7b1+
- run ./configure from build subdirectory instead of in Zope source root
- (reluctantly) install an instance home with a default username/password
- byte-compile files in postinstall instead of during install
- explicitly name directories in "files" section rather than writing
a manifest from the build
- dont use auto Requires/Provides support
- install an rc script
* Fri Oct 11 2002 Chris McDonough <chrism@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