2 # - separate internal files (classes, libraries) and public files (.js, .css, index.php) to htdocs and above and point docroot to htdocs dir
3 Summary: phpPgAdmin - web-based PostgreSQL administration
4 Summary(pl): phpPgAdmin - administracja bazami PostgreSQL przez WWW
9 Group: Applications/Databases/Interfaces
10 Source0: http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
11 # Source0-md5: 7e0c18a01538572d3c2b435725e68fe2
12 Source1: %{name}-apache.conf
13 Patch0: %{name}-config.patch
14 #Patch1: %{name}-adodb.patch
15 URL: http://phppgadmin.sourceforge.net/
16 BuildRequires: rpmbuild(macros) >= 1.268
17 Requires(triggerpostun): sed >= 4.0
18 #Requires: adodb >= 4.67-1.17
19 Requires: php >= 3:4.1
21 Requires: php-pgsql >= 3:4.1
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _appdir %{_datadir}/%{name}
27 %define _webapps /etc/webapps
28 %define _webapp %{name}
29 %define _sysconfdir %{_webapps}/%{_webapp}
32 phpPgAdmin is a fully functional web-based administration utility for
33 a PostgreSQL database server. It handles all the basic functionality
34 as well as some advanced features such as triggers, views and
35 functions (stored procs).
38 phpPgAdmin jest w pe³ni funkcjonalnym, bazowanym na WWW, narzêdziem
39 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
40 podstawowe mo¿liwo¶ci, jak i czê¶æ bardziej zaawansowanych jak
41 prze³±czniki, widoki i funkcje (procedury sk³adowane).
47 rm -f conf/config.inc.php-dist
49 # remove language source files (or one wants to make -devel subpackage?)
50 mv -f lang/translations.php .
52 rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
53 mv -f translations.php lang/translations.php
54 rm -f lang/recoded/README
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
60 cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
61 cp -a classes help images lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
62 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
64 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
65 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
66 #install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
68 %triggerin -- apache1 < 1.3.37-3, apache1-base
69 %webapp_register apache %{_webapp}
71 %triggerun -- apache1 < 1.3.37-3, apache1-base
72 %webapp_unregister apache %{_webapp}
74 %triggerin -- apache < 2.2.0, apache-base
75 %webapp_register httpd %{_webapp}
77 %triggerun -- apache < 2.2.0, apache-base
78 %webapp_unregister httpd %{_webapp}
80 #%%triggerin -- lighttpd
81 #%%webapp_register lighttpd %{_webapp}
83 #%%triggerun -- lighttpd
84 #%%webapp_unregister lighttpd %{_webapp}
86 %triggerpostun -- %{name} < 4.0.1-1.2
88 if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
89 mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
90 mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
93 # nuke very-old config location (this mostly for Ra)
94 if [ -f /etc/httpd/httpd.conf ]; then
95 sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
99 # migrate from httpd (apache2) config dir
100 if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
101 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
102 mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
106 # migrate from apache-config macros
107 if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
108 if [ -d /etc/apache/webapps.d ]; then
109 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
110 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
113 if [ -d /etc/httpd/webapps.d ]; then
114 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
115 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
117 rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
120 # place new config location, as trigger puts config only on first install, do it here.
122 if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
123 rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
124 /usr/sbin/webapp register apache %{_webapp}
128 if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
129 rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
130 /usr/sbin/webapp register httpd %{_webapp}
134 if [ "$httpd_reload" ]; then
135 %service httpd reload
137 if [ "$apache_reload" ]; then
138 %service apache reload
142 rm -rf $RPM_BUILD_ROOT
145 %defattr(644,root,root,755)
146 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
148 %dir %attr(750,root,http) %{_sysconfdir}
149 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
150 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
151 #%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
152 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php