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://downloads.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
12 # Source0-md5: ad8f05cef0c443d9ce2940bf36319c24
13 Source1: %{name}-apache.conf
14 Source2: %{name}-lighttpd.conf
15 Source3: http://www.quarto.pl/~gotar/%{name}-jscalendar.tar.bz2
16 # Source3-md5: 84115f772a723cc742352c589df9af29
17 Source4: %{name}-httpd.conf
18 Patch0: %{name}-config.patch
19 Patch1: %{name}-calendar.patch
20 URL: http://phppgadmin.sourceforge.net/
21 BuildRequires: rpmbuild(macros) >= 1.268
22 Requires(triggerpostun): sed >= 4.0
23 #Requires: adodb >= 4.67-1.17
26 Requires: php(session)
28 Requires: webserver(php) >= 5.0
29 Conflicts: apache-base < 2.4.0-1
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _appdir %{_datadir}/%{name}
34 %define _webapps /etc/webapps
35 %define _webapp %{name}
36 %define _sysconfdir %{_webapps}/%{_webapp}
39 phpPgAdmin is a fully functional web-based administration utility for
40 a PostgreSQL database server. It handles all the basic functionality
41 as well as some advanced features such as triggers, views and
42 functions (stored procedures).
44 %description -l pl.UTF-8
45 phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
46 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
47 podstawowe możliwości, jak i część bardziej zaawansowanych jak
48 przełączniki, widoki i funkcje (procedury składowane).
54 mv conf/config.inc.php{-dist,}
55 find . -name \*.orig -exec rm -f \{\} \;
57 # remove scripts used by translators
58 rm -f lang/{langcheck,synch}
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
64 cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
65 cp -a classes help images js lang libraries plugins themes xloadtree $RPM_BUILD_ROOT%{_appdir}
66 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
68 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
69 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
70 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
72 %triggerin -- apache1 < 1.3.37-3, apache1-base
73 %webapp_register apache %{_webapp}
75 %triggerun -- apache1 < 1.3.37-3, apache1-base
76 %webapp_unregister apache %{_webapp}
78 %triggerin -- apache-base
79 %webapp_register httpd %{_webapp}
81 %triggerun -- apache-base
82 %webapp_unregister httpd %{_webapp}
84 %triggerin -- lighttpd
85 %webapp_register lighttpd %{_webapp}
87 %triggerun -- lighttpd
88 %webapp_unregister lighttpd %{_webapp}
90 %triggerpostun -- %{name} < 4.0.1-1.2
92 if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
93 mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
94 mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
97 # nuke very-old config location (this mostly for Ra)
98 if [ -f /etc/httpd/httpd.conf ]; then
99 sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
103 # change config version number for 4.1.2
104 if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then
105 echo "Adjusting configuration for phpPgAdmin 4.1.2"
106 sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php
109 # migrate from httpd (apache2) config dir
110 if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
111 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
112 mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
116 # migrate from apache-config macros
117 if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
118 if [ -d /etc/apache/webapps.d ]; then
119 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
120 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
123 if [ -d /etc/httpd/webapps.d ]; then
124 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
125 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
127 rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
130 # place new config location, as trigger puts config only on first install, do it here.
132 if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
133 rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
134 /usr/sbin/webapp register apache %{_webapp}
138 if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
139 rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
140 /usr/sbin/webapp register httpd %{_webapp}
144 if [ "$httpd_reload" ]; then
145 %service httpd reload
147 if [ "$apache_reload" ]; then
148 %service apache reload
152 rm -rf $RPM_BUILD_ROOT
155 %defattr(644,root,root,755)
156 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
157 %doc plugins/Report/sql
158 %dir %attr(750,root,http) %{_sysconfdir}
159 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
160 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
161 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
162 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php