- added patch on HTTP Accelerated Cache Manager for proper virtual hosts caching
- preparing for python 2.3
- version: 2.6.2b5
Changed files:
Zope-http-virtual-cache.patch -> 1.1
Zope-start.sh -> 1.1
Zope-zserver.sh -> 1.3
Zope.init -> 1.7
Zope.logrotate -> 1.2
Zope.spec -> 1.28
--- /dev/null
+--- lib/python/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py 2002-08-14 18:25:12.000000000 -0400
++++ lib/python/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py 2003-02-27 16:26:02.000000000 -0500
+@@ -45,7 +45,7 @@
+ phys_path = ob.getPhysicalPath()
+ if self.hit_counts.has_key(phys_path):
+ del self.hit_counts[phys_path]
+- ob_path = quote('/'.join(phys_path))
++ ob_path = '/'+ob.absolute_url(relative=1)
+ results = []
+ for url in self.notify_urls:
+ if not url:
+@@ -57,6 +57,8 @@
+ u = 'http://' + url
+ (scheme, host, path, params, query, fragment
+ ) = urlparse.urlparse(u)
++ if path[:8].lower() == '/http://':
++ path = path[1:]
+ if path[-1:] == '/':
+ p = path[:-1] + ob_path
+ else:
+@@ -67,6 +69,12 @@
+ errcode, errmsg, headers = h.getreply()
+ h.getfile().read() # Mandatory for httplib?
+ results.append('%s %s' % (errcode, errmsg))
++ if p[-11:]=='/index_html':
++ h.putrequest('PURGE',p[:-10])
++ h.endheaders()
++ errcode, errmsg, headers = h.getreply()
++ h.getfile().read() # Mandatory for httplib?
++ results.append('%s %s' % (errcode, errmsg))
+ return 'Server response(s): ' + ';'.join(results)
+
+ def ZCache_get(self, ob, view_name, keywords, mtime_func, default):
--- /dev/null
+#! /bin/sh
+
+# This is Zope ZServer startscript for PLD Linux
+#
+
+ZOPE_BASE=/usr/lib/zope
+CLIENT_HOME=$INSTANCE_HOME/var
+
+# prepare directories
+
+if [ "x$ZOPE_USER" = "x" ]; then
+ ZOPE_USER="zope"
+fi
+
+ZOPE_GROUP=`id -ng $ZOPE_USER`
+
+if [ ! -d $INSTANCE_HOME ]; then
+ mkdir $INSTANCE_HOME
+fi
+
+chmod 1701 $INSTANCE_HOME
+chown root:$ZOPE_GROUP $INSTANCE_HOME
+
+if [ ! -d $INSTANCE_HOME/var ]; then
+ mkdir $INSTANCE_HOME/var
+fi
+
+chown root:$ZOPE_GROUP $INSTANCE_HOME/var
+chmod 1701 $INSTANCE_HOME/var
+
+if [ ! -d /var/log/zope ]; then
+ mkdir /var/log/zope
+ chmod o-rwx /var/log/zope
+ chown root:root /var/log/zope
+fi
+
+# prepare parameters
+
+if [ "$WATCHDOG" = "0" ]; then
+ manager=
+else
+ manager="-Z 1"
+fi
+
+if [ "x$CGIBIN_BASE" = "x" ]; then
+ p_string=" "
+else
+ p_string="-p $CGIBIN_FILE"
+fi
+
+if [ "x$DEBUG_MODE" = "xyes" -o "x$DEBUG_MODE" = "x1" ]; then
+ debugging="-D 1"
+else
+ debugging=
+fi
+
+if [ "x$LOG_FILE" = "x" -o "x$LOG_FILE" = "x0" ]; then
+ LOG_FILE=/var/log/zope/$INSTANCE_NAME.log
+fi
+
+if [ "x$DETAILED_LOG_FILE" = "x" -o "x$DETAILED_LOG_FILE" = "x0" ]; then
+ details=
+else
+ if [ "x$DETAILED_LOG_FILE" = "xyes" -o "x$DETAILED_LOG_FILE" = "x1" ]; then
+ details="-M /var/log/zope/$INSTANCE_NAME-detailed.log"
+ else
+ details="-M $DETAILED_LOG_FILE"
+ fi
+fi
+
+if [ "x$LOC" != "x" ]; then
+ locale="-L $LOC"
+else
+ locale=
+fi
+
+if [ "x$ICP_PORT" = "x" -o "x$ICP_PORT" = "x0" ]; then
+ icpstr=" "
+else
+ icpstr="--icp $ICP_PORT"
+fi
+
+if [ "x$IP_ADDRESS" = "x" -o "x$IP_ADDRESS" = "x0" ]; then
+ ipstr=" "
+else
+ ipstr="-a $IP_ADDRESS"
+fi
+
+# show what we're going to do
+
+if [ "x$debugging" != "x" ]; then
+cat <<EE | ( while read line; do echo "zope-start: $line"; done ) >>$LOG_FILE
+`date`
+Instance name: $INSTANCE_NAME
+Executing:
+exec python $ZOPE_BASE/z2.py
+ -z $INSTANCE_HOME
+ -t $NUMBER_OF_THREADS
+ -u $ZOPE_USER
+ -w $HTTP_PORT
+ -f $FTP_PORT
+ -l $LOG_FILE
+ $ipstr
+ $icpstr
+ $manager
+ $locale
+ $debugging
+ $p_string
+ $details
+>> $LOG_FILE 2>&1
+EE
+fi
+
+# call server
+
+exec python $ZOPE_BASE/z2.py \
+-z $INSTANCE_HOME \
+-t $NUMBER_OF_THREADS \
+-u $ZOPE_USER \
+-w $HTTP_PORT \
+-f $FTP_PORT \
+-l $LOG_FILE \
+$ipstr \
+$icpstr \
+$manager \
+$locale \
+$debugging \
+$p_string \
+$details \
+>> $LOG_FILE 2>&1 \
+&
+++ /dev/null
-#! /bin/sh
-
-PATH="/bin:/usr/bin:/usr/sbin:/sbin"
-
-# Zope root folder
-ZOPE_HOME=/usr/lib/zope
-
-# product instalation location
-INSTANCE_HOME=/var/lib/zope
-INST_HOME=${INSTANCE_HOME}
-
-# lacalization of pid and log files for ZOE
-CLIENT_HOME=/var/lib/zope
-
-export INST_HOME INSTANCE_HOME ZOPE_HOME PATH CLIENT_HOME
-
-# user to run Zope
-ZOPE_USER=zope
-
-# put !0 to create separate management process
-CREATE_MANAGEMENT=yes
-
-# initial NUMBER_OF_THREADS
-NUMBER_OF_THREADS=4
-
-# DEBUG_MODE
-DEBUG_MODE=0
-
-# ip address
-IP_ADDRESS=''
-
-# HTTP_PORT
-HTTP_PORT=18080
-
-# FTP_PORT
-FTP_PORT=18021
-
-# MONITOR_PORT... if equals '-' then monitor server is disabled
-MONITOR_PORT='-'
-
-# LOG_FILE
-LOG_FILE=/var/log/zope
-
-# DET_LOG_FILE... detailed log file
-DET_LOG_FILE=/var/log/zope.detailed
-
-# internationalization
-LOC='pl_PL'
-
-exec python $ZOPE_HOME/z2.py \
- -u $ZOPE_USER \
- -z $ZOPE_HOME \
- -w $HTTP_PORT \
- -f $FTP_PORT \
- -m $MONITOR_PORT \
- -L $LOC \
- -Z $CREATE_MANAGEMENT \
- -a $IP_ADDRESS \
- -t $NUMBER_OF_THREADS \
- -D $DEBUG_MODE \
- -M $DET_LOG_FILE \
- -l $LOG_FILE \
- >> $LOG_FILE 2>&1 \
- &
#!/bin/sh
+# zope
#
-# zope Start/Stop the Zope web-application server.
+# chkconfig: 345 90 10
+# description: Starts and stops the Zope instances
+# processname: z2.py
+# config: /etc/sysconfig/zope
#
-# chkconfig: 2345 72 72
-# description: zope is a web server specifically for handling \
-# HTTP requests to the Zope web-application service.
# probe: true
+#
+
# Source function library.
. /etc/rc.d/init.d/functions
# Check that networking is up.
if is_yes "${NETWORKING}"; then
- if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ if [ ! -f /var/lock/subsys/network ]; then
msg_network_down Zope
exit 1
fi
exit 0
fi
-CLIENT_HOME=/var/lib/zope
-PIDFILE=${CLIENT_HOME}/Z2.pid
+# Zope settings.
+. /etc/sysconfig/zope
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
- if [ ! -f /var/lock/subsys/zope ]; then
- msg_starting Zope
- daemon zope-zserver
- RETVAL=$?;
- sleep 5
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
- else
- msg_already_running Zope
+
+# functions
+
+unset_vars()
+{
+ unset INSTANCE_NAME INSTANCE_HOME INST_HOME CGIBIN_BASE LOG_FILE
+ unset ZOPE_BASE ZOPE_USER NUMBER_OF_THREADS ZOPE_HOME
+ unset IP_ADDRESS HTTP_PORT FTP_PORT WATCHDOG
+ unset IPC_PORT LOC DEBUG_MODE DETAILED_LOG_FILE
+}
+
+start_instance()
+{
+ msg_starting "$z_name"
+
+ INST_HOME="$INSTANCE_HOME"
+ ZOPE_HOME="$INSTANCE_HOME"
+
+ export INSTANCE_NAME INSTANCE_HOME INST_HOME CGIBIN_BASE LOG_FILE
+ export ZOPE_BASE ZOPE_USER NUMBER_OF_THREADS ZOPE_HOME
+ export IP_ADDRESS HTTP_PORT FTP_PORT WATCHDOG
+ export IPC_PORT LOC DEBUG_MODE DETAILED_LOG_FILE
+
+ daemon zope-start
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
+ sleep 5
+}
+
+start_instances()
+{
+ for i in /etc/zope/instances/*
+ do
+ unset_vars
+ . $i
+ PIDFILE=$INSTANCE_HOME/var/Z2.pid
+ INSTANCE_NAME=`basename $i`
+ if [ "x$INSTANCE_NAME" = "xmain" ]; then
+ z_name="Zope"
+ else
+ z_name="Zope ($INSTANCE_NAME)"
fi
- ;;
- stop)
- if [ -f /var/lock/subsys/zope ]; then
- msg_stopping Zope
- busy
- kill `cat ${CLIENT_HOME}/Z2.pid`
+ if [ -f $PIDFILE ]; then
+ if ps -p `cat $PIDFILE` >/dev/null; then
+ RETVAL=$?
+ msg_already_running "$z_name"
+ continue
+ else
+ rm -f $PIDFILE
+ fi
+ fi
+ start_instance
+ done
+}
+
+stop_instances()
+{
+ for i in /etc/zope/instances/*
+ do
+ unset_vars
+ . $i
+ PIDFILE=$INSTANCE_HOME/var/Z2.pid
+ INSTANCE_NAME=`basename $i`
+ if [ "x$INSTANCE_NAME" = "xmain" ]; then
+ z_name="Zope"
+ else
+ z_name="Zope ($INSTANCE_NAME)"
+ fi
+
+ if [ -f $PIDFILE ]; then
+ msg_stopping "$z_name"
+ busy
+ kill `cat $PIDFILE` 2>/dev/null
+ RET=$?
+ sleep 1
+ if [ $RET -eq 0 ]; then
+ ok
+ else
+ sleep 5
+ kill -9 `cat $PIDFILE` 2>/dev/null
RET=$?
- sleep 1
[ $RET -eq 0 ] && ok || died
- rm -f /var/lock/subsys/zope ${CLIENT_HOME}/Z2.pid >/dev/null 2>&1
+ fi
+ rm -f $PIDFILE
else
- msg_not_running Zope
+ msg_not_running "$z_name"
+ fi
+ done
+}
+
+stat_instances()
+{
+ for i in /etc/zope/instances/*
+ do
+ unset_vars
+ . $i
+ PIDFILE=$INSTANCE_HOME/var/Z2.pid
+ INSTANCE_NAME=`basename $i`
+ if [ "x$INSTANCE_NAME" = "xmain" ]; then
+ z_name="Zope"
+ else
+ z_name="Zope ($INSTANCE_NAME)"
fi
- ;;
- status)
if [ -f $PIDFILE ]; then
- if ps -p `cat $PIDFILE` >/dev/null; then
- RETVAL=$?
- nls "%s (pid %s) is running..." Zope "`cat $PIDFILE`"
- else
- nls "%s dead but pid file exists" Zope
- RETVAL=1
- fi
+ if ps -p `cat $PIDFILE` >/dev/null; then
+ RETVAL=$?
+ nls "%s (pid %s) is running..." "$z_name" "`cat $PIDFILE`"
+ else
+ nls "%s dead but pid file exists" "$z_name"
+ RETVAL=1
+ fi
else
- if [ -f /var/lock/subsys/zope ]; then
- nls "%s dead but subsys locked" Zope
- RETVAL=2
- else
- nls "%s is stopped" Zope
- RETVAL=3
- fi
+ nls "%s is stopped" "$z_name"
+ RETVAL=2
fi
+ done
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start_instances
+ ;;
+ stop)
+ stop_instances
+ ;;
+ status)
+ stat_instances
;;
restart|force-reload)
$0 stop
-/var/log/zope {
+/var/log/zope/main.log {
+ postrotate
+ /etc/rc.d/init.d/zope reload >/dev/null 2>&1
+ endscript
+}
+
+/var/log/zope/main-detailed.log {
postrotate
/etc/rc.d/init.d/zope reload >/dev/null 2>&1
endscript
Summary(pl): Serwer aplikacji i toolkit portalowy do tworzenia serwisów WWW
Summary(pt_BR): Um servidor de aplicações e um conjunto de ferramentas para construção de sites Web
Name: Zope
-Version: 2.6.1
+Version: 2.6.2b5
Release: 1
License: Zope Public License (ZPL)
Group: Networking/Daemons
# Source0-md5: a17f36b86b6e489797d8e52f1ba48efe
Source1: %{name}.init
Source2: %{name}.logrotate
-Source3: %{name}-zserver.sh
-Source4: http://www.zope.org/Documentation/Guides/ZCMG/ZCMG.html.tgz
-# Source4-md5: 4c52eebc2e874a0590ac9c04e222e9f1
-Source5: http://www.zope.org/Documentation/Guides/DTML/DTML.html.tgz
-# Source5-md5: 10f363dd061a1af8d472c51c32fa0a0e
-Source6: http://www.zope.org/Documentation/Guides/ZSQL/ZSQL.html.tgz
-# Source6-md5: 0cddb5688fc0f886db468da08251fb81
+Source3: %{name}.sysconfig
+Source4: %{name}-start.sh
+Source5: http://www.zope.org/Documentation/Guides/ZCMG/ZCMG.html.tgz
+# Source5-md5: 4c52eebc2e874a0590ac9c04e222e9f1
+Source6: http://www.zope.org/Documentation/Guides/DTML/DTML.html.tgz
+# Source6-md5: 10f363dd061a1af8d472c51c32fa0a0e
+Source7: http://www.zope.org/Documentation/Guides/ZSQL/ZSQL.html.tgz
+# Source7-md5: 0cddb5688fc0f886db468da08251fb81
Source8: http://www.zope.org/Documentation/Guides/ZDG/ZDG.html.tgz
# Source8-md5: 0344ca88acb8a71688d2925975a55443
Source9: http://www.zope.org/Documentation/Guides/ZAG/ZAG.html.tgz
# Source9-md5: b28bfc4ba4bee880767fcf89d79532d2
Source10: http://www.zope.org/Documentation/Books/ZopeBook/current/ZopeBook.tgz
# Source10-md5: 268c38a4c7d9f7334cdc98b0a152f8da
+Patch0: %{name}-http-virtual-cache.patch
URL: http://www.zope.org/
-BuildRequires: python-devel >= 2.2
+BuildRequires: python-devel >= 2.3
BuildRequires: perl
PreReq: rc-scripts
Requires(pre): /usr/bin/getgid
Requires(postun): /usr/sbin/groupdel
Requires(post,preun): /sbin/chkconfig
Requires: logrotate
-Requires: python >= 2.2
-Requires: python-modules >= 2.2
-Requires: python-libs >= 2.2
+Requires: python >= 2.3
+Requires: python-modules >= 2.3
+Requires: python-libs >= 2.3
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define python_prefix %(echo `python -c "import sys; print sys.prefix"`)
eles ao invés desse RPM.
%prep
-%setup -q -n %{name}-%{version}-src -a4
-mkdir ZopeContentManagersGuide GuideToDTML GuideToZSQL ZopeDevelopersGuide ZopeAdminGuide
-mkdir ZopeBook
-tar xzf %{SOURCE4} -C ZopeContentManagersGuide
-tar xzf %{SOURCE5} -C GuideToDTML
-tar xzf %{SOURCE6} -C GuideToZSQL
-tar xzf %{SOURCE8} -C ZopeAdminGuide
-tar xzf %{SOURCE9} -C ZopeBook
+%setup -q -n %{name}-%{version}-src -a5
+%patch0 -p1
+mkdir ZopeContentManagersGuide GuideToDTML GuideToZSQL ZopeDevelopersGuide
+mkdir ZopeAdminGuide ZopeBook
+tar xzf %{SOURCE5} -C ZopeContentManagersGuide
+tar xzf %{SOURCE6} -C GuideToDTML
+tar xzf %{SOURCE7} -C GuideToZSQL
+tar xzf %{SOURCE8} -C ZopeDevelopersGuide
+tar xzf %{SOURCE9} -C ZopeAdminGuide
+tar xzf %{SOURCE10} -C ZopeBook
%build
perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/zope} \
- $RPM_BUILD_ROOT{/etc/{rc.d/init.d,logrotate.d},/var/log,/var/lib/zope}
+ $RPM_BUILD_ROOT{/etc/{rc.d/init.d,logrotate.d,sysconfig}} \
+ $RPM_BUILD_ROOT{/var/log/zope,/var/lib/zope/main}
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/zope
-install %{SOURCE3} $RPM_BUILD_ROOT%{_sbindir}/zope-zserver
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/zope
+install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/zope-start
cp -a lib/python/* $RPM_BUILD_ROOT%{_libdir}/zope
cp -a ZServer/ utilities/ import/ $RPM_BUILD_ROOT%{_libdir}/zope
install zpasswd.py $RPM_BUILD_ROOT%{_bindir}/zpasswd
install z2.py $RPM_BUILD_ROOT%{_libdir}/zope
-install var/Data.fs $RPM_BUILD_ROOT/var/lib/zope/Data.fs
+install var/Data.fs $RPM_BUILD_ROOT/var/lib/zope/main/Data.fs
python $RPM_BUILD_ROOT%{_bindir}/zpasswd -u zope -p zope -d localhost \
- $RPM_BUILD_ROOT/var/lib/zope/access
+ $RPM_BUILD_ROOT/var/lib/zope/main/access
-touch $RPM_BUILD_ROOT/var/log/zope
+touch $RPM_BUILD_ROOT/var/log/zope/main.log
+touch $RPM_BUILD_ROOT/var/log/zope/main-detailed.log
%clean
rm -rf $RPM_BUILD_ROOT
fi
if [ -z "`id -u zope 2>/dev/null`" ]; then
echo "Making user zope"
- /usr/sbin/useradd -r -d /var/lib/zope -s /bin/false -c "Zope User" -g zope zope
+ /usr/sbin/useradd -r -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
fi
%post
if [ -f /var/lock/subsys/zope ]; then
/etc/rc.d/init.d/zope restart >&2
else
- echo "Create inituser using \"zpasswd inituser\" in directory \"/var/lib/zope\"" >&2
+ echo "Create inituser using \"zpasswd inituser\" in directory \"/var/lib/zope/main\"" >&2
echo "Run then \"/etc/rc.d/init.d/zope start\" to start Zope." >&2
fi
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%{_libdir}/zope
-%attr(1771,root,zope) %dir /var/lib/zope
-%attr(660,root,zope) %config(noreplace) %verify(not md5 size mtime) /var/lib/zope/*
+%attr(640,root,root) %dir /var/lib/zope
+%attr(1771,root,zope) %dir /var/lib/zope/main
+%attr(660,root,zope) %config(noreplace) %verify(not md5 size mtime) /var/lib/zope/main/*
%attr(640,root,root) /etc/logrotate.d/zope
-%ghost /var/log/zope
+%attr(640,root,root) /etc/sysconfig/zope
+%ghost /var/log/zope/main.log
+%ghost /var/log/zope/main-detailed.log