]> git.pld-linux.org Git - packages/Zope.git/blob - Zope.spec
0843bf5f354dc5fd686f202b69f1f1423b1430ff
[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.7
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/Zope/%{version}/%{name}-%{version}-final.tgz
20 # Source0-md5:  66876823e53fbd0d4a8a7262d7ce251b
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}-python24.patch
34 URL:            http://www.zope.org/
35 BuildRequires:  perl-base
36 BuildRequires:  python-devel >= 1:2.3.3
37 BuildRequires:  rpmbuild(macros) >= 1.268
38 Requires(post,preun):   /sbin/chkconfig
39 Requires(postun):       /usr/sbin/groupdel
40 Requires(postun):       /usr/sbin/userdel
41 Requires(pre):  /bin/id
42 Requires(pre):  /usr/bin/getgid
43 Requires(pre):  /usr/sbin/groupadd
44 Requires(pre):  /usr/sbin/useradd
45 Requires:       expat >= 1.95.7
46 Requires:       logrotate
47 Requires:       python >= 2.3.3
48 Requires:       python-PyXML >= 0.8.3
49 Requires:       python-libs >= 2.3.3
50 Requires:       python-modules >= 2.3.3
51 Requires:       rc-scripts
52 %pyrequires_eq  python
53 Provides:       group(zope)
54 Provides:       user(zope)
55 Obsoletes:      Zope-Hotfix = 040713
56 Obsoletes:      Zope-Hotfix = 040714
57 Obsoletes:      Zope-Hotfix = 050405
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}-final
96 %patch0 -p1
97 %patch1 -p1
98 %patch2 -p1
99 %ifarch %{x8664} alpha
100 %patch3 -p1
101 %endif
102 %patch4 -p1
103
104 %build
105 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
106
107 ./configure \
108         --prefix=%{zope_dir} \
109         --optimize
110 #       --with-python=/usr/bin/python
111
112 %{__make}
113
114 perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118
119 install -d $RPM_BUILD_ROOT{/var/lib/zope/main,/var/run/zope,/var/log/zope/main} \
120         $RPM_BUILD_ROOT{/etc/logrotate.d,/etc/sysconfig,/etc/rc.d/init.d} \
121         $RPM_BUILD_ROOT{%{_sysconfdir}/zope/main,%{_sbindir}} \
122         $RPM_BUILD_ROOT%{zope_dir}/bin
123
124 ln -sfn /usr/bin/python $RPM_BUILD_ROOT%{zope_dir}/bin/python
125
126 %{__make} install \
127         INSTALL_FLAGS="--root $RPM_BUILD_ROOT"
128
129 mv $RPM_BUILD_ROOT%{zope_dir}/bin/zpasswd.py $RPM_BUILD_ROOT%{_sbindir}/zpasswd
130 mv $RPM_BUILD_ROOT%{zope_dir}/skel $RPM_BUILD_ROOT%{_sysconfdir}/zope
131 mv $RPM_BUILD_ROOT{%{zope_dir}/import/*,%{_sysconfdir}/zope/skel/import}
132
133 rm -rf $RPM_BUILD_ROOT%{zope_dir}/doc
134 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/log
135 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/zope/skel/bin/{runzope.bat,zopeservice.py}.in
136
137 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
138 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/zope
139 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zope
140 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mkzopeinstance
141 install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/mkzeoinstance
142 install %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/runzope
143 install %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/zopectl
144 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/installzopeproduct
145
146 touch $RPM_BUILD_ROOT/var/log/zope/main/event.log
147 touch $RPM_BUILD_ROOT/var/log/zope/main/Z2.log
148
149 %clean
150 rm -rf $RPM_BUILD_ROOT
151
152 %pre
153 %groupadd -g 112 zope
154 %useradd -u 112 -d /var/lib/zope/main -s /bin/false -c "Zope User" -g zope zope
155
156 %post
157 /sbin/chkconfig --add zope
158 # TODO: move this migration to trigger
159 if [ ! -f /etc/zope/main/zope.conf ] ; then
160         echo "Creating initial 'main' instance..."
161         /usr/sbin/mkzopeinstance main zope:zope
162         echo "Instance created. Listening on 127.0.0.1:8080, initial user: 'zope' with password: 'zope'"
163 else
164         echo "Old /etc/zope/zope.conf detected - look at changes about upgrade!" >&2
165 fi
166 was_stopped=0
167 for dir in /var/lib/zope/main /var/lib/zope ; do
168         if [ -f $dir/Data.fs ]; then
169                 echo "Found the database in old location. Migrating..."
170                 if [ -f /var/lock/subsys/zope ]; then
171                         /sbin/service zope stop >&2
172                         was_stopped=1
173                 fi
174                 umask 022
175                 [ -d /var/lib/zope/main ] && cd $dir && mv -f Data* /var/lib/zope/main/var 2>/dev/null
176                 if [ "x$was_stopped" = "x1" ]; then
177                         /sbin/service zope start >&2
178                 fi
179                 echo "Migration completed (new db location is /var/lib/zope/main/var)"
180                 break
181         fi
182 done
183 if [ -f /var/lock/subsys/zope ]; then
184         if [ "x$was_stopped" != "x1" ]; then
185                 /sbin/service zope restart >&2
186         fi
187 else
188         echo "look at /etc/zope/main/zope.conf" >&2
189         echo "Run then \"/sbin/service zope start\" to start Zope." >&2
190         echo "You may create new Zope instances with mkzopeinstance" >&2
191 fi
192
193 %preun
194 if [ "$1" = "0" ]; then
195         %service zope stop
196         /sbin/chkconfig --del zope
197 fi
198
199 %postun
200 if [ "$1" = "0" ] ; then
201         %userremove zope
202         %groupremove zope
203 fi
204
205 %files
206 %defattr(644,root,root,755)
207 %doc doc/*
208 %attr(754,root,root) /etc/rc.d/init.d/zope
209 %attr(755,root,root) %{_sbindir}/*
210 %{zope_dir}
211 %attr(775,zope,zope) %dir /var/run/zope
212 %attr(775,zope,zope) %dir /var/lib/zope
213 %attr(775,zope,zope) %dir /var/lib/zope/main
214 %attr(775,zope,zope) %dir /var/log/zope
215 %attr(775,zope,zope) %dir /var/log/zope/main
216 %attr(640,root,root) %dir %{_sysconfdir}/zope
217 %attr(640,root,root) %dir %{_sysconfdir}/zope/skel
218 %attr(640,root,root) %dir %{_sysconfdir}/zope/main
219 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zope/skel/*
220 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/zope
221 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/zope
222 %ghost /var/log/zope/main/event.log
223 %ghost /var/log/zope/main/Z2.log
This page took 0.082468 seconds and 3 git commands to generate.