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