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