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