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