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