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