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: 6a9810a187e52cc42de6e2d18d71ec81
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 Patch0: %{name}-config.patch
18 #Patch1: %{name}-adodb.patch
19 Patch2: %{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
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define _appdir %{_datadir}/%{name}
33 %define _webapps /etc/webapps
34 %define _webapp %{name}
35 %define _sysconfdir %{_webapps}/%{_webapp}
38 phpPgAdmin is a fully functional web-based administration utility for
39 a PostgreSQL database server. It handles all the basic functionality
40 as well as some advanced features such as triggers, views and
41 functions (stored procedures).
43 %description -l pl.UTF-8
44 phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
45 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
46 podstawowe możliwości, jak i część bardziej zaawansowanych jak
47 przełączniki, widoki i funkcje (procedury składowane).
54 mv conf/config.inc.php{-dist,}
55 find . -name \*.orig -exec rm -f \{\} \;
57 # remove language source files (or one wants to make -devel subpackage?)
58 mv -f lang/translations.php .
60 rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
61 mv -f translations.php lang/translations.php
62 rm -f lang/recoded/README
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
68 cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
69 cp -a classes help images js lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
70 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
72 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
73 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
74 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
76 %triggerin -- apache1 < 1.3.37-3, apache1-base
77 %webapp_register apache %{_webapp}
79 %triggerun -- apache1 < 1.3.37-3, apache1-base
80 %webapp_unregister apache %{_webapp}
82 %triggerin -- apache < 2.2.0, apache-base
83 %webapp_register httpd %{_webapp}
85 %triggerun -- apache < 2.2.0, apache-base
86 %webapp_unregister httpd %{_webapp}
88 %triggerin -- lighttpd
89 %webapp_register lighttpd %{_webapp}
91 %triggerun -- lighttpd
92 %webapp_unregister lighttpd %{_webapp}
94 %triggerpostun -- %{name} < 4.0.1-1.2
96 if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
97 mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
98 mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
101 # nuke very-old config location (this mostly for Ra)
102 if [ -f /etc/httpd/httpd.conf ]; then
103 sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
107 # change config version number for 4.1.2
108 if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then
109 echo "Adjusting configuration for phpPgAdmin 4.1.2"
110 sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php
113 # migrate from httpd (apache2) config dir
114 if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
115 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
116 mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
120 # migrate from apache-config macros
121 if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
122 if [ -d /etc/apache/webapps.d ]; then
123 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
124 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
127 if [ -d /etc/httpd/webapps.d ]; then
128 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
129 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
131 rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
134 # place new config location, as trigger puts config only on first install, do it here.
136 if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
137 rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
138 /usr/sbin/webapp register apache %{_webapp}
142 if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
143 rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
144 /usr/sbin/webapp register httpd %{_webapp}
148 if [ "$httpd_reload" ]; then
149 %service httpd reload
151 if [ "$apache_reload" ]; then
152 %service apache reload
156 rm -rf $RPM_BUILD_ROOT
159 %defattr(644,root,root,755)
160 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
162 %dir %attr(750,root,http) %{_sysconfdir}
163 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
164 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
165 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
166 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php