]> git.pld-linux.org Git - packages/Zope.git/blob - Zope.spec
- added patch: fix for serving unicode documents with non text/*
[packages/Zope.git] / Zope.spec
1
2 # TODO:
3 # - check why initgroups() crashes on AMD64 and something, better than
4 #   disabling initgroups() completely, with that
5 # - no/more secure initial user/password settings (currently: zope/zope)
6 # - ZEO support (mkzeoinstance is not tested and probably doesn't work)
7 # - perl support?
8
9 Summary:        An application server and portal toolkit for building Web sites
10 Summary(es):    Un servidor de aplicaciones y un conjunto de herramientas para la construcción de sitios Web
11 Summary(pl):    Serwer aplikacji i toolkit portalowy do tworzenia serwisów WWW
12 Summary(pt_BR): Um servidor de aplicações e um conjunto de ferramentas para construção de sites Web
13 Name:           Zope
14 Version:        2.7.2
15 # %%define              sub_ver b2
16 Release:        4
17 License:        Zope Public License (ZPL)
18 Group:          Networking/Daemons
19 Source0:        http://www.zope.org/Products/%{name}/%{version}/%{name}-%{version}-0.tgz
20 # Source0-md5:  08b3c4a119aa1ded2e7b1b3d5bc45425
21 Source1:        %{name}.init
22 Source2:        %{name}.sysconfig
23 Source3:        %{name}.logrotate
24 Source4:        %{name}-mkzopeinstance
25 Source5:        %{name}-mkzeoinstance
26 Source6:        %{name}-runzope
27 Source7:        %{name}-zopectl
28 Source8:        %{name}-installzopeproduct
29 Patch0:         %{name}-default_config.patch
30 Patch1:         %{name}-instance_paths.patch
31 Patch2:         %{name}-pld_makefile_fix.patch
32 Patch3:         %{name}-no_initgroups.patch
33 Patch4:         %{name}-xhtml_unicode_fix.patch
34 URL:            http://www.zope.org/
35 BuildRequires:  python-devel >= 2.3.3
36 BuildRequires:  perl-base
37 BuildRequires:  rpmbuild(macros) >= 1.159
38 PreReq:         rc-scripts
39 Requires(pre):  /bin/id
40 Requires(pre):  /usr/bin/getgid
41 Requires(pre):  /usr/sbin/groupadd
42 Requires(pre):  /usr/sbin/useradd
43 Requires(postun):       /usr/sbin/groupdel
44 Requires(postun):       /usr/sbin/userdel
45 Requires(post,preun):   /sbin/chkconfig
46 Requires:       logrotate
47 Requires:       python >= 2.3.3
48 Requires:       python-modules >= 2.3.3
49 Requires:       python-libs >= 2.3.3
50 Requires:       expat >= 1.95.7
51 Requires:       python-PyXML >= 0.8.3
52 %pyrequires_eq  python
53 Provides:       group(zope)
54 Provides:       user(zope)
55 Obsoletes:      Zope-Hotfix = 040713
56 Obsoletes:      Zope-Hotfix = 040714
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %define         zope_dir /usr/lib/zope
60
61 %description
62 The Z Object Programming Environment (Zope) is a free, Open Source
63 Python-based application server for building high-performance, dynamic
64 web sites, using a powerful and simple scripting object model and
65 high-performance, integrated object database.
66
67 %description -l es
68 Zope es una aplicación basada en Python, Open Source[tm], para la
69 construcción de sitios dinámicos, usa un modelo de escritura de
70 guiones poderoso y sencillo. Para instalar la aplicación Zope, instale
71 ese paquete y después, Zope-server, para un servidor HTTP integrado
72 simple, Zope-pcgi, para uso con el servidor Apache. Si desea instalar
73 solamente algunas partes de la aplicación Zope, están diponibles otros
74 subpaquetes, usted debe instalar éstos en vez de ese RPM.
75
76 %description -l pl
77 Zope (Z Object Programming Environment - Obiektowe ¦rodowisko
78 Programistyczne Z) jest opartym o Pythona serwerem aplikacji do
79 tworzenia wysoko wydajnych, dynamicznych serwisów WWW, przy u¿yciu
80 u¿ytecznego i prostego modelu obiektowego skryptów oraz wysoko
81 wydajnej zintegrowanej obiektowej bazy danych.
82
83 %description -l pt_BR
84 Zope é uma aplicação baseada em Python, Open Source[tm], para
85 construção de sites dinâmicos, usando um modelo de scripting poderoso
86 e simples Para instalar o Zope, instale esse pacote e depois, ou o
87 Zope-server, para um servidor HTTP integrado simples, ou Zope-pcgi,
88 para uso com o Apache. Se você quiser instalar apenas algumas partes
89 do Zope, outros sub-pacotes estão disponíveis, e você deveria instalar
90 eles ao invés desse RPM.
91
92 %prep
93
94 %setup -q -n %{name}-%{version}-0
95 %patch0 -p1
96 %patch1 -p1
97 %patch2 -p1
98 %ifarch amd64 alpha
99 %patch3 -p1
100 %patch4 -p1
101 %endif
102
103 %build
104 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
105
106 ./configure \
107         --prefix=%{zope_dir} \
108         --optimize
109 #       --with-python=/usr/bin/python
110
111 %{__make}
112
113 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117
118 install -d $RPM_BUILD_ROOT{/var/lib/zope/main,/var/run/zope,/var/log/zope/main} \
119         $RPM_BUILD_ROOT{/etc/logrotate.d,/etc/sysconfig,/etc/rc.d/init.d} \
120         $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}} \
121         $RPM_BUILD_ROOT%{zope_dir}/bin
122
123 ln -sfn /usr/bin/python $RPM_BUILD_ROOT%{zope_dir}/bin/python
124
125 %{__make} install \
126         INSTALL_FLAGS="--root $RPM_BUILD_ROOT"
127
128 mv $RPM_BUILD_ROOT%{zope_dir}/bin/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
129 mv $RPM_BUILD_ROOT%{zope_dir}/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
130 mv $RPM_BUILD_ROOT{%{zope_dir}/import/*,%{_sysconfdir}/zope/skel/import}
131
132 rm -rf $RPM_BUILD_ROOT%{zope_dir}/doc
133 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
134 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
135
136 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
137 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/zope
138 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zope
139 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mkzopeinstance
140 install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/mkzeoinstance
141 install %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/runzope
142 install %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/zopectl
143 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/installzopeproduct
144
145 touch $RPM_BUILD_ROOT/var/log/zope/main/event.log
146 touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
147
148 %clean
149 rm -rf $RPM_BUILD_ROOT
150
151 %pre
152 if [ -n "`/usr/bin/getgid zope`" ]; then
153         if [ "`/usr/bin/getgid zope`" != "112" ]; then
154                 echo "Error: group zope doesn't have gid=112. Correct this before installing zope." 1>&2
155                 exit 1
156         fi
157 else
158         echo "Making group zope"
159         /usr/sbin/groupadd -g 112 zope
160 fi
161 if [ -n "`/bin/id -u zope 2>/dev/null`" ]; then
162         if [ "`/bin/id -u zope`" != "112" ]; then
163                 echo "Error: user zope doesn't have uid=112. Correct this before installing zope." 1>&2
164                 exit 1
165         fi
166 else
167         echo "Making user zope"
168         /usr/sbin/useradd -u 112 -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
169 fi
170
171 %post
172 /sbin/chkconfig --add zope
173 if [ ! -f /etc/zope/main/zope.conf ] ; then
174         echo "Creating initial 'main' instance..."
175         /usr/sbin/mkzopeinstance main zope:zope
176         echo "Instance created. Listening on 127.0.0.1:8080, initial user: 'zope' with password: 'zope'"
177 else
178         echo "old /etc/zope/zope.conf detected - look at changes about upgrade!" >&2
179 fi
180 was_stopped=0
181 for dir in /var/lib/zope/main /var/lib/zope ; do
182         if [ -f $dir/Data.fs ]; then
183                 echo "Found the database in old location. Migrating..."
184                 if [ -f /var/lock/subsys/zope ]; then
185                         /etc/rc.d/init.d/zope stop >&2
186                         was_stopped=1
187                 fi
188                 umask 022
189                 [ -d /var/lib/zope/main ] && cd $dir && mv -f Data* /var/lib/zope/main/var 2>/dev/null
190                 if [ "x$was_stopped" = "x1" ]; then
191                         /etc/rc.d/init.d/zope start >&2
192                 fi
193                 echo "Migration completed (new db location is /var/lib/zope/main/var)"
194                 break
195         fi
196 done
197 if [ -f /var/lock/subsys/zope ]; then
198         if [ "x$was_stopped" != "x1" ]; then
199                 /etc/rc.d/init.d/zope restart >&2
200         fi
201 else
202         echo "look at /etc/zope/main/zope.conf" >&2
203         echo "Run then \"/etc/rc.d/init.d/zope start\" to start Zope." >&2
204         echo "you may create new Zope instances with mkzopeinstance" >&2
205 fi
206
207 %preun
208 if [ "$1" = "0" ]; then
209         if [ -f /var/lock/subsys/zope ]; then
210                 /etc/rc.d/init.d/zope stop
211         fi
212         /sbin/chkconfig --del zope
213 fi
214
215 %postun
216 if [ "$1" = "0" ] ; then
217         %userremove zope
218         %groupremove zope
219 fi
220
221 %files
222 %defattr(644,root,root,755)
223 %doc doc/*
224 %attr(754,root,root) /etc/rc.d/init.d/zope
225 %attr(755,root,root) %{_sbindir}/*
226 %{zope_dir}
227 %attr(775,zope,zope) %dir /var/run/zope
228 %attr(775,zope,zope) %dir /var/lib/zope
229 %attr(775,zope,zope) %dir /var/lib/zope/main
230 %attr(775,zope,zope) %dir /var/log/zope
231 %attr(775,zope,zope) %dir /var/log/zope/main
232 %attr(640,root,root) %dir /etc/zope
233 %attr(640,root,root) %dir /etc/zope/skel
234 %attr(640,root,root) %dir /etc/zope/main
235 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/zope/skel/*
236 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/zope
237 %attr(640,root,root) /etc/sysconfig/zope
238 %ghost /var/log/zope/main/event.log
239 %ghost /var/log/zope/main/Z2.log
This page took 0.153091 seconds and 3 git commands to generate.