1 %include /usr/lib/rpm/macros.python
4 # - no/more secure initial user/password settings (currently: zope/zope)
5 # - ZEO support (mkzeoinstance is not tested and probably doesn't work)
8 Summary: An application server and portal toolkit for building Web sites
9 Summary(es): Un servidor de aplicaciones y un conjunto de herramientas para la construcción de sitios Web
10 Summary(pl): Serwer aplikacji i toolkit portalowy do tworzenia serwisów WWW
11 Summary(pt_BR): Um servidor de aplicações e um conjunto de ferramentas para construção de sites Web
15 Release: 3.%{sub_ver}.1
16 License: Zope Public License (ZPL)
17 Group: Networking/Daemons
18 Source0: http://www.zope.org/Products/%{name}/%{version}%{sub_ver}/%{version}%{sub_ver}/%{name}-%{version}-%{sub_ver}.tgz
19 # Source0-md5: 97f5ec08f943de8e933936c05368af0d
21 Source2: %{name}.sysconfig
22 Source3: %{name}.logrotate
23 Source4: %{name}-mkzopeinstance
24 Source5: %{name}-mkzeoinstance
25 Source6: %{name}-runzope
26 Source7: %{name}-zopectl
27 Source8: %{name}-installzopeproduct
28 Patch0: %{name}-default_config.patch
29 Patch1: %{name}-instance_paths.patch
30 URL: http://www.zope.org/
31 BuildRequires: python-devel >= 2.3.3
32 BuildRequires: perl-base
34 Requires(pre): /usr/bin/getgid
35 Requires(pre): /bin/id
36 Requires(pre): /usr/sbin/groupadd
37 Requires(pre): /usr/sbin/useradd
38 Requires(postun): /usr/sbin/userdel
39 Requires(postun): /usr/sbin/groupdel
40 Requires(post,preun): /sbin/chkconfig
42 Requires: python >= 2.3.3
43 Requires: python-modules >= 2.3.3
44 Requires: python-libs >= 2.3.3
45 Requires: expat >= 1.95.7
46 Requires: python-PyXML >= 0.8.3
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 %define zope_dir /usr/lib/zope
53 The Z Object Programming Environment (Zope) is a free, Open Source
54 Python-based application server for building high-performance, dynamic
55 web sites, using a powerful and simple scripting object model and
56 high-performance, integrated object database.
59 Zope es una aplicación basada en Python, Open Source[tm], para la
60 construcción de sitios dinámicos, usa un modelo de escritura de
61 guiones poderoso y sencillo. Para instalar la aplicación Zope, instale
62 ese paquete y después, Zope-server, para un servidor HTTP integrado
63 simple, Zope-pcgi, para uso con el servidor Apache. Si desea instalar
64 solamente algunas partes de la aplicación Zope, están diponibles otros
65 subpaquetes, usted debe instalar éstos en vez de ese RPM.
68 Zope (Z Object Programming Environment - Obiektowe ¦rodowisko
69 Programistyczne Z) jest opartym o Pythona serwerem aplikacji do
70 tworzenia wysoko wydajnych, dynamicznych serwisów WWW, przy u¿yciu
71 u¿ytecznego i prostego modelu obiektowego skryptów oraz wysoko
72 wydajnej zintegrowanej obiektowej bazy danych.
75 Zope é uma aplicação baseada em Python, Open Source[tm], para
76 construção de sites dinâmicos, usando um modelo de scripting poderoso
77 e simples Para instalar o Zope, instale esse pacote e depois, ou o
78 Zope-server, para um servidor HTTP integrado simples, ou Zope-pcgi,
79 para uso com o Apache. Se você quiser instalar apenas algumas partes
80 do Zope, outros sub-pacotes estão disponíveis, e você deveria instalar
81 eles ao invés desse RPM.
85 %setup -q -n %{name}-%{version}-%{sub_ver}
90 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
94 # \ --with-python=/usr/bin/python
98 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
102 rm -rf $RPM_BUILD_ROOT
104 install -d $RPM_BUILD_ROOT{/var/lib/zope/main,/var/run/zope,/var/log/zope/main} \
105 $RPM_BUILD_ROOT{/etc/logrotate.d,/etc/sysconfig,/etc/rc.d/init.d} \
106 $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}}
108 %{__make} install INSTALL_FLAGS="--root $RPM_BUILD_ROOT"
110 mv $RPM_BUILD_ROOT%{zope_dir}/bin/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
111 mv $RPM_BUILD_ROOT%{zope_dir}/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
112 mv $RPM_BUILD_ROOT{%{zope_dir}/import/*,%{_sysconfdir}/zope/skel/import}
114 rm -rf $RPM_BUILD_ROOT%{zope_dir}/doc/
115 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
116 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
118 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
119 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/zope
120 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zope
121 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mkzopeinstance
122 install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/mkzeoinstance
123 install %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/runzope
124 install %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/zopectl
125 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/installzopeproduct
127 touch $RPM_BUILD_ROOT/var/log/zope/main/event.log
128 touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
131 rm -rf $RPM_BUILD_ROOT
134 if [ -z "`getgid zope`" ]; then
135 echo "Making group zope"
136 /usr/sbin/groupadd -r -f zope
138 if [ -z "`id -u zope 2>/dev/null`" ]; then
139 echo "Making user zope"
140 /usr/sbin/useradd -r -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
144 /sbin/chkconfig --add zope
145 if [ ! -f /etc/zope/main/zope.conf ] ; then
146 echo "Creating initial 'main' instance..."
147 /usr/sbin/mkzopeinstance main zope:zope
148 echo "Instance created. Listening on 127.0.0.1:8080, initial user: 'zope' with password: 'zope'"
151 for dir in /var/lib/zope/main /var/lib/zope ; do
152 if [ -f $dir/Data.fs ]; then
153 echo "Found the database in old location. Migrating..."
154 if [ -f /var/lock/subsys/zope ]; then
155 /etc/rc.d/init.d/zope stop >&2
159 [ -d /var/lib/zope/main ] && cd $dir && mv -f Data* /var/lib/zope/main/var 2>/dev/null
160 if [ "x$was_stopped" = "x1" ]; then
161 /etc/rc.d/init.d/zope start >&2
163 echo "Migration completed (new db location is /var/lib/zope/main/var)"
167 if [ -f /var/lock/subsys/zope ]; then
168 if [ "x$was_stopped" != "x1" ]; then
169 /etc/rc.d/init.d/zope restart >&2
172 echo "look at /etc/zope/main/zope.conf" >&2
173 echo "Run then \"/etc/rc.d/init.d/zope start\" to start Zope." >&2
174 echo "you may create new Zope instances with mkzopeinstance" >&2
178 if [ "$1" = "0" ]; then
179 if [ -f /var/lock/subsys/zope ]; then
180 /etc/rc.d/init.d/zope stop
182 /sbin/chkconfig --del zope
186 if [ "$1" = "0" ] ; then
187 echo "Removing user zope"
188 /usr/sbin/userdel zope >/dev/null 2>&1 || :
189 echo "Removing group zope"
190 /usr/sbin/groupdel zope >/dev/null 2>&1 || :
194 %defattr(644,root,root,755)
196 %attr(754,root,root) /etc/rc.d/init.d/zope
197 %attr(755,root,root) %{_sbindir}/*
199 %attr(775,zope,zope) %dir /var/run/zope
200 %attr(775,zope,zope) %dir /var/lib/zope
201 %attr(775,zope,zope) %dir /var/lib/zope/main
202 %attr(775,zope,zope) %dir /var/log/zope
203 %attr(775,zope,zope) %dir /var/log/zope/main
204 %attr(640,root,root) %dir /etc/zope
205 %attr(640,root,root) %dir /etc/zope/skel
206 %attr(640,root,root) %dir /etc/zope/main
207 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/zope/skel/*
208 %attr(640,root,root) /etc/logrotate.d/zope
209 %attr(640,root,root) /etc/sysconfig/zope
210 %ghost /var/log/zope/main/event.log
211 %ghost /var/log/zope/main/Z2.log