SPECS: drupal.spec - use webapps framework

glen glen at pld-linux.org
Mon Dec 5 12:43:12 CET 2005


Author: glen                         Date: Mon Dec  5 11:43:12 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use webapps framework

---- Files affected:
SPECS:
   drupal.spec (1.39 -> 1.40) 

---- Diffs:

================================================================
Index: SPECS/drupal.spec
diff -u SPECS/drupal.spec:1.39 SPECS/drupal.spec:1.40
--- SPECS/drupal.spec:1.39	Thu Dec  1 00:06:56 2005
+++ SPECS/drupal.spec	Mon Dec  5 12:43:07 2005
@@ -3,7 +3,7 @@
 Summary(pl):	Platforma do zarządzania treścią o otwartych źródłach
 Name:		drupal
 Version:	4.6.4
-Release:	0.1
+Release:	0.5
 License:	GPL
 Group:		Applications/WWW
 Source0:	http://drupal.org/files/projects/%{name}-%{version}.tar.gz
@@ -18,8 +18,9 @@
 Patch4:		%{name}-emptypass.patch
 Patch5:		%{name}-cron.patch
 URL:		http://drupal.org/
-BuildRequires:	rpmbuild(macros) >= 1.194
+BuildRequires:	rpmbuild(macros) >= 1.264
 BuildRequires:	sed >= 4.0
+Requires:	webapps
 Requires:	webserver = apache
 Requires:	apache(mod_dir)
 Requires:	apache(mod_access)
@@ -31,12 +32,13 @@
 Requires:	php-pcre
 Requires:	%{name}(DB_Driver) = %{version}-%{release}
 Requires:	php-xml
-Conflicts:	apache1 < 1.3.33-3
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_appdir		%{_datadir}/%{name}
-%define		_sysconfdir	/etc/%{name}
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
 
 %description
 Drupal is software that allows an individual or a community of users
@@ -195,6 +197,7 @@
 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
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
 
 %clean
@@ -224,25 +227,77 @@
 EOF
 fi
 
-%triggerin -- apache1 >= 1.3.33-2
-%apache_config_install -v 1 -c %{_sysconfdir}/apache.conf
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
 
-%triggerun -- apache1 >= 1.3.33-2
-%apache_config_uninstall -v 1
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
 
 %triggerin -- apache >= 2.0.0
-%apache_config_install -v 2 -c %{_sysconfdir}/apache.conf
+%webapp_register httpd %{_webapp}
 
 %triggerun -- apache >= 2.0.0
-%apache_config_uninstall -v 2
+%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
+	if [ -f /var/lock/subsys/httpd ]; then
+		/etc/rc.d/init.d/httpd reload 1>&2
+	fi
+fi
+if [ "$apache_reload" ]; then
+	if [ -f /var/lock/subsys/apache ]; then
+		/etc/rc.d/init.d/apache reload 1>&2
+	fi
+fi
 
 %files
 %defattr(644,root,root,755)
 %doc *.txt README.PLD
 %doc database/updates.inc
 
-%attr(750,root,http) %dir %{_sysconfdir}
+%dir %attr(750,root,http) %{_sysconfdir}
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
 
 %attr(750,root,http) %dir %{_sysconfdir}/sites
 %attr(750,root,http) %dir %{_sysconfdir}/sites/default
@@ -291,6 +346,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.40  2005/12/05 11:43:07  glen
+- use webapps framework
+
 Revision 1.39  2005/11/30 23:06:56  glen
 - 4.6.4 (xss fixes)
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/drupal.spec?r1=1.39&r2=1.40&f=u




More information about the pld-cvs-commit mailing list