]> git.pld-linux.org Git - packages/Zope.git/blobdiff - Zope.spec
- use x8664 macro
[packages/Zope.git] / Zope.spec
index 009279361ad8ae35031e76eda1bf01afc04cc59a..0657aeb76dd6ab8c2b47a861e34968924614c3aa 100644 (file)
--- a/Zope.spec
+++ b/Zope.spec
@@ -1,6 +1,7 @@
-%include        /usr/lib/rpm/macros.python
 
 # TODO:
+# - check why initgroups() crashes on AMD64 and something, better than
+#   disabling initgroups() completely, with that
 # - no/more secure initial user/password settings (currently: zope/zope)
 # - ZEO support (mkzeoinstance is not tested and probably doesn't work)
 # - perl support?
@@ -10,13 +11,13 @@ Summary(es):        Un servidor de aplicaciones y un conjunto de herramientas para la c
 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.0
-%define                sub_ver b3
-Release:       3.%{sub_ver}.1
+Version:       2.7.6
+# %%define             sub_ver b2
+Release:       1
 License:       Zope Public License (ZPL)
 Group:         Networking/Daemons
-Source0:       http://www.zope.org/Products/%{name}/%{version}%{sub_ver}/%{version}%{sub_ver}/%{name}-%{version}-%{sub_ver}.tgz
-# Source0-md5: 49d981bb35c33fda6d53b438fb9c9ad7
+Source0:       http://www.zope.org/Products/Zope/%{version}/%{name}-%{version}-final.tgz
+# Source0-md5: f781d13a0cc917e517d4521270691394
 Source1:       %{name}.init
 Source2:       %{name}.sysconfig
 Source3:       %{name}.logrotate
@@ -27,24 +28,37 @@ Source7:    %{name}-zopectl
 Source8:       %{name}-installzopeproduct
 Patch0:                %{name}-default_config.patch
 Patch1:                %{name}-instance_paths.patch
+Patch2:                %{name}-pld_makefile_fix.patch
+Patch3:                %{name}-no_initgroups.patch
+Patch4:                %{name}-python24.patch
 URL:           http://www.zope.org/
-BuildRequires: python-devel >= 2.2.3
+BuildRequires: python-devel >= 1:2.3.3
 BuildRequires: perl-base
+BuildRequires: rpmbuild(macros) >= 1.213
 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:      expat >= 1.95.7
 Requires:      logrotate
-Requires:      python >= 2.2.3
-Requires:      python-modules >= 2.2.3
-Requires:      python-libs >= 2.2.3
-%pyrequires_eq  python
+Requires:      python >= 2.3.3
+Requires:      python-modules >= 2.3.3
+Requires:      python-libs >= 2.3.3
+Requires:      python-PyXML >= 0.8.3
+%pyrequires_eq python
+Provides:      group(zope)
+Provides:      user(zope)
+Obsoletes:     Zope-Hotfix = 040713
+Obsoletes:     Zope-Hotfix = 040714
+Obsoletes:     Zope-Hotfix = 050405
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                zope_dir /usr/lib/zope
+
 %description
 The Z Object Programming Environment (Zope) is a free, Open Source
 Python-based application server for building high-performance, dynamic
@@ -78,38 +92,45 @@ eles ao inv
 
 %prep
 
-%setup -q -n %{name}-%{version}-%{sub_ver}
+%setup -q -n %{name}-%{version}-final
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%ifarch %{x8664} 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
 
 ./configure \
-       --prefix=/usr \
+       --prefix=%{zope_dir} \
        --optimize
+#      --with-python=/usr/bin/python
 
 %{__make}
 
 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
-# python wo_pcgi.py
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT{/var/lib/zope/main,/var/run/zope,/var/log/zope/main} \
        $RPM_BUILD_ROOT{/etc/logrotate.d,/etc/sysconfig,/etc/rc.d/init.d} \
-       $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}}
+       $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}} \
+       $RPM_BUILD_ROOT%{zope_dir}/bin
 
-%{__make} install INSTALL_FLAGS="--optimize=1 --root $RPM_BUILD_ROOT"
+ln -sfn /usr/bin/python $RPM_BUILD_ROOT%{zope_dir}/bin/python
 
-mv $RPM_BUILD_ROOT%{_libdir}{/python,/zope}
-mv $RPM_BUILD_ROOT%{_bindir}/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
-mv $RPM_BUILD_ROOT%{_bindir}/*.py $RPM_BUILD_ROOT%{_libdir}/zope
-mv $RPM_BUILD_ROOT/usr/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
-mv $RPM_BUILD_ROOT{%{_prefix}/import/*,%{_sysconfdir}/zope/skel/import}
+%{__make} install \
+       INSTALL_FLAGS="--root $RPM_BUILD_ROOT"
 
-rm -rf $RPM_BUILD_ROOT/usr/doc/
+mv $RPM_BUILD_ROOT%{zope_dir}/bin/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
+mv $RPM_BUILD_ROOT%{zope_dir}/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
+mv $RPM_BUILD_ROOT{%{zope_dir}/import/*,%{_sysconfdir}/zope/skel/import}
+
+rm -rf $RPM_BUILD_ROOT%{zope_dir}/doc
 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
 
@@ -129,14 +150,8 @@ touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
 rm -rf $RPM_BUILD_ROOT
 
 %pre
-if [ -z "`getgid zope`" ]; then
-       echo "Making group zope"
-       /usr/sbin/groupadd -r -f 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
-fi
+%groupadd -g 112 zope
+%useradd -u 112 -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
 
 %post
 /sbin/chkconfig --add zope
@@ -144,19 +159,21 @@ if [ ! -f /etc/zope/main/zope.conf ] ; then
        echo "Creating initial 'main' instance..."
        /usr/sbin/mkzopeinstance main zope:zope
        echo "Instance created. Listening on 127.0.0.1:8080, initial user: 'zope' with password: 'zope'"
+else
+       echo "old /etc/zope/zope.conf detected - look at changes about upgrade!" >&2
 fi
 was_stopped=0
 for dir in /var/lib/zope/main /var/lib/zope ; do
        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
@@ -164,7 +181,7 @@ for dir in /var/lib/zope/main /var/lib/zope ; do
 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
@@ -182,29 +199,26 @@ fi
 
 %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
 %defattr(644,root,root,755)
 %doc doc/*
 %attr(754,root,root) /etc/rc.d/init.d/zope
-%attr(755,root,root) %{_bindir}/*
 %attr(755,root,root) %{_sbindir}/*
-%{_libdir}/zope
-%attr(771,root,root) %dir /var/run/zope
-%attr(751,root,zope) %dir /var/lib/zope
-%attr(751,root,zope) %dir /var/lib/zope/main
-%attr(771,root,root) %dir /var/log/zope
-%attr(771,root,zope) %dir /var/log/zope/main
+%{zope_dir}
+%attr(775,zope,zope) %dir /var/run/zope
+%attr(775,zope,zope) %dir /var/lib/zope
+%attr(775,zope,zope) %dir /var/lib/zope/main
+%attr(775,zope,zope) %dir /var/log/zope
+%attr(775,zope,zope) %dir /var/log/zope/main
 %attr(640,root,root) %dir /etc/zope
 %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
This page took 0.115148 seconds and 4 git commands to generate.