1 %include /usr/lib/rpm/macros.python
4 # - check why initgroups() crashes on AMD64 and something, better than
5 # disabling initgroups() completely, with that
6 # - no/more secure initial user/password settings (currently: zope/zope)
7 # - ZEO support (mkzeoinstance is not tested and probably doesn't work)
10 Summary: An application server and portal toolkit for building Web sites
11 Summary(es): Un servidor de aplicaciones y un conjunto de herramientas para la construcción de sitios Web
12 Summary(pl): Serwer aplikacji i toolkit portalowy do tworzenia serwisów WWW
13 Summary(pt_BR): Um servidor de aplicações e um conjunto de ferramentas para construção de sites Web
17 Release: 0.%{sub_ver}.1
18 License: Zope Public License (ZPL)
19 Group: Networking/Daemons
20 Source0: http://www.zope.org/Products/%{name}/%{version}%{sub_ver}/%{name}-%{version}-%{sub_ver}.tgz
21 # Source0-md5: 1f5c669570b47d73f24f5aa1a5a9e341
23 Source2: %{name}.sysconfig
24 Source3: %{name}.logrotate
25 Source4: %{name}-mkzopeinstance
26 Source5: %{name}-mkzeoinstance
27 Source6: %{name}-runzope
28 Source7: %{name}-zopectl
29 Source8: %{name}-installzopeproduct
30 Patch0: %{name}-default_config.patch
31 Patch1: %{name}-instance_paths.patch
32 Patch2: %{name}-pld_makefile_fix.patch
33 Patch3: %{name}-no_initgroups.patch
34 URL: http://www.zope.org/
35 BuildRequires: python-devel >= 2.3.3
36 BuildRequires: perl-base
38 Requires(pre): /usr/bin/getgid
39 Requires(pre): /bin/id
40 Requires(pre): /usr/sbin/groupadd
41 Requires(pre): /usr/sbin/useradd
42 Requires(postun): /usr/sbin/userdel
43 Requires(postun): /usr/sbin/groupdel
44 Requires(post,preun): /sbin/chkconfig
46 Requires: python >= 2.3.3
47 Requires: python-modules >= 2.3.3
48 Requires: python-libs >= 2.3.3
49 Requires: expat >= 1.95.7
50 Requires: python-PyXML >= 0.8.3
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define zope_dir /usr/lib/zope
57 The Z Object Programming Environment (Zope) is a free, Open Source
58 Python-based application server for building high-performance, dynamic
59 web sites, using a powerful and simple scripting object model and
60 high-performance, integrated object database.
63 Zope es una aplicación basada en Python, Open Source[tm], para la
64 construcción de sitios dinámicos, usa un modelo de escritura de
65 guiones poderoso y sencillo. Para instalar la aplicación Zope, instale
66 ese paquete y después, Zope-server, para un servidor HTTP integrado
67 simple, Zope-pcgi, para uso con el servidor Apache. Si desea instalar
68 solamente algunas partes de la aplicación Zope, están diponibles otros
69 subpaquetes, usted debe instalar éstos en vez de ese RPM.
72 Zope (Z Object Programming Environment - Obiektowe ¦rodowisko
73 Programistyczne Z) jest opartym o Pythona serwerem aplikacji do
74 tworzenia wysoko wydajnych, dynamicznych serwisów WWW, przy u¿yciu
75 u¿ytecznego i prostego modelu obiektowego skryptów oraz wysoko
76 wydajnej zintegrowanej obiektowej bazy danych.
79 Zope é uma aplicação baseada em Python, Open Source[tm], para
80 construção de sites dinâmicos, usando um modelo de scripting poderoso
81 e simples Para instalar o Zope, instale esse pacote e depois, ou o
82 Zope-server, para um servidor HTTP integrado simples, ou Zope-pcgi,
83 para uso com o Apache. Se você quiser instalar apenas algumas partes
84 do Zope, outros sub-pacotes estão disponíveis, e você deveria instalar
85 eles ao invés desse RPM.
89 %setup -q -n %{name}-%{version}-%{sub_ver}
98 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
101 --prefix=%{zope_dir} \
103 # --with-python=/usr/bin/python
107 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
110 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT{/var/lib/zope/main,/var/run/zope,/var/log/zope/main} \
113 $RPM_BUILD_ROOT{/etc/logrotate.d,/etc/sysconfig,/etc/rc.d/init.d} \
114 $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}} \
115 $RPM_BUILD_ROOT%{zope_dir}/bin
117 ln -sfn /usr/bin/python $RPM_BUILD_ROOT%{zope_dir}/bin/python
120 INSTALL_FLAGS="--root $RPM_BUILD_ROOT"
122 mv $RPM_BUILD_ROOT%{zope_dir}/bin/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
123 mv $RPM_BUILD_ROOT%{zope_dir}/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
124 mv $RPM_BUILD_ROOT{%{zope_dir}/import/*,%{_sysconfdir}/zope/skel/import}
126 rm -rf $RPM_BUILD_ROOT%{zope_dir}/doc
127 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
128 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
130 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
131 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/zope
132 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zope
133 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mkzopeinstance
134 install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/mkzeoinstance
135 install %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/runzope
136 install %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/zopectl
137 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/installzopeproduct
139 touch $RPM_BUILD_ROOT/var/log/zope/main/event.log
140 touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
143 rm -rf $RPM_BUILD_ROOT
146 if [ -z "`getgid zope`" ]; then
147 echo "Making group zope"
148 /usr/sbin/groupadd -r -f zope
150 if [ -z "`id -u zope 2>/dev/null`" ]; then
151 echo "Making user zope"
152 /usr/sbin/useradd -r -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
156 /sbin/chkconfig --add zope
157 if [ ! -f /etc/zope/main/zope.conf ] ; then
158 echo "Creating initial 'main' instance..."
159 /usr/sbin/mkzopeinstance main zope:zope
160 echo "Instance created. Listening on 127.0.0.1:8080, initial user: 'zope' with password: 'zope'"
162 echo "old /etc/zope/zope.conf detected - look at changes about upgrade!" >&2
165 for dir in /var/lib/zope/main /var/lib/zope ; do
166 if [ -f $dir/Data.fs ]; then
167 echo "Found the database in old location. Migrating..."
168 if [ -f /var/lock/subsys/zope ]; then
169 /etc/rc.d/init.d/zope stop >&2
173 [ -d /var/lib/zope/main ] && cd $dir && mv -f Data* /var/lib/zope/main/var 2>/dev/null
174 if [ "x$was_stopped" = "x1" ]; then
175 /etc/rc.d/init.d/zope start >&2
177 echo "Migration completed (new db location is /var/lib/zope/main/var)"
181 if [ -f /var/lock/subsys/zope ]; then
182 if [ "x$was_stopped" != "x1" ]; then
183 /etc/rc.d/init.d/zope restart >&2
186 echo "look at /etc/zope/main/zope.conf" >&2
187 echo "Run then \"/etc/rc.d/init.d/zope start\" to start Zope." >&2
188 echo "you may create new Zope instances with mkzopeinstance" >&2
192 if [ "$1" = "0" ]; then
193 if [ -f /var/lock/subsys/zope ]; then
194 /etc/rc.d/init.d/zope stop
196 /sbin/chkconfig --del zope
200 if [ "$1" = "0" ] ; then
201 echo "Removing user zope"
202 /usr/sbin/userdel zope >/dev/null 2>&1 || :
203 echo "Removing group zope"
204 /usr/sbin/groupdel zope >/dev/null 2>&1 || :
208 %defattr(644,root,root,755)
210 %attr(754,root,root) /etc/rc.d/init.d/zope
211 %attr(755,root,root) %{_sbindir}/*
213 %attr(775,zope,zope) %dir /var/run/zope
214 %attr(775,zope,zope) %dir /var/lib/zope
215 %attr(775,zope,zope) %dir /var/lib/zope/main
216 %attr(775,zope,zope) %dir /var/log/zope
217 %attr(775,zope,zope) %dir /var/log/zope/main
218 %attr(640,root,root) %dir /etc/zope
219 %attr(640,root,root) %dir /etc/zope/skel
220 %attr(640,root,root) %dir /etc/zope/main
221 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/zope/skel/*
222 %attr(640,root,root) /etc/logrotate.d/zope
223 %attr(640,root,root) /etc/sysconfig/zope
224 %ghost /var/log/zope/main/event.log
225 %ghost /var/log/zope/main/Z2.log