-%include /usr/lib/rpm/macros.python
# TODO:
# - check why initgroups() crashes on AMD64 and something, better than
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.7.1
-%define sub_ver b1
-Release: 0.%{sub_ver}.1
+Version: 2.7.3
+# %%define sub_ver b2
+Release: 1
License: Zope Public License (ZPL)
Group: Networking/Daemons
-Source0: http://www.zope.org/Products/%{name}/%{version}%{sub_ver}/%{name}-%{version}-%{sub_ver}.tgz
-# Source0-md5: eb00f3f31fa382471e65ec4e76f61bd3
+Source0: http://www.zope.org/Products/%{name}/%{version}/%{name}-%{version}-0.tgz
+# Source0-md5: 15001ab6d429dc80b1f49735e8d2ee10
Source1: %{name}.init
Source2: %{name}.sysconfig
Source3: %{name}.logrotate
Patch1: %{name}-instance_paths.patch
Patch2: %{name}-pld_makefile_fix.patch
Patch3: %{name}-no_initgroups.patch
+Patch4: %{name}-xhtml_unicode_fix.patch
URL: http://www.zope.org/
-BuildRequires: python-devel >= 2.3.3
+BuildRequires: python-devel >= 1:2.3.3
BuildRequires: perl-base
+BuildRequires: rpmbuild(macros) >= 1.159
PreReq: rc-scripts
-Requires(pre): /usr/bin/getgid
Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
-Requires(postun): /usr/sbin/userdel
Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
Requires(post,preun): /sbin/chkconfig
Requires: logrotate
Requires: python >= 2.3.3
Requires: python-libs >= 2.3.3
Requires: expat >= 1.95.7
Requires: python-PyXML >= 0.8.3
-%pyrequires_eq python
+%pyrequires_eq python
+Provides: group(zope)
+Provides: user(zope)
+Obsoletes: Zope-Hotfix = 040713
+Obsoletes: Zope-Hotfix = 040714
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define zope_dir /usr/lib/zope
%prep
-%setup -q -n %{name}-%{version}-%{sub_ver}
+%setup -q -n %{name}-%{version}-0
%patch0 -p1
%patch1 -p1
%patch2 -p1
%ifarch amd64 alpha
%patch3 -p1
%endif
+%patch4 -p1
%build
perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -z "`getgid zope`" ]; then
- echo "Making group zope"
- /usr/sbin/groupadd -r -f zope
+if [ -n "`/usr/bin/getgid zope`" ]; then
+ if [ "`/usr/bin/getgid zope`" != "112" ]; then
+ echo "Error: group zope doesn't have gid=112. Correct this before installing zope." 1>&2
+ exit 1
+ fi
+else
+ echo "Making group zope"
+ /usr/sbin/groupadd -g 112 zope
fi
-if [ -z "`id -u zope 2>/dev/null`" ]; then
- echo "Making user zope"
- /usr/sbin/useradd -r -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
+if [ -n "`/bin/id -u zope 2>/dev/null`" ]; then
+ if [ "`/bin/id -u zope`" != "112" ]; then
+ echo "Error: user zope doesn't have uid=112. Correct this before installing zope." 1>&2
+ exit 1
+ fi
+else
+ echo "Making user zope"
+ /usr/sbin/useradd -u 112 -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
fi
%post
if [ -f $dir/Data.fs ]; then
echo "Found the database in old location. Migrating..."
if [ -f /var/lock/subsys/zope ]; then
- /etc/rc.d/init.d/zope stop >&2
- was_stopped=1
+ /etc/rc.d/init.d/zope stop >&2
+ was_stopped=1
fi
umask 022
[ -d /var/lib/zope/main ] && cd $dir && mv -f Data* /var/lib/zope/main/var 2>/dev/null
if [ "x$was_stopped" = "x1" ]; then
- /etc/rc.d/init.d/zope start >&2
+ /etc/rc.d/init.d/zope start >&2
fi
echo "Migration completed (new db location is /var/lib/zope/main/var)"
break
done
if [ -f /var/lock/subsys/zope ]; then
if [ "x$was_stopped" != "x1" ]; then
- /etc/rc.d/init.d/zope restart >&2
+ /etc/rc.d/init.d/zope restart >&2
fi
else
echo "look at /etc/zope/main/zope.conf" >&2
%postun
if [ "$1" = "0" ] ; then
- echo "Removing user zope"
- /usr/sbin/userdel zope >/dev/null 2>&1 || :
- echo "Removing group zope"
- /usr/sbin/groupdel zope >/dev/null 2>&1 || :
+ %userremove zope
+ %groupremove zope
fi
%files
%attr(640,root,root) %dir /etc/zope/skel
%attr(640,root,root) %dir /etc/zope/main
%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/zope/skel/*
-%attr(640,root,root) /etc/logrotate.d/zope
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/zope
%attr(640,root,root) /etc/sysconfig/zope
%ghost /var/log/zope/main/event.log
%ghost /var/log/zope/main/Z2.log