]> git.pld-linux.org Git - packages/drupal.git/blobdiff - drupal.spec
- Up to 6.20, NT
[packages/drupal.git] / drupal.spec
index 669632e5c4c40298954245a2e0324a5c899376b1..b46f3bd2581cd32b6d698066539b7279568be388 100644 (file)
@@ -1,45 +1,35 @@
-%define                _ver            4.6
-%define                _patchlevel     11
 Summary:       Open source content management platform
 Summary(pl.UTF-8):     Platforma do zarządzania treścią o otwartych źródłach
 Name:          drupal
-Version:       %{_ver}.%{_patchlevel}
-Release:       2
+Version:       6.20
+Release:       0.1
 License:       GPL
 Group:         Applications/WWW
-Source0:       http://drupal.org/files/projects/%{name}-%{version}.tar.gz
-# Source0-md5: cfa5777fb6a612addcee75dad132909e
+Source0:       http://ftp.drupal.org/files/projects/%{name}-%{version}.tar.gz
+# Source0-md5: a4f59401fbb3e20e3a03ac5fc11bd27c
 Source1:       %{name}.conf
 Source2:       %{name}.cron
 Source3:       %{name}.PLD
-Patch0:                %{name}-replication.patch
+Patch0:                %{name}-cron.patch
 Patch1:                %{name}-sitesdir.patch
 Patch2:                %{name}-topdir.patch
-Patch3:                %{name}-themedir2.patch
-Patch4:                %{name}-emptypass.patch
-Patch5:                %{name}-cron.patch
-Patch6:                %{name}-19298-cache.patch
-Patch7:                %{name}-update-cli.patch
-Patch8:                %{name}-locale-memory.patch
-Patch9:                %{name}-comment.patch
-URL:           http://drupal.org/
+#Patchx:       %{name}-replication.patch
+#Patchx:       %{name}-emptypass.patch
+URL:           http://www.drupal.org/
 BuildRequires: rpmbuild(macros) >= 1.264
 BuildRequires: sed >= 4.0
 Requires:      %{name}(DB_Driver) = %{version}-%{release}
-Requires:      %{name}(theme) = %{_ver}
-Requires:      /usr/bin/php
 Requires:      apache(mod_access)
 Requires:      apache(mod_alias)
 Requires:      apache(mod_dir)
 Requires:      apache(mod_expires)
 Requires:      apache(mod_rewrite)
-Requires:      php(mysql)
+Requires:      php(mbstring)
 Requires:      php(pcre)
 Requires:      php(xml)
 Requires:      webapps
 Requires:      webserver = apache
 Requires:      webserver(php) >= 4.3.3
-Obsoletes:     drupal-update
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -100,6 +90,7 @@ Summary(pl.UTF-8):   Usługa cron dla Drupala
 Group:         Applications/WWW
 Requires:      %{name} = %{version}-%{release}
 Requires:      crondaemon
+Requires:      php-cli >= 3:4.3.3
 
 %description cron
 This package contains script which invokes cron hooks for Drupal.
@@ -141,18 +132,13 @@ UWAGA: Ten sterownik nie był testowany w PLD i nie wszystkie moduły
 mają schematy bazy danych dla PostgreSQL-a. Można go używać na własne
 ryzyko.
 
-%package themes
-Summary:       Themes distributed with Drupal
-Summary(pl.UTF-8):     Motywy rozprowadzane z Drupalem
+%package update
+Summary:       Package to perform Drupal database updates
 Group:         Applications/WWW
 Requires:      %{name} = %{version}-%{release}
-Provides:      drupal(theme) = %{_ver}
-
-%description themes
-This package contains themes distributed with Drupal.
 
-%description themes -l pl.UTF-8
-Ten pakiet zawiera motywy rozprowadzane z Drupalem.
+%description update
+This package contains scripts needed to do database updates via web.
 
 %package xmlrpc
 Summary:       XMLRPC server for Drupal
@@ -171,57 +157,45 @@ danymi uwierzytelniającymi użytkownika danego Drupala - jest to
 nazywane rozproszonym uwierzytelnianiem.
 
 %prep
-%setup -q
+%setup -q %{?_rc:-n %{name}-%{version}-%{_rc}}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p0
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
 
+# cleanup backups after patching
+find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 cp -p %{SOURCE3} README.PLD
 
-# remove backups from patching as we use globs to package files to buildroot
-find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
-
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,/var/{cache,lib}/%{name}} \
-       $RPM_BUILD_ROOT%{_appdir}/{po,database,modules/po,htdocs/modules}
+       $RPM_BUILD_ROOT%{_appdir}/{po,database,modules/po,htdocs/modules,themes}
 
-cp -a *.ico index.php $RPM_BUILD_ROOT%{_appdir}/htdocs
+cp -a index.php $RPM_BUILD_ROOT%{_appdir}/htdocs
 cp -a misc $RPM_BUILD_ROOT%{_appdir}/htdocs
-cp -a xmlrpc.php $RPM_BUILD_ROOT%{_appdir}/htdocs
-cp -a database/updates.inc $RPM_BUILD_ROOT%{_appdir}/database
+cp -a install.php update.php xmlrpc.php $RPM_BUILD_ROOT%{_appdir}/htdocs
 
-cp -a update.php $RPM_BUILD_ROOT%{_appdir}
-install cron.php $RPM_BUILD_ROOT%{_appdir}
-cp -a modules/* $RPM_BUILD_ROOT%{_appdir}/modules
+cp -a cron.php $RPM_BUILD_ROOT%{_appdir}
 cp -a includes scripts $RPM_BUILD_ROOT%{_appdir}
 cp -a sites $RPM_BUILD_ROOT%{_sysconfdir}
+cp -a modules/* $RPM_BUILD_ROOT%{_appdir}/modules
+cp -a themes/* $RPM_BUILD_ROOT%{_appdir}/themes
+cp -Rl $RPM_BUILD_ROOT%{_appdir}/modules $RPM_BUILD_ROOT%{_appdir}/htdocs
+cp -Rl $RPM_BUILD_ROOT%{_appdir}/themes $RPM_BUILD_ROOT%{_appdir}/htdocs
+
+find $RPM_BUILD_ROOT%{_appdir}/htdocs/themes/ $RPM_BUILD_ROOT%{_appdir}/htdocs/modules/ \
+  -type f -regextype posix-awk \
+  -regex '.*\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|php|xtmpl)$|.*/(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$' \
+  -print0 | xargs -0 -r -l512 rm -f
+find $RPM_BUILD_ROOT%{_appdir}/themes/ $RPM_BUILD_ROOT%{_appdir}/modules/ \
+  -type f -regextype posix-awk \
+  ! -regex '.*\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|php|xtmpl)$|.*/(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$' \
+  -print0 | xargs -0 -r -l512 rm -f
+
+# avoid pulling perl dep
+chmod -x $RPM_BUILD_ROOT%{_appdir}/scripts/*
 
 ln -s /var/lib/%{name} $RPM_BUILD_ROOT%{_appdir}/files
-# needed for node.module for syndication icon
-ln -s htdocs/misc $RPM_BUILD_ROOT%{_appdir}
-
-# install themes
-cp -a themes $RPM_BUILD_ROOT%{_appdir}/htdocs
-# move .xtmpl/.theme out of htdocs
-(cd $RPM_BUILD_ROOT%{_appdir}/htdocs && tar cf - --remove-files themes/*/*.{xtmpl,theme}) | tar -xf - -C $RPM_BUILD_ROOT%{_appdir}
-mv $RPM_BUILD_ROOT%{_appdir}/{htdocs/,}themes/engines
-# make screenshot.png available in appdir
-for a in $RPM_BUILD_ROOT%{_appdir}/htdocs/themes/*; do
-       t=$(basename $a)
-       ln -s ../../htdocs/themes/$t/screenshot.png $RPM_BUILD_ROOT%{_appdir}/themes/$t
-done
-
-# a hack
-s=themes/chameleon/marvin
-ln -s ../../htdocs/$s $RPM_BUILD_ROOT%{_appdir}/$s
 
 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
@@ -231,19 +205,22 @@ install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
 rm -rf $RPM_BUILD_ROOT
 
 %post
-# Perform database updates
-echo 'Performing Drupal database updates'
-cd %{_appdir} && %{_bindir}/php update.php Update
-echo 'Done'
+if [ "$1" = 1 ]; then
+%banner -e %{name} <<'EOF'
+If this is your first install of Drupal, You need at least configure
+$db_url and $base_url in %{_sysconfdir}/sites/default/settings.php
+
+EOF
+fi
 
 %post db-mysql
 if [ "$1" = 1 ]; then
-%banner -e %{name}-db-mysql <<EOF
+%banner -e %{name}-db-mysql <<'EOF'
 If this is your first install of Drupal, you need to create Drupal database:
 
 mysqladmin create drupal
 zcat %{_docdir}/%{name}-db-mysql-%{version}/database.mysql.gz | mysql drupal
-mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'PASSWORD'"
+mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'password'"
 mysql -e "GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO 'drupal'@'localhost'"
 
 EOF
@@ -251,7 +228,7 @@ fi
 
 %post db-pgsql
 if [ "$1" = 1 ]; then
-%banner -e %{name}-db-pgsql <<EOF
+%banner -e %{name}-db-pgsql <<'EOF'
 If this is your first install of Drupal, you need to create Drupal database:
 
 and import initial schema from
@@ -272,82 +249,6 @@ fi
 %triggerun -- apache < 2.2.0, apache-base
 %webapp_unregister httpd %{_webapp}
 
-%triggerpostun -- %{name} < 4.6.4-0.4
-# rescue app configs.
-if [ -f /etc/drupal/sites/default/settings.php.rpmsave ]; then
-       mv -f %{_sysconfdir}/sites/default/settings.php{,.rpmnew}
-       mv -f /etc/drupal/sites/default/settings.php.rpmsave %{_sysconfdir}/sites/default/settings.php
-fi
-# other configured sites, if any
-for i in /etc/drupal/sites/*; do
-       d=$(basename $i)
-       [ "$d" = "default" ] && continue
-       mv -f %{_sysconfdir}/sites/$d{,.rpmnew}
-       mv -f $i %{_sysconfdir}/sites/$d
-done
-
-# migrate from apache-config macros
-if [ -f /etc/drupal/apache.conf.rpmsave ]; then
-       if [ -d /etc/apache/webapps.d ]; then
-               cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
-               cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/apache.conf
-       fi
-
-       if [ -d /etc/httpd/webapps.d ]; then
-               cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
-               cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
-       fi
-       rm -f /etc/drupal/apache.conf.rpmsave
-fi
-
-# place new config location, as trigger puts config only on first install, do it here.
-if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
-       rm -f /etc/apache/conf.d/99_%{name}.conf
-       /usr/sbin/webapp register apache %{_webapp}
-       apache_reload=1
-fi
-if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
-       rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       /usr/sbin/webapp register httpd %{_webapp}
-       httpd_reload=1
-fi
-
-if [ "$httpd_reload" ]; then
-       %service -q httpd reload
-fi
-if [ "$apache_reload" ]; then
-       %service -q apache reload
-fi
-
-%triggerpostun -- %{name} < 4.6.8-0.5
-grep -l 'This_is_a_Drupal_security_line_do_not_remove' \
-%{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
-| xargs -r \
-sed -i -e '
-/This_is_a_Drupal_security_line_do_not_remove/{
-       d
-       n
-       a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
-       a\      Options None
-       a\      <IfModule mod_rewrite.c>
-       a\      \       RewriteEngine off
-       a\      </IfModule>
-}'
-egrep -c 'Drupal_Security_Do_Not_Remove_See_SA_2006_006' \
-%{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
-| awk -F: '/:0/{print $1}' | xargs -r \
-sed -i -e '
-/<Directory \/var\/lib\/drupal>/{
-       n
-       a\      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
-       a\      Options None
-       a\      <IfModule mod_rewrite.c>
-       a\      \       RewriteEngine off
-       a\      </IfModule>
-}'
-[ ! -L /etc/httpd/webapps.d/drupal.conf ] || %service -q httpd reload
-[ ! -L /etc/apache/webapps.d/drupal.conf ] || %service -q apache reload
-
 %files
 %defattr(644,root,root,755)
 %doc *.txt README.PLD
@@ -359,27 +260,23 @@ sed -i -e '
 %attr(750,root,http) %dir %{_sysconfdir}/sites
 %attr(750,root,http) %dir %{_sysconfdir}/sites/default
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/default/*
+%attr(750,root,http) %dir %{_sysconfdir}/sites/all
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/all/*
 
 %dir %{_appdir}
-%{_appdir}/database
 %{_appdir}/includes
-%exclude %{_appdir}/includes/database.mysql.inc
-%exclude %{_appdir}/includes/database.pgsql.inc
 %{_appdir}/modules
 %{_appdir}/scripts
-%dir %{_appdir}/themes
-%dir %{_appdir}/themes/engines
+%{_appdir}/themes
 %{_appdir}/po
-%{_appdir}/update.php
-# symlinks
+# symlink
 %{_appdir}/files
-%{_appdir}/misc
 
 %dir %{_appdir}/htdocs
-%{_appdir}/htdocs/*.ico
 %{_appdir}/htdocs/index.php
+%{_appdir}/htdocs/install.php
 %{_appdir}/htdocs/misc
-%dir %{_appdir}/htdocs/themes
+%{_appdir}/htdocs/themes
 %{_appdir}/htdocs/modules
 
 %dir %attr(775,root,http) /var/lib/%{name}
@@ -388,24 +285,19 @@ sed -i -e '
 %files cron
 %defattr(644,root,root,755)
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
-%attr(755,root,root) %{_appdir}/cron.php
+%attr(775,root,root) %{_appdir}/cron.php
 
 %files db-mysql
 %defattr(644,root,root,755)
-%doc database/*.mysql
-%doc README.replication
-%{_appdir}/includes/database.mysql.inc
+#%doc README.replication
 
 %files db-pgsql
 %defattr(644,root,root,755)
-%doc database/*.pgsql
-%{_appdir}/includes/database.pgsql.inc
 
-%files themes
+%files update
 %defattr(644,root,root,755)
-%{_appdir}/themes/[!e]*
-%{_appdir}/themes/engines/*
-%{_appdir}/htdocs/themes/*
+%{_appdir}/htdocs/update.php
+%{_appdir}/database
 
 %files xmlrpc
 %defattr(644,root,root,755)
This page took 0.067936 seconds and 4 git commands to generate.