]> git.pld-linux.org Git - packages/Zope.git/blobdiff - Zope.spec
- added and changed req.
[packages/Zope.git] / Zope.spec
index 4507335036547871b1c66baacb53eec6d598a8f0..51b8403b83b753ce00c68ed91bc1cbffd1764dea 100644 (file)
--- a/Zope.spec
+++ b/Zope.spec
@@ -1,49 +1,52 @@
+%include        /usr/lib/rpm/macros.python
+
+# TODO:
+# - no/more secure initial user/password settings (currently: zope/zope)
+# - ZEO support (mkzeoinstance is not tested and probably doesn't work)
+# - perl support?
+
 Summary:       An application server and portal toolkit for building Web sites
 Summary(es):   Un servidor de aplicaciones y un conjunto de herramientas para la construcción de sitios Web
 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
-Release:       1
+Version:       2.7.0
+%define                sub_ver b3
+Release:       3.%{sub_ver}.2
 License:       Zope Public License (ZPL)
 Group:         Networking/Daemons
-Source0:       http://www.zope.org/Products/%{name}/%{version}/%{name}-%{version}-src.tgz
-Source1:       http://www.zope.org/Documentation/Guides/ZCMG/ZCMG.html.tgz
-Source2:       http://www.zope.org/Documentation/Guides/DTML/DTML.html.tgz
-Source3:       http://www.zope.org/Documentation/Guides/ZSQL/ZSQL.html.tgz
-Source4:       http://www.zope.org/Documentation/Guides/%{name}-ProductTutorial.tar.gz
-Source5:       http://www.zope.org/Documentation/Guides/ZDG/ZDG.html.tgz
-Source6:       http://www.zope.org/Documentation/Guides/ZAG/ZAG.html.tgz
-# note: above documentation is deprecated, zope.org suggests using ZopeBook:
-#Source1:      http://www.zope.org/Members/michel/ZB/ZopeBook.tgz
-# note: changes in location of ZopeBook. Sugestions on Zope.org using this:
-Source9:       http://www.zope.org/Documentation/Books/ZopeBook/current/ZopeBook.tgz
-Source7:       %{name}.init
-Source8:       %{name}-zserver.sh
+Source0:       http://www.zope.org/Products/%{name}/%{version}%{sub_ver}/%{version}%{sub_ver}/%{name}-%{version}-%{sub_ver}.tgz
+# Source0-md5: 49d981bb35c33fda6d53b438fb9c9ad7
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+Source3:       %{name}.logrotate
+Source4:       %{name}-mkzopeinstance
+Source5:       %{name}-mkzeoinstance
+Source6:       %{name}-runzope
+Source7:       %{name}-zopectl
+Source8:       %{name}-installzopeproduct
+Patch0:                %{name}-default_config.patch
+Patch1:                %{name}-instance_paths.patch
 URL:           http://www.zope.org/
+BuildRequires: python-devel >= 2.3.2
+BuildRequires: perl-base
 PreReq:                rc-scripts
 Requires(pre): /usr/bin/getgid
 Requires(pre): /bin/id
 Requires(pre): /usr/sbin/groupadd
 Requires(pre): /usr/sbin/useradd
-Requires(post,preun):  /sbin/chkconfig
 Requires(postun):      /usr/sbin/userdel
 Requires(postun):      /usr/sbin/groupdel
-Requires:      python >= 2.2
-Requires:      python-modules >= 2.2
-BuildRequires: python-devel >= 2.2
+Requires(post,preun):  /sbin/chkconfig
+Requires:      logrotate
+Requires:      python >= 2.3.2
+Requires:      python-modules >= 2.3.2
+Requires:      python-libs >= 2.3.2
+Requires:      expat >= 1.95.7
+Requires:      python-PyXML >= 0.8.3
+%pyrequires_eq  python
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define python_prefix      %(echo `python -c "import sys; print sys.prefix"`)
-%define python_version     %(echo `python -c "import sys; print sys.version[:3]"`)
-%define python_libdir      %{python_prefix}/lib/python%{python_version}
-%define python_includedir  %{python_prefix}/include/python%{python_version}
-%define python_sitedir     %{python_libdir}/site-packages
-%define python_configdir   %{python_libdir}/config
-
-%define python_compile     python -c "import compileall; compileall.compile_dir('.')"
-%define python_compile_opt python -O -c "import compileall; compileall.compile_dir('.')"
-
 %description
 The Z Object Programming Environment (Zope) is a free, Open Source
 Python-based application server for building high-performance, dynamic
@@ -76,67 +79,99 @@ do Zope, outros sub-pacotes est
 eles ao invés desse RPM.
 
 %prep
-%setup -q -n %{name}-%{version}-src -a4
-mkdir ZopeContentManagersGuide GuideToDTML GuideToZSQL ZopeDevelopersGuide ZopeAdminGuide
-mkdir ZopeBook
-tar xzf %{SOURCE1} -C ZopeContentManagersGuide
-tar xzf %{SOURCE2} -C GuideToDTML
-tar xzf %{SOURCE3} -C GuideToZSQL
-tar xzf %{SOURCE5} -C ZopeDevelopersGuide
-tar xzf %{SOURCE6} -C ZopeAdminGuide
-tar xzf %{SOURCE9} -C ZopeBook
+
+%setup -q -n %{name}-%{version}-%{sub_ver}
+%patch0 -p1
+%patch1 -p1
 
 %build
 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
-python wo_pcgi.py
 
-find lib/python -type f -and \( -name 'Setup' -or -name '.cvsignore' \) -exec rm -f \{\} \;
-find -type f -and \( -name '*.c' -or -name '*.h' -or -name 'Makefile*' \) -exec rm -f \{\} \;
-rm -f ZServer/medusa/monitor_client_win32.py
+./configure \
+       --prefix=/usr \
+       --optimize
+
+%{__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{%{_bindir},%{_sbindir},%{_libdir}/zope} \
-           $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/log,/var/lib/zope}
 
-cp -a lib/python/* $RPM_BUILD_ROOT%{_libdir}/zope
-cp -a ZServer/ utilities/ import/ $RPM_BUILD_ROOT%{_libdir}/zope
-find $RPM_BUILD_ROOT%{_libdir}/zope -type f -name '*.py' -or -name '*.txt' | xargs -r rm -f
-cp -a ZServer/medusa/test/* $RPM_BUILD_ROOT%{_libdir}/zope/ZServer/medusa/test/
+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}}
 
-install zpasswd.py $RPM_BUILD_ROOT%{_bindir}/zpasswd
-install z2.py $RPM_BUILD_ROOT%{_libdir}/zope
-install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/zope-zserver
-install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
-install var/Data.fs $RPM_BUILD_ROOT/var/lib/zope/Data.fs
+%{__make} install INSTALL_FLAGS="--optimize=1 --root $RPM_BUILD_ROOT"
 
-touch $RPM_BUILD_ROOT/var/log/zope
+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}
 
-python $RPM_BUILD_ROOT%{_bindir}/zpasswd -u zope -p zope -d localhost $RPM_BUILD_ROOT/var/lib/zope/access
+rm -rf $RPM_BUILD_ROOT/usr/doc/
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
 
-gzip -9nf doc/*.txt *.txt
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/zope
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zope
+install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mkzopeinstance
+install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/mkzeoinstance
+install %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/runzope
+install %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/zopectl
+install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/installzopeproduct
+
+touch $RPM_BUILD_ROOT/var/log/zope/main/event.log
+touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %pre
 if [ -z "`getgid zope`" ]; then
-       echo "Making group zope"
-       /usr/sbin/groupadd -r -f zope
+       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 -s /bin/false -c "Zope User" -g zope zope
+       echo "Making user zope"
+       /usr/sbin/useradd -r -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
 fi
 
 %post
 /sbin/chkconfig --add zope
+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'"
+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
+               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
+               fi
+               echo "Migration completed (new db location is /var/lib/zope/main/var)"
+               break
+       fi
+done
 if [ -f /var/lock/subsys/zope ]; then
-       /etc/rc.d/init.d/zope restart >&2
+       if [ "x$was_stopped" != "x1" ]; then
+           /etc/rc.d/init.d/zope restart >&2
+       fi
 else
-       echo "Create inituser using \"zpasswd inituser\" in directory \"/var/lib/zope\"" >&2
+       echo "look at /etc/zope/main/zope.conf" >&2
        echo "Run then \"/etc/rc.d/init.d/zope start\" to start Zope." >&2
+       echo "you may create new Zope instances with mkzopeinstance" >&2
 fi
 
 %preun
@@ -149,18 +184,29 @@ 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 || :    
+       echo "Removing user zope"
+       /usr/sbin/userdel zope >/dev/null 2>&1 || :
+       echo "Removing group zope"
+       /usr/sbin/groupdel zope >/dev/null 2>&1 || :
 fi
 
 %files
 %defattr(644,root,root,755)
-%attr(755,root,root) /etc/rc.d/init.d/zope
+%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(1771,root,zope) %dir /var/lib/zope
-%attr(660,root,zope) %config(noreplace) %verify(not md5 size mtime) /var/lib/zope/*
-%doc *.gz doc/*.gz ZopeContentManagersGuide GuideToZSQL Tutorial ZopeDevelopersGuide ZopeAdminGuide ZopeBook
+%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
+%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) /etc/sysconfig/zope
+%ghost /var/log/zope/main/event.log
+%ghost /var/log/zope/main/Z2.log
This page took 0.046054 seconds and 4 git commands to generate.