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