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