2 # - separate internal files (classes, libraries) and public files (.js, .css,
3 # index.php) to htdocs and above and point docroot to htdocs dir
4 Summary: phpPgAdmin - web-based PostgreSQL administration
5 Summary(pl.UTF-8): phpPgAdmin - administracja bazami PostgreSQL przez WWW
10 Group: Applications/Databases/Interfaces
11 Source0: http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
12 # Source0-md5: 7e0c18a01538572d3c2b435725e68fe2
13 Source1: %{name}-apache.conf
14 Patch0: %{name}-config.patch
15 #Patch1: %{name}-adodb.patch
16 URL: http://phppgadmin.sourceforge.net/
17 BuildRequires: rpmbuild(macros) >= 1.268
18 Requires(triggerpostun): sed >= 4.0
19 #Requires: adodb >= 4.67-1.17
23 Requires: webserver(php) >= 4.1
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _appdir %{_datadir}/%{name}
28 %define _webapps /etc/webapps
29 %define _webapp %{name}
30 %define _sysconfdir %{_webapps}/%{_webapp}
33 phpPgAdmin is a fully functional web-based administration utility for
34 a PostgreSQL database server. It handles all the basic functionality
35 as well as some advanced features such as triggers, views and
36 functions (stored procs).
38 %description -l pl.UTF-8
39 phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
40 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
41 podstawowe możliwości, jak i część bardziej zaawansowanych jak
42 przełączniki, widoki i funkcje (procedury składowane).
48 rm -f conf/config.inc.php-dist
50 # remove language source files (or one wants to make -devel subpackage?)
51 mv -f lang/translations.php .
53 rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
54 mv -f translations.php lang/translations.php
55 rm -f lang/recoded/README
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
61 cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
62 cp -a classes help images lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
63 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
65 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
66 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
67 #install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
69 %triggerin -- apache1 < 1.3.37-3, apache1-base
70 %webapp_register apache %{_webapp}
72 %triggerun -- apache1 < 1.3.37-3, apache1-base
73 %webapp_unregister apache %{_webapp}
75 %triggerin -- apache < 2.2.0, apache-base
76 %webapp_register httpd %{_webapp}
78 %triggerun -- apache < 2.2.0, apache-base
79 %webapp_unregister httpd %{_webapp}
81 #%%triggerin -- lighttpd
82 #%%webapp_register lighttpd %{_webapp}
84 #%%triggerun -- lighttpd
85 #%%webapp_unregister lighttpd %{_webapp}
87 %triggerpostun -- %{name} < 4.0.1-1.2
89 if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
90 mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
91 mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
94 # nuke very-old config location (this mostly for Ra)
95 if [ -f /etc/httpd/httpd.conf ]; then
96 sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
100 # migrate from httpd (apache2) config dir
101 if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
102 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
103 mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
107 # migrate from apache-config macros
108 if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
109 if [ -d /etc/apache/webapps.d ]; then
110 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
111 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
114 if [ -d /etc/httpd/webapps.d ]; then
115 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
116 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
118 rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
121 # place new config location, as trigger puts config only on first install, do it here.
123 if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
124 rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
125 /usr/sbin/webapp register apache %{_webapp}
129 if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
130 rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
131 /usr/sbin/webapp register httpd %{_webapp}
135 if [ "$httpd_reload" ]; then
136 %service httpd reload
138 if [ "$apache_reload" ]; then
139 %service apache reload
143 rm -rf $RPM_BUILD_ROOT
146 %defattr(644,root,root,755)
147 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
149 %dir %attr(750,root,http) %{_sysconfdir}
150 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
151 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
152 #%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
153 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php