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