]> git.pld-linux.org Git - packages/drupal.git/blob - drupal.spec
576334ae13ba37a893d3577ead685b35417dca2f
[packages/drupal.git] / drupal.spec
1 %define         _ver            4.6
2 %define         _patchlevel     9
3 Summary:        Open source content management platform
4 Summary(pl):    Platforma do zarz±dzania tre¶ci± o otwartych ¼ród³ach
5 Name:           drupal
6 Version:        %{_ver}.%{_patchlevel}
7 Release:        1
8 License:        GPL
9 Group:          Applications/WWW
10 Source0:        http://drupal.org/files/projects/%{name}-%{version}.tar.gz
11 # Source0-md5:  31573869c0e56de6329ee7d68429917c
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:       apache(mod_access)
31 Requires:       apache(mod_alias)
32 Requires:       apache(mod_dir)
33 Requires:       apache(mod_expires)
34 Requires:       apache(mod_rewrite)
35 Requires:       php >= 3:4.3.3
36 Requires:       php-mysql
37 Requires:       php-pcre
38 Requires:       php-xml
39 Requires:       webapps
40 Requires:       webserver = apache
41 Obsoletes:      drupal-update
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         _appdir         %{_datadir}/%{name}
46 %define         _webapps        /etc/webapps
47 %define         _webapp         %{name}
48 %define         _sysconfdir     %{_webapps}/%{_webapp}
49
50 %description
51 Drupal is software that allows an individual or a community of users
52 to easily publish, manage and organize a great variety of content on a
53 website. Tens of thousands of people and organizations have used
54 Drupal to set up scores of different kinds of web sites, including
55 - community web portals and discussion sites
56 - corporate web sites/intranet portals
57 - personal web sites
58 - afficionado sites
59 - e-commerce applications
60 - resource directories
61
62 Drupal includes features to enable
63 - content management systems
64 - blogs
65 - collaborative authoring environments
66 - forums
67 - newsletters
68 - picture galleries
69 - file uploads and download
70
71 and much more.
72
73 %description -l pl
74 Drupal to oprogramowanie pozwalaj±ce osobie lub spo³eczno¶ci
75 u¿ytkowników na ³atwe publikowanie, zarz±dzanie i organizowanie ró¿nej
76 tre¶ci na stronie WWW. Dziesi±tki tysiêcy ludzi i organizacji u¿ywali
77 Drupala do ustawiania wyników ró¿nych rodzajów stron WWW, w tym:
78 - portale WWW i strony dyskusyjne spo³eczno¶ci
79 - korporacyjne strony WWW/portale intranetowe
80 - osobiste strony WWW
81 - strony mi³o¶ników
82 - aplikacje e-commerce
83 - s³owniki zasobów
84
85 Drupal zawiera zasoby umo¿liwiaj±ce tworzenie:
86 - systemów zarz±dzania tre¶ci±
87 - blogów
88 - ¶rodowisk pracy grupowej
89 - forów
90 - nowin
91 - galerii zdjêæ
92 - wrzucania i ¶ci±gania plików
93
94 i wiele wiêcej.
95
96 %package cron
97 Summary:        Drupal cron
98 Summary(pl):    Us³uga cron dla Drupala
99 Group:          Applications/WWW
100 Requires:       %{name} = %{version}-%{release}
101 Requires:       /usr/bin/php
102 Requires:       crondaemon
103 Requires:       php-cli >= 3:4.3.3
104
105 %description cron
106 This package contains script which invokes cron hooks for Drupal.
107
108 %description cron -l pl
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):    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
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):    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
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):    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
156 Ten pakiet zawiera motywy rozprowadzane z Drupalem.
157
158 %package xmlrpc
159 Summary:        XMLRPC server for Drupal
160 Summary(pl):    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
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 cron.php update.php $RPM_BUILD_ROOT%{_appdir}
203 cp -a modules/* $RPM_BUILD_ROOT%{_appdir}/modules
204 cp -a includes scripts $RPM_BUILD_ROOT%{_appdir}
205 cp -a sites $RPM_BUILD_ROOT%{_sysconfdir}
206
207 ln -s /var/lib/%{name} $RPM_BUILD_ROOT%{_appdir}/files
208 # needed for node.module for syndication icon
209 ln -s htdocs/misc $RPM_BUILD_ROOT%{_appdir}
210
211 # install themes
212 cp -a themes $RPM_BUILD_ROOT%{_appdir}/htdocs
213 # move .xtmpl/.theme out of htdocs
214 (cd $RPM_BUILD_ROOT%{_appdir}/htdocs && tar cf - --remove-files themes/*/*.{xtmpl,theme}) | tar -xf - -C $RPM_BUILD_ROOT%{_appdir}
215 mv $RPM_BUILD_ROOT%{_appdir}/{htdocs/,}themes/engines
216 # make screenshot.png available in appdir
217 for a in $RPM_BUILD_ROOT%{_appdir}/htdocs/themes/*; do
218         t=$(basename $a)
219         ln -s ../../htdocs/themes/$t/screenshot.png $RPM_BUILD_ROOT%{_appdir}/themes/$t
220 done
221
222 # a hack
223 s=themes/chameleon/marvin
224 ln -s ../../htdocs/$s $RPM_BUILD_ROOT%{_appdir}/$s
225
226 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
227 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
228 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
229
230 %clean
231 rm -rf $RPM_BUILD_ROOT
232
233 %post db-mysql
234 if [ "$1" = 1 ]; then
235 %banner -e %{name}-db-mysql <<EOF
236 If this is your first install of Drupal, you need to create Drupal database:
237
238 mysqladmin create drupal
239 zcat %{_docdir}/%{name}-db-mysql-%{version}/database.mysql.gz | mysql drupal
240 mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'PASSWORD'"
241 mysql -e "GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO 'drupal'@'localhost'"
242
243 EOF
244 fi
245
246 %post db-pgsql
247 if [ "$1" = 1 ]; then
248 %banner -e %{name}-db-pgsql <<EOF
249 If this is your first install of Drupal, you need to create Drupal database:
250
251 and import initial schema from
252 %{_docdir}/%{name}-db-pgsql-%{version}/database.pgsql.gz
253
254 EOF
255 fi
256
257 %triggerin -- apache1 < 1.3.37-3, apache1-base
258 %webapp_register apache %{_webapp}
259
260 %triggerun -- apache1 < 1.3.37-3, apache1-base
261 %webapp_unregister apache %{_webapp}
262
263 %triggerin -- apache < 2.2.0, apache-base
264 %webapp_register httpd %{_webapp}
265
266 %triggerun -- apache < 2.2.0, apache-base
267 %webapp_unregister httpd %{_webapp}
268
269 %triggerpostun -- %{name} < 4.6.4-0.4
270 # rescue app configs.
271 if [ -f /etc/drupal/sites/default/settings.php.rpmsave ]; then
272         mv -f %{_sysconfdir}/sites/default/settings.php{,.rpmnew}
273         mv -f /etc/drupal/sites/default/settings.php.rpmsave %{_sysconfdir}/sites/default/settings.php
274 fi
275 # other configured sites, if any
276 for i in /etc/drupal/sites/*; do
277         d=$(basename $i)
278         [ "$d" = "default" ] && continue
279         mv -f %{_sysconfdir}/sites/$d{,.rpmnew}
280         mv -f $i %{_sysconfdir}/sites/$d
281 done
282
283 # migrate from apache-config macros
284 if [ -f /etc/drupal/apache.conf.rpmsave ]; then
285         if [ -d /etc/apache/webapps.d ]; then
286                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
287                 cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/apache.conf
288         fi
289
290         if [ -d /etc/httpd/webapps.d ]; then
291                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
292                 cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
293         fi
294         rm -f /etc/drupal/apache.conf.rpmsave
295 fi
296
297 # place new config location, as trigger puts config only on first install, do it here.
298 if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
299         rm -f /etc/apache/conf.d/99_%{name}.conf
300         /usr/sbin/webapp register apache %{_webapp}
301         apache_reload=1
302 fi
303 if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
304         rm -f /etc/httpd/httpd.conf/99_%{name}.conf
305         /usr/sbin/webapp register httpd %{_webapp}
306         httpd_reload=1
307 fi
308
309 if [ "$httpd_reload" ]; then
310         %service -q httpd reload
311 fi
312 if [ "$apache_reload" ]; then
313         %service -q apache reload
314 fi
315
316 %triggerpostun -- %{name} < 4.6.8-0.5
317 grep -l 'This_is_a_Drupal_security_line_do_not_remove' \
318 %{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
319 | xargs -r \
320 sed -i -e '
321 /This_is_a_Drupal_security_line_do_not_remove/{
322         d
323         n
324         a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
325         a\      Options None
326         a\      <IfModule mod_rewrite.c>
327         a\      \       RewriteEngine off
328         a\      </IfModule>
329 }'
330 egrep -c 'Drupal_Security_Do_Not_Remove_See_SA_2006_006' \
331 %{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
332 | awk -F: '/:0/{print $1}' | xargs -r \
333 sed -i -e '
334 /<Directory \/var\/lib\/drupal>/{
335         n
336         a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
337         a\      Options None
338         a\      <IfModule mod_rewrite.c>
339         a\      \       RewriteEngine off
340         a\      </IfModule>
341 }'
342 [ ! -L /etc/httpd/webapps.d/drupal.conf ] || %service -q httpd reload
343 [ ! -L /etc/apache/webapps.d/drupal.conf ] || %service -q apache reload
344
345 %files
346 %defattr(644,root,root,755)
347 %doc *.txt README.PLD
348
349 %dir %attr(750,root,http) %{_sysconfdir}
350 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
351 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
352
353 %attr(750,root,http) %dir %{_sysconfdir}/sites
354 %attr(750,root,http) %dir %{_sysconfdir}/sites/default
355 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/default/*
356
357 %dir %{_appdir}
358 %{_appdir}/database
359 %{_appdir}/includes
360 %exclude %{_appdir}/includes/database.mysql.inc
361 %exclude %{_appdir}/includes/database.pgsql.inc
362 %{_appdir}/modules
363 %{_appdir}/scripts
364 %dir %{_appdir}/themes
365 %dir %{_appdir}/themes/engines
366 %{_appdir}/po
367 %{_appdir}/update.php
368 # symlinks
369 %{_appdir}/files
370 %{_appdir}/misc
371
372 %dir %{_appdir}/htdocs
373 %{_appdir}/htdocs/*.ico
374 %{_appdir}/htdocs/index.php
375 %{_appdir}/htdocs/misc
376 %dir %{_appdir}/htdocs/themes
377 %{_appdir}/htdocs/modules
378
379 %dir %attr(775,root,http) /var/lib/%{name}
380 %dir %attr(775,root,http) /var/cache/%{name}
381
382 %files cron
383 %defattr(644,root,root,755)
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
385 %{_appdir}/cron.php
386
387 %files db-mysql
388 %defattr(644,root,root,755)
389 %doc database/*.mysql
390 %doc README.replication
391 %{_appdir}/includes/database.mysql.inc
392
393 %files db-pgsql
394 %defattr(644,root,root,755)
395 %doc database/*.pgsql
396 %{_appdir}/includes/database.pgsql.inc
397
398 %files themes
399 %defattr(644,root,root,755)
400 %{_appdir}/themes/[!e]*
401 %{_appdir}/themes/engines/*
402 %{_appdir}/htdocs/themes/*
403
404 %files xmlrpc
405 %defattr(644,root,root,755)
406 %{_appdir}/htdocs/xmlrpc.php
This page took 0.220883 seconds and 2 git commands to generate.