]> git.pld-linux.org Git - packages/drupal.git/blob - drupal.spec
- provide virtual major version for inner package deps
[packages/drupal.git] / drupal.spec
1 %define         _ver            4.6
2 %define         _patchlevel     11
3 Summary:        Open source content management platform
4 Summary(pl.UTF-8):      Platforma do zarządzania treścią o otwartych źródłach
5 Name:           drupal
6 Version:        %{_ver}.%{_patchlevel}
7 Release:        3
8 License:        GPL
9 Group:          Applications/WWW
10 Source0:        http://drupal.org/files/projects/%{name}-%{version}.tar.gz
11 # Source0-md5:  cfa5777fb6a612addcee75dad132909e
12 Source1:        %{name}.conf
13 Source2:        %{name}.cron
14 Source3:        %{name}.PLD
15 Patch0:         %{name}-replication.patch
16 Patch1:         %{name}-sitesdir.patch
17 Patch2:         %{name}-topdir.patch
18 Patch3:         %{name}-themedir2.patch
19 Patch4:         %{name}-emptypass.patch
20 Patch5:         %{name}-cron.patch
21 Patch6:         %{name}-19298-cache.patch
22 Patch7:         %{name}-update-cli.patch
23 Patch8:         %{name}-locale-memory.patch
24 Patch9:         %{name}-comment.patch
25 URL:            http://drupal.org/
26 BuildRequires:  rpmbuild(macros) >= 1.264
27 BuildRequires:  sed >= 4.0
28 Requires:       %{name}(DB_Driver) = %{version}-%{release}
29 Requires:       %{name}(theme) = %{_ver}
30 Requires:       /usr/bin/php
31 Requires:       apache(mod_access)
32 Requires:       apache(mod_alias)
33 Requires:       apache(mod_dir)
34 Requires:       apache(mod_expires)
35 Requires:       apache(mod_rewrite)
36 Requires:       php(mysql)
37 Requires:       php(pcre)
38 Requires:       php(xml)
39 Requires:       webapps
40 Requires:       webserver = apache
41 Requires:       webserver(php) >= 4.3.3
42 Provides:       %{name} = %{_ver}
43 Obsoletes:      drupal-update
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         _appdir         %{_datadir}/%{name}
48 %define         _webapps        /etc/webapps
49 %define         _webapp         %{name}
50 %define         _sysconfdir     %{_webapps}/%{_webapp}
51
52 %description
53 Drupal is software that allows an individual or a community of users
54 to easily publish, manage and organize a great variety of content on a
55 website. Tens of thousands of people and organizations have used
56 Drupal to set up scores of different kinds of web sites, including
57 - community web portals and discussion sites
58 - corporate web sites/intranet portals
59 - personal web sites
60 - afficionado sites
61 - e-commerce applications
62 - resource directories
63
64 Drupal includes features to enable
65 - content management systems
66 - blogs
67 - collaborative authoring environments
68 - forums
69 - newsletters
70 - picture galleries
71 - file uploads and download
72
73 and much more.
74
75 %description -l pl.UTF-8
76 Drupal to oprogramowanie pozwalające osobie lub społeczności
77 użytkowników na łatwe publikowanie, zarządzanie i organizowanie różnej
78 treści na stronie WWW. Dziesiątki tysięcy ludzi i organizacji używali
79 Drupala do ustawiania wyników różnych rodzajów stron WWW, w tym:
80 - portale WWW i strony dyskusyjne społeczności
81 - korporacyjne strony WWW/portale intranetowe
82 - osobiste strony WWW
83 - strony miłośników
84 - aplikacje e-commerce
85 - słowniki zasobów
86
87 Drupal zawiera zasoby umożliwiające tworzenie:
88 - systemów zarządzania treścią
89 - blogów
90 - środowisk pracy grupowej
91 - forów
92 - nowin
93 - galerii zdjęć
94 - wrzucania i ściągania plików
95
96 i wiele więcej.
97
98 %package cron
99 Summary:        Drupal cron
100 Summary(pl.UTF-8):      Usługa cron dla Drupala
101 Group:          Applications/WWW
102 Requires:       %{name} = %{version}-%{release}
103 Requires:       crondaemon
104
105 %description cron
106 This package contains script which invokes cron hooks for Drupal.
107
108 %description cron -l pl.UTF-8
109 Ten pakiet zawiera skrypt wywołujący uchwyty crona dla Drupala.
110
111 %package db-mysql
112 Summary:        Drupal DB Driver for MySQL
113 Summary(pl.UTF-8):      Sterownik bazy danych MySQL dla Drupala
114 Group:          Applications/WWW
115 Requires:       php(mysql)
116 Provides:       %{name}(DB_Driver) = %{version}-%{release}
117
118 %description db-mysql
119 This virtual package provides MySQL database backend for Drupal.
120
121 %description db-mysql -l pl.UTF-8
122 Ten wirtualny pakiet dostarcza backend bazy danych MySQL dla Drupala.
123
124 %package db-pgsql
125 Summary:        Drupal DB Driver for PostgreSQL
126 Summary(pl.UTF-8):      Sterownik bazy danych PostgreSQL dla Drupala
127 Group:          Applications/WWW
128 Requires:       php(pgsql)
129 Provides:       %{name}(DB_Driver) = %{version}-%{release}
130
131 %description db-pgsql
132 This virtual package provides PostgreSQL database backend for Drupal.
133
134 NOTE: This driver is not tested in PLD, and not all modules have
135 database schema for PostgreSQL. Use this driver at your own risk!
136
137 %description db-pgsql -l pl.UTF-8
138 Ten wirtualny pakiet dostarcza backend bazy danych PostgreSQL dla
139 Drupala.
140
141 UWAGA: Ten sterownik nie był testowany w PLD i nie wszystkie moduły
142 mają schematy bazy danych dla PostgreSQL-a. Można go używać na własne
143 ryzyko.
144
145 %package themes
146 Summary:        Themes distributed with Drupal
147 Summary(pl.UTF-8):      Motywy rozprowadzane z Drupalem
148 Group:          Applications/WWW
149 Requires:       %{name} = %{version}-%{release}
150 Provides:       drupal(theme) = %{_ver}
151
152 %description themes
153 This package contains themes distributed with Drupal.
154
155 %description themes -l pl.UTF-8
156 Ten pakiet zawiera motywy rozprowadzane z Drupalem.
157
158 %package xmlrpc
159 Summary:        XMLRPC server for Drupal
160 Summary(pl.UTF-8):      Serwer XMLRPC dla Drupala
161 Group:          Applications/WWW
162 Requires:       %{name} = %{version}-%{release}
163
164 %description xmlrpc
165 XMLRPC server for Drupal allows other Drupals authorize with your
166 Drupal's user creditentials, this is called Distributed Authentication
167 in Drupal world.
168
169 %description xmlrpc -l pl.UTF-8
170 Serwer XMLRPC dla Drupala pozwala innym Drupalom autoryzować się z
171 danymi uwierzytelniającymi użytkownika danego Drupala - jest to
172 nazywane rozproszonym uwierzytelnianiem.
173
174 %prep
175 %setup -q
176 %patch0 -p1
177 %patch1 -p1
178 %patch2 -p1
179 %patch3 -p1
180 %patch4 -p1
181 %patch5 -p1
182 %patch6 -p0
183 %patch7 -p1
184 %patch8 -p1
185 %patch9 -p1
186
187 cp -p %{SOURCE3} README.PLD
188
189 # remove backups from patching as we use globs to package files to buildroot
190 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,/var/{cache,lib}/%{name}} \
195         $RPM_BUILD_ROOT%{_appdir}/{po,database,modules/po,htdocs/modules}
196
197 cp -a *.ico index.php $RPM_BUILD_ROOT%{_appdir}/htdocs
198 cp -a misc $RPM_BUILD_ROOT%{_appdir}/htdocs
199 cp -a xmlrpc.php $RPM_BUILD_ROOT%{_appdir}/htdocs
200 cp -a database/updates.inc $RPM_BUILD_ROOT%{_appdir}/database
201
202 cp -a update.php $RPM_BUILD_ROOT%{_appdir}
203 install cron.php $RPM_BUILD_ROOT%{_appdir}
204 cp -a modules/* $RPM_BUILD_ROOT%{_appdir}/modules
205 cp -a includes scripts $RPM_BUILD_ROOT%{_appdir}
206 cp -a sites $RPM_BUILD_ROOT%{_sysconfdir}
207
208 ln -s /var/lib/%{name} $RPM_BUILD_ROOT%{_appdir}/files
209 # needed for node.module for syndication icon
210 ln -s htdocs/misc $RPM_BUILD_ROOT%{_appdir}
211
212 # install themes
213 cp -a themes $RPM_BUILD_ROOT%{_appdir}/htdocs
214 # move .xtmpl/.theme out of htdocs
215 (cd $RPM_BUILD_ROOT%{_appdir}/htdocs && tar cf - --remove-files themes/*/*.{xtmpl,theme}) | tar -xf - -C $RPM_BUILD_ROOT%{_appdir}
216 mv $RPM_BUILD_ROOT%{_appdir}/{htdocs/,}themes/engines
217 # make screenshot.png available in appdir
218 for a in $RPM_BUILD_ROOT%{_appdir}/htdocs/themes/*; do
219         t=$(basename $a)
220         ln -s ../../htdocs/themes/$t/screenshot.png $RPM_BUILD_ROOT%{_appdir}/themes/$t
221 done
222
223 # a hack
224 s=themes/chameleon/marvin
225 ln -s ../../htdocs/$s $RPM_BUILD_ROOT%{_appdir}/$s
226
227 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
228 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
229 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
230
231 %clean
232 rm -rf $RPM_BUILD_ROOT
233
234 %post
235 # Perform database updates
236 echo 'Performing Drupal database updates'
237 cd %{_appdir} && %{_bindir}/php update.php Update
238 echo 'Done'
239
240 %post db-mysql
241 if [ "$1" = 1 ]; then
242 %banner -e %{name}-db-mysql <<EOF
243 If this is your first install of Drupal, you need to create Drupal database:
244
245 mysqladmin create drupal
246 zcat %{_docdir}/%{name}-db-mysql-%{version}/database.mysql.gz | mysql drupal
247 mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'PASSWORD'"
248 mysql -e "GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO 'drupal'@'localhost'"
249
250 EOF
251 fi
252
253 %post db-pgsql
254 if [ "$1" = 1 ]; then
255 %banner -e %{name}-db-pgsql <<EOF
256 If this is your first install of Drupal, you need to create Drupal database:
257
258 and import initial schema from
259 %{_docdir}/%{name}-db-pgsql-%{version}/database.pgsql.gz
260
261 EOF
262 fi
263
264 %triggerin -- apache1 < 1.3.37-3, apache1-base
265 %webapp_register apache %{_webapp}
266
267 %triggerun -- apache1 < 1.3.37-3, apache1-base
268 %webapp_unregister apache %{_webapp}
269
270 %triggerin -- apache < 2.2.0, apache-base
271 %webapp_register httpd %{_webapp}
272
273 %triggerun -- apache < 2.2.0, apache-base
274 %webapp_unregister httpd %{_webapp}
275
276 %triggerpostun -- %{name} < 4.6.4-0.4
277 # rescue app configs.
278 if [ -f /etc/drupal/sites/default/settings.php.rpmsave ]; then
279         mv -f %{_sysconfdir}/sites/default/settings.php{,.rpmnew}
280         mv -f /etc/drupal/sites/default/settings.php.rpmsave %{_sysconfdir}/sites/default/settings.php
281 fi
282 # other configured sites, if any
283 for i in /etc/drupal/sites/*; do
284         d=$(basename $i)
285         [ "$d" = "default" ] && continue
286         mv -f %{_sysconfdir}/sites/$d{,.rpmnew}
287         mv -f $i %{_sysconfdir}/sites/$d
288 done
289
290 # migrate from apache-config macros
291 if [ -f /etc/drupal/apache.conf.rpmsave ]; then
292         if [ -d /etc/apache/webapps.d ]; then
293                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
294                 cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/apache.conf
295         fi
296
297         if [ -d /etc/httpd/webapps.d ]; then
298                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
299                 cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
300         fi
301         rm -f /etc/drupal/apache.conf.rpmsave
302 fi
303
304 # place new config location, as trigger puts config only on first install, do it here.
305 if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
306         rm -f /etc/apache/conf.d/99_%{name}.conf
307         /usr/sbin/webapp register apache %{_webapp}
308         apache_reload=1
309 fi
310 if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
311         rm -f /etc/httpd/httpd.conf/99_%{name}.conf
312         /usr/sbin/webapp register httpd %{_webapp}
313         httpd_reload=1
314 fi
315
316 if [ "$httpd_reload" ]; then
317         %service -q httpd reload
318 fi
319 if [ "$apache_reload" ]; then
320         %service -q apache reload
321 fi
322
323 %triggerpostun -- %{name} < 4.6.8-0.5
324 grep -l 'This_is_a_Drupal_security_line_do_not_remove' \
325 %{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
326 | xargs -r \
327 sed -i -e '
328 /This_is_a_Drupal_security_line_do_not_remove/{
329         d
330         n
331         a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
332         a\      Options None
333         a\      <IfModule mod_rewrite.c>
334         a\      \       RewriteEngine off
335         a\      </IfModule>
336 }'
337 egrep -c 'Drupal_Security_Do_Not_Remove_See_SA_2006_006' \
338 %{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
339 | awk -F: '/:0/{print $1}' | xargs -r \
340 sed -i -e '
341 /<Directory \/var\/lib\/drupal>/{
342         n
343         a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
344         a\      Options None
345         a\      <IfModule mod_rewrite.c>
346         a\      \       RewriteEngine off
347         a\      </IfModule>
348 }'
349 [ ! -L /etc/httpd/webapps.d/drupal.conf ] || %service -q httpd reload
350 [ ! -L /etc/apache/webapps.d/drupal.conf ] || %service -q apache reload
351
352 %files
353 %defattr(644,root,root,755)
354 %doc *.txt README.PLD
355
356 %dir %attr(750,root,http) %{_sysconfdir}
357 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
358 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
359
360 %attr(750,root,http) %dir %{_sysconfdir}/sites
361 %attr(750,root,http) %dir %{_sysconfdir}/sites/default
362 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/default/*
363
364 %dir %{_appdir}
365 %{_appdir}/database
366 %{_appdir}/includes
367 %exclude %{_appdir}/includes/database.mysql.inc
368 %exclude %{_appdir}/includes/database.pgsql.inc
369 %{_appdir}/modules
370 %{_appdir}/scripts
371 %dir %{_appdir}/themes
372 %dir %{_appdir}/themes/engines
373 %{_appdir}/po
374 %{_appdir}/update.php
375 # symlinks
376 %{_appdir}/files
377 %{_appdir}/misc
378
379 %dir %{_appdir}/htdocs
380 %{_appdir}/htdocs/*.ico
381 %{_appdir}/htdocs/index.php
382 %{_appdir}/htdocs/misc
383 %dir %{_appdir}/htdocs/themes
384 %{_appdir}/htdocs/modules
385
386 %dir %attr(775,root,http) /var/lib/%{name}
387 %dir %attr(775,root,http) /var/cache/%{name}
388
389 %files cron
390 %defattr(644,root,root,755)
391 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
392 %attr(755,root,root) %{_appdir}/cron.php
393
394 %files db-mysql
395 %defattr(644,root,root,755)
396 %doc database/*.mysql
397 %doc README.replication
398 %{_appdir}/includes/database.mysql.inc
399
400 %files db-pgsql
401 %defattr(644,root,root,755)
402 %doc database/*.pgsql
403 %{_appdir}/includes/database.pgsql.inc
404
405 %files themes
406 %defattr(644,root,root,755)
407 %{_appdir}/themes/[!e]*
408 %{_appdir}/themes/engines/*
409 %{_appdir}/htdocs/themes/*
410
411 %files xmlrpc
412 %defattr(644,root,root,755)
413 %{_appdir}/htdocs/xmlrpc.php
This page took 0.087651 seconds and 4 git commands to generate.