]>
Commit | Line | Data |
---|---|---|
01c85086 | 1 | %define _ver 4.6 |
ab115a1d | 2 | %define _patchlevel 11 |
412d0f01 | 3 | Summary: Open source content management platform |
19981946 | 4 | Summary(pl.UTF-8): Platforma do zarządzania treścią o otwartych źródłach |
412d0f01 | 5 | Name: drupal |
01c85086 | 6 | Version: %{_ver}.%{_patchlevel} |
fb7afeb8 | 7 | Release: 2 |
412d0f01 ER |
8 | License: GPL |
9 | Group: Applications/WWW | |
10 | Source0: http://drupal.org/files/projects/%{name}-%{version}.tar.gz | |
ab115a1d | 11 | # Source0-md5: cfa5777fb6a612addcee75dad132909e |
54439521 | 12 | Source1: %{name}.conf |
70724985 | 13 | Source2: %{name}.cron |
8ade80fb | 14 | Source3: %{name}.PLD |
c0240262 ER |
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 | |
edfdf0be | 21 | Patch6: %{name}-19298-cache.patch |
2dcd617a | 22 | Patch7: %{name}-update-cli.patch |
8bf561c0 | 23 | Patch8: %{name}-locale-memory.patch |
532b39ca | 24 | Patch9: %{name}-comment.patch |
412d0f01 | 25 | URL: http://drupal.org/ |
0c7df6f6 | 26 | BuildRequires: rpmbuild(macros) >= 1.264 |
6c37b393 | 27 | BuildRequires: sed >= 4.0 |
8655c58e | 28 | Requires: %{name}(DB_Driver) = %{version}-%{release} |
01c85086 | 29 | Requires: %{name}(theme) = %{_ver} |
ab115a1d | 30 | Requires: /usr/bin/php |
3128c8e1 | 31 | Requires: apache(mod_access) |
8655c58e ER |
32 | Requires: apache(mod_alias) |
33 | Requires: apache(mod_dir) | |
3128c8e1 ER |
34 | Requires: apache(mod_expires) |
35 | Requires: apache(mod_rewrite) | |
3aa2f5f2 ER |
36 | Requires: php(mysql) |
37 | Requires: php(pcre) | |
38 | Requires: php(xml) | |
8655c58e ER |
39 | Requires: webapps |
40 | Requires: webserver = apache | |
3aa2f5f2 | 41 | Requires: webserver(php) >= 4.3.3 |
c9f9ea34 | 42 | Obsoletes: drupal-update |
412d0f01 ER |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %define _appdir %{_datadir}/%{name} | |
0c7df6f6 ER |
47 | %define _webapps /etc/webapps |
48 | %define _webapp %{name} | |
49 | %define _sysconfdir %{_webapps}/%{_webapp} | |
412d0f01 ER |
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 | ||
19981946 JR |
74 | %description -l pl.UTF-8 |
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 | |
829e6b2c JB |
80 | - korporacyjne strony WWW/portale intranetowe |
81 | - osobiste strony WWW | |
19981946 | 82 | - strony miłośników |
829e6b2c | 83 | - aplikacje e-commerce |
19981946 | 84 | - słowniki zasobów |
829e6b2c | 85 | |
19981946 JR |
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 | |
829e6b2c | 91 | - nowin |
19981946 JR |
92 | - galerii zdjęć |
93 | - wrzucania i ściągania plików | |
829e6b2c | 94 | |
19981946 | 95 | i wiele więcej. |
829e6b2c | 96 | |
70724985 | 97 | %package cron |
829e6b2c | 98 | Summary: Drupal cron |
19981946 | 99 | Summary(pl.UTF-8): Usługa cron dla Drupala |
70724985 ER |
100 | Group: Applications/WWW |
101 | Requires: %{name} = %{version}-%{release} | |
102 | Requires: crondaemon | |
70724985 ER |
103 | |
104 | %description cron | |
829e6b2c JB |
105 | This package contains script which invokes cron hooks for Drupal. |
106 | ||
19981946 JR |
107 | %description cron -l pl.UTF-8 |
108 | Ten pakiet zawiera skrypt wywołujący uchwyty crona dla Drupala. | |
70724985 | 109 | |
a04f1ba7 ER |
110 | %package db-mysql |
111 | Summary: Drupal DB Driver for MySQL | |
19981946 | 112 | Summary(pl.UTF-8): Sterownik bazy danych MySQL dla Drupala |
a04f1ba7 | 113 | Group: Applications/WWW |
3aa2f5f2 | 114 | Requires: php(mysql) |
a04f1ba7 ER |
115 | Provides: %{name}(DB_Driver) = %{version}-%{release} |
116 | ||
117 | %description db-mysql | |
118 | This virtual package provides MySQL database backend for Drupal. | |
119 | ||
19981946 | 120 | %description db-mysql -l pl.UTF-8 |
8655c58e | 121 | Ten wirtualny pakiet dostarcza backend bazy danych MySQL dla Drupala. |
a04f1ba7 ER |
122 | |
123 | %package db-pgsql | |
124 | Summary: Drupal DB Driver for PostgreSQL | |
19981946 | 125 | Summary(pl.UTF-8): Sterownik bazy danych PostgreSQL dla Drupala |
a04f1ba7 | 126 | Group: Applications/WWW |
3aa2f5f2 | 127 | Requires: php(pgsql) |
a04f1ba7 ER |
128 | Provides: %{name}(DB_Driver) = %{version}-%{release} |
129 | ||
130 | %description db-pgsql | |
8655c58e | 131 | This virtual package provides PostgreSQL database backend for Drupal. |
a04f1ba7 ER |
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 | ||
19981946 | 136 | %description db-pgsql -l pl.UTF-8 |
a04f1ba7 ER |
137 | Ten wirtualny pakiet dostarcza backend bazy danych PostgreSQL dla |
138 | Drupala. | |
139 | ||
19981946 JR |
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 | |
b4699926 JB |
142 | ryzyko. |
143 | ||
01c85086 ER |
144 | %package themes |
145 | Summary: Themes distributed with Drupal | |
19981946 | 146 | Summary(pl.UTF-8): Motywy rozprowadzane z Drupalem |
01c85086 ER |
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 | ||
19981946 | 154 | %description themes -l pl.UTF-8 |
1017e008 JB |
155 | Ten pakiet zawiera motywy rozprowadzane z Drupalem. |
156 | ||
8c193c52 ER |
157 | %package xmlrpc |
158 | Summary: XMLRPC server for Drupal | |
19981946 | 159 | Summary(pl.UTF-8): Serwer XMLRPC dla Drupala |
8c193c52 ER |
160 | Group: Applications/WWW |
161 | Requires: %{name} = %{version}-%{release} | |
162 | ||
163 | %description xmlrpc | |
042c8875 | 164 | XMLRPC server for Drupal allows other Drupals authorize with your |
8c193c52 ER |
165 | Drupal's user creditentials, this is called Distributed Authentication |
166 | in Drupal world. | |
167 | ||
19981946 JR |
168 | %description xmlrpc -l pl.UTF-8 |
169 | Serwer XMLRPC dla Drupala pozwala innym Drupalom autoryzować się z | |
170 | danymi uwierzytelniającymi użytkownika danego Drupala - jest to | |
042c8875 JB |
171 | nazywane rozproszonym uwierzytelnianiem. |
172 | ||
412d0f01 ER |
173 | %prep |
174 | %setup -q | |
c0240262 ER |
175 | %patch0 -p1 |
176 | %patch1 -p1 | |
177 | %patch2 -p1 | |
829e6b2c | 178 | %patch3 -p1 |
c0240262 | 179 | %patch4 -p1 |
829e6b2c | 180 | %patch5 -p1 |
edfdf0be | 181 | %patch6 -p0 |
2dcd617a | 182 | %patch7 -p1 |
8bf561c0 | 183 | %patch8 -p1 |
532b39ca | 184 | %patch9 -p1 |
412d0f01 | 185 | |
f7c6dec3 | 186 | cp -p %{SOURCE3} README.PLD |
412d0f01 | 187 | |
70ff63a9 ER |
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 | ||
412d0f01 ER |
191 | %install |
192 | rm -rf $RPM_BUILD_ROOT | |
47d1108e | 193 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,/var/{cache,lib}/%{name}} \ |
2dcd617a | 194 | $RPM_BUILD_ROOT%{_appdir}/{po,database,modules/po,htdocs/modules} |
412d0f01 ER |
195 | |
196 | cp -a *.ico index.php $RPM_BUILD_ROOT%{_appdir}/htdocs | |
6c37b393 | 197 | cp -a misc $RPM_BUILD_ROOT%{_appdir}/htdocs |
c9f9ea34 | 198 | cp -a xmlrpc.php $RPM_BUILD_ROOT%{_appdir}/htdocs |
2dcd617a | 199 | cp -a database/updates.inc $RPM_BUILD_ROOT%{_appdir}/database |
412d0f01 | 200 | |
fb7afeb8 ER |
201 | cp -a update.php $RPM_BUILD_ROOT%{_appdir} |
202 | install cron.php $RPM_BUILD_ROOT%{_appdir} | |
a93937fa ER |
203 | cp -a modules/* $RPM_BUILD_ROOT%{_appdir}/modules |
204 | cp -a includes scripts $RPM_BUILD_ROOT%{_appdir} | |
6c37b393 | 205 | cp -a sites $RPM_BUILD_ROOT%{_sysconfdir} |
412d0f01 | 206 | |
3ebcddee | 207 | ln -s /var/lib/%{name} $RPM_BUILD_ROOT%{_appdir}/files |
dd3fb6f3 ER |
208 | # needed for node.module for syndication icon |
209 | ln -s htdocs/misc $RPM_BUILD_ROOT%{_appdir} | |
be9c29c5 | 210 | |
743c9a08 ER |
211 | # install themes |
212 | cp -a themes $RPM_BUILD_ROOT%{_appdir}/htdocs | |
be9c29c5 ER |
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} | |
f4ab86cb | 215 | mv $RPM_BUILD_ROOT%{_appdir}/{htdocs/,}themes/engines |
6ee15950 ER |
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 | |
f4ab86cb | 221 | |
743c9a08 ER |
222 | # a hack |
223 | s=themes/chameleon/marvin | |
224 | ln -s ../../htdocs/$s $RPM_BUILD_ROOT%{_appdir}/$s | |
225 | ||
75dde265 | 226 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
0c7df6f6 | 227 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf |
70724985 | 228 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name} |
54439521 | 229 | |
829e6b2c JB |
230 | %clean |
231 | rm -rf $RPM_BUILD_ROOT | |
232 | ||
ab115a1d ER |
233 | %post |
234 | # Perform database updates | |
235 | echo 'Performing Drupal database updates' | |
2c11dd13 | 236 | cd %{_appdir} && %{_bindir}/php update.php Update |
ab115a1d ER |
237 | echo 'Done' |
238 | ||
b3296022 | 239 | %post db-mysql |
3128c8e1 | 240 | if [ "$1" = 1 ]; then |
b3296022 ER |
241 | %banner -e %{name}-db-mysql <<EOF |
242 | If this is your first install of Drupal, you need to create Drupal database: | |
6c37b393 | 243 | |
b3296022 ER |
244 | mysqladmin create drupal |
245 | zcat %{_docdir}/%{name}-db-mysql-%{version}/database.mysql.gz | mysql drupal | |
f7c6dec3 | 246 | mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'PASSWORD'" |
5dd481fc | 247 | mysql -e "GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO 'drupal'@'localhost'" |
f7c6dec3 | 248 | |
b3296022 ER |
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 | |
6c37b393 ER |
259 | |
260 | EOF | |
3128c8e1 | 261 | fi |
6c37b393 | 262 | |
4a858d32 | 263 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
0c7df6f6 | 264 | %webapp_register apache %{_webapp} |
54439521 | 265 | |
4a858d32 | 266 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
0c7df6f6 | 267 | %webapp_unregister apache %{_webapp} |
54439521 | 268 | |
1fb905cc | 269 | %triggerin -- apache < 2.2.0, apache-base |
0c7df6f6 | 270 | %webapp_register httpd %{_webapp} |
54439521 | 271 | |
1fb905cc | 272 | %triggerun -- apache < 2.2.0, apache-base |
0c7df6f6 ER |
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 | |
1d7fcbc6 | 316 | %service -q httpd reload |
0c7df6f6 ER |
317 | fi |
318 | if [ "$apache_reload" ]; then | |
1d7fcbc6 | 319 | %service -q apache reload |
0c7df6f6 | 320 | fi |
54439521 | 321 | |
a02148ba ER |
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' \ | |
601c7f38 ER |
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 | |
a02148ba ER |
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> | |
601c7f38 ER |
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 | ||
412d0f01 ER |
351 | %files |
352 | %defattr(644,root,root,755) | |
b3296022 | 353 | %doc *.txt README.PLD |
54439521 | 354 | |
0c7df6f6 | 355 | %dir %attr(750,root,http) %{_sysconfdir} |
75dde265 | 356 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf |
0c7df6f6 | 357 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf |
54439521 | 358 | |
6c37b393 ER |
359 | %attr(750,root,http) %dir %{_sysconfdir}/sites |
360 | %attr(750,root,http) %dir %{_sysconfdir}/sites/default | |
5f407171 | 361 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/default/* |
6c37b393 | 362 | |
412d0f01 | 363 | %dir %{_appdir} |
c9f9ea34 | 364 | %{_appdir}/database |
412d0f01 | 365 | %{_appdir}/includes |
321e0de6 ER |
366 | %exclude %{_appdir}/includes/database.mysql.inc |
367 | %exclude %{_appdir}/includes/database.pgsql.inc | |
412d0f01 ER |
368 | %{_appdir}/modules |
369 | %{_appdir}/scripts | |
01c85086 | 370 | %dir %{_appdir}/themes |
8ccbe0a8 | 371 | %dir %{_appdir}/themes/engines |
76caba40 | 372 | %{_appdir}/po |
c9f9ea34 ER |
373 | %{_appdir}/update.php |
374 | # symlinks | |
a93937fa | 375 | %{_appdir}/files |
7b913139 | 376 | %{_appdir}/misc |
70724985 | 377 | |
be9c29c5 | 378 | %dir %{_appdir}/htdocs |
8c193c52 ER |
379 | %{_appdir}/htdocs/*.ico |
380 | %{_appdir}/htdocs/index.php | |
be9c29c5 | 381 | %{_appdir}/htdocs/misc |
01c85086 | 382 | %dir %{_appdir}/htdocs/themes |
a93937fa | 383 | %{_appdir}/htdocs/modules |
3ebcddee ER |
384 | |
385 | %dir %attr(775,root,http) /var/lib/%{name} | |
47d1108e | 386 | %dir %attr(775,root,http) /var/cache/%{name} |
0c0ad8e1 | 387 | |
70724985 ER |
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} | |
fb7afeb8 | 391 | %attr(755,root,root) %{_appdir}/cron.php |
8c193c52 | 392 | |
a04f1ba7 ER |
393 | %files db-mysql |
394 | %defattr(644,root,root,755) | |
b3296022 ER |
395 | %doc database/*.mysql |
396 | %doc README.replication | |
321e0de6 | 397 | %{_appdir}/includes/database.mysql.inc |
a04f1ba7 ER |
398 | |
399 | %files db-pgsql | |
400 | %defattr(644,root,root,755) | |
b3296022 | 401 | %doc database/*.pgsql |
321e0de6 | 402 | %{_appdir}/includes/database.pgsql.inc |
a04f1ba7 | 403 | |
01c85086 ER |
404 | %files themes |
405 | %defattr(644,root,root,755) | |
8ccbe0a8 ER |
406 | %{_appdir}/themes/[!e]* |
407 | %{_appdir}/themes/engines/* | |
01c85086 ER |
408 | %{_appdir}/htdocs/themes/* |
409 | ||
8c193c52 ER |
410 | %files xmlrpc |
411 | %defattr(644,root,root,755) | |
412 | %{_appdir}/htdocs/xmlrpc.php |