SPECS: phpPgAdmin.spec - use webapps framework - cleanups and make...

glen glen at pld-linux.org
Fri Dec 2 16:38:58 CET 2005


Author: glen                         Date: Fri Dec  2 15:38:58 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use webapps framework
- cleanups and make things better

---- Files affected:
SPECS:
   phpPgAdmin.spec (1.51 -> 1.52) 

---- Diffs:

================================================================
Index: SPECS/phpPgAdmin.spec
diff -u SPECS/phpPgAdmin.spec:1.51 SPECS/phpPgAdmin.spec:1.52
--- SPECS/phpPgAdmin.spec:1.51	Mon Nov 28 19:53:26 2005
+++ SPECS/phpPgAdmin.spec	Fri Dec  2 16:38:53 2005
@@ -1,9 +1,12 @@
 # $Revision$, $Date$
+# TODO
+# - use system adodb
+# - separate internal files (classes, libraries) and public files (.js, .css, index.php) to htdocs and above and point docroot to htdocs dir
 Summary:	phpPgAdmin - web-based PostgreSQL administration
 Summary(pl):	phpPgAdmin - administracja bazami PostgreSQL przez WWW
 Name:		phpPgAdmin
 Version:	4.0.1
-Release:	1
+Release:	1.6
 License:	GPL v2+
 Group:		Applications/Databases/Interfaces
 Source0:	http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
@@ -11,16 +14,17 @@
 URL:		http://phppgadmin.sourceforge.net/
 BuildRequires:	rpmbuild(macros) >= 1.226
 Requires(triggerpostun):	sed >= 4.0
-Requires:	php >= 4.1
+Requires:	php >= 3:4.1
 Requires:	php-pcre
-Requires:	php-pgsql >= 4.1
-Requires:	webserver
+Requires:	php-pgsql >= 3:4.1
+Requires:	webapps
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_noautoreq	/usr/bin/awk /bin/bash /usr/bin/php
 %define		_appdir		%{_datadir}/%{name}
-%define		_sysconfdir	/etc/%{name}
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
 
 %description
 phpPgAdmin is a fully functional web-based administration utility for
@@ -36,69 +40,109 @@
 
 %prep
 %setup -q
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},%{_config_http}}
+rm -f conf/config.inc.php-dist
 
 %{__sed} -i 's|error_reporting(E_ALL);|error_reporting(E_ALL \& ~E_NOTICE);|' libraries/lib.inc.php
 
-cp -R * $RPM_BUILD_ROOT%{_appdir}
-mv -f $RPM_BUILD_ROOT%{_appdir}/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
-rm -fr $RPM_BUILD_ROOT%{_appdir}/conf
-ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/conf
-
-cat >> $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf <<EOF
-# This is sample apache config
+cat > apache.conf <<EOF
 Alias /pgadmin /usr/share/phpPgAdmin
 EOF
 
-%triggerin -- apache1 >= 1.3.33-2
-%apache_config_install -v 1 -c %{_sysconfdir}/apache-%{name}.conf
+# remove language source files (or one wants to make -devel subpackage?)
+mv -f lang/translations.php .
+rm -f lang/*.php
+rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
+mv -f translations.php lang/translations.php
+rm -f lang/recoded/README
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
+
+cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
+cp -a classes help images lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
+cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
 
-%triggerun -- apache1 >= 1.3.33-2
-%apache_config_uninstall -v 1
+install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+#install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
 
 %triggerin -- apache >= 2.0.0
-%apache_config_install -v 2 -c %{_sysconfdir}/apache-%{name}.conf
+%webapp_register httpd %{_webapp}
 
 %triggerun -- apache >= 2.0.0
-%apache_config_uninstall -v 2
+%webapp_unregister httpd %{_webapp}
 
-%triggerpostun -- %{name} < 1.3.9-1.4
-# migrate from old config location (only apache2, as there was no apache1 support)
-if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
-	cp -f %{_sysconfdir}/apache-%{name}.conf{,.rpmnew}
-	mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/apache-%{name}.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd reload 1>&2
-	fi
+#%triggerin -- lighttpd
+#%webapp_register lighttpd %{_webapp}
+#
+#%triggerun -- lighttpd
+#%webapp_unregister lighttpd %{_webapp}
+
+%triggerpostun -- %{name} < 4.0.1-1.2
+# rescue app config
+if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
+	mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
+	mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
 fi
 
 # nuke very-old config location (this mostly for Ra)
-if [ ! -d /etc/httpd/httpd.conf ]; then
-	sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd reload 1>&2
+if [ -f /etc/httpd/httpd.conf ]; then
+	sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
+	httpd_reload=1
+fi
+
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
+	cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+	mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
+	httpd_reload=1
+fi
+
+# migrate from apache-config macros
+if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
+	if [ -d /etc/apache/webapps.d ]; then
+		cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
+		cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
+	fi
+
+	if [ -d /etc/httpd/webapps.d ]; then
+		cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+		cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
 	fi
+	rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
 fi
 
 # place new config location, as trigger puts config only on first install, do it here.
 # apache1
-if [ -d /etc/apache/conf.d ]; then
-	ln -sf %{_sysconfdir}/apache-%{name}.conf /etc/apache/conf.d/99_%{name}.conf
-	if [ -f /var/lock/subsys/apache ]; then
-		/etc/rc.d/init.d/apache reload 1>&2
-	fi
+if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
+	rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
+	/usr/sbin/webapp register apache %{_webapp}
+	apache_reload=1
 fi
 # apache2
-if [ -d /etc/httpd/httpd.conf ]; then
-	ln -sf %{_sysconfdir}/apache-%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
+	rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.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
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -106,8 +150,13 @@
 %files
 %defattr(644,root,root,755)
 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
-%dir %{_sysconfdir} 
-%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*
+%doc sql
+%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(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
+
 %{_appdir}
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -116,6 +165,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.52  2005/12/02 15:38:53  glen
+- use webapps framework
+- cleanups and make things better
+
 Revision 1.51  2005/11/28 18:53:26  twittner
 - up to 4.0.1 (bugfix release)
 
@@ -124,7 +177,7 @@
 
 Revision 1.49  2005/11/16 19:39:21  twittner
 - up to 4.0
-- simplified %%install
+- simplified %install
 - C&P triggers' scripts from template-apache.spec
 
 Revision 1.48  2005/10/18 15:49:37  qboosh
@@ -177,7 +230,7 @@
 - updated to 3.4
 
 Revision 1.32  2004/05/13 17:56:40  ankry
-- %%SOURCE# fixes
+- %SOURCE# fixes
 
 Revision 1.31  2004/03/14 11:57:52  ciesiel
 - upgraded to version 3.3.1
@@ -263,7 +316,7 @@
 - update to 2.4 (SECURITY fixes)
 
 Revision 1.5  2002/01/18 02:14:36  kloczek
-perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
+- perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
 
 Revision 1.4  2001/12/07 09:08:19  kloczek
 - release 2.
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/phpPgAdmin.spec?r1=1.51&r2=1.52&f=u




More information about the pld-cvs-commit mailing list