]> git.pld-linux.org Git - packages/phpPgAdmin.git/blame - phpPgAdmin.spec
- updated to 5.1, not tested, release 0.1
[packages/phpPgAdmin.git] / phpPgAdmin.spec
CommitLineData
71f9b5c7 1# TODO
b782471a
ER
2# - separate internal files (classes, libraries) and public files (.js, .css,
3# index.php) to htdocs and above and point docroot to htdocs dir
dbc4c53d 4Summary: phpPgAdmin - web-based PostgreSQL administration
515becd9 5Summary(pl.UTF-8): phpPgAdmin - administracja bazami PostgreSQL przez WWW
43017019 6Name: phpPgAdmin
8a8a809b
MK
7Version: 5.1
8Release: 0.1
5a288fe8 9License: GPL v2+
43017019 10Group: Applications/Databases/Interfaces
891a6f8b 11Source0: http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
8a8a809b 12# Source0-md5: ad8f05cef0c443d9ce2940bf36319c24
fddd5411 13Source1: %{name}-apache.conf
d5488ac9 14Source2: %{name}-lighttpd.conf
bb46dcab
TP
15Source3: http://www.quarto.pl/~gotar/%{name}-jscalendar.tar.bz2
16# Source3-md5: 84115f772a723cc742352c589df9af29
3d2e03cc 17Source4: %{name}-httpd.conf
a7bd83cb 18Patch0: %{name}-config.patch
b782471a 19#Patch1: %{name}-adodb.patch
bb46dcab 20Patch2: %{name}-calendar.patch
d00682a3 21URL: http://phppgadmin.sourceforge.net/
5e3bbdfa 22BuildRequires: rpmbuild(macros) >= 1.268
bacecd01 23Requires(triggerpostun): sed >= 4.0
d373e486 24#Requires: adodb >= 4.67-1.17
b782471a
ER
25Requires: php(pcre)
26Requires: php(pgsql)
bd266d2e 27Requires: php(session)
71f9b5c7 28Requires: webapps
232a76d8 29Requires: webserver(php) >= 5.0
3d2e03cc 30Conflicts: apache-base < 2.4.0-1
b70f7f36 31BuildArch: noarch
dc9fec47 32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43017019 33
bacecd01 34%define _appdir %{_datadir}/%{name}
71f9b5c7
ER
35%define _webapps /etc/webapps
36%define _webapp %{name}
37%define _sysconfdir %{_webapps}/%{_webapp}
43017019 38
39%description
dc9fec47
AM
40phpPgAdmin is a fully functional web-based administration utility for
41a PostgreSQL database server. It handles all the basic functionality
42as well as some advanced features such as triggers, views and
232a76d8 43functions (stored procedures).
43017019 44
e8fce4fa
JR
45%description -l pl.UTF-8
46phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
ac8df53c 47administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
e8fce4fa
JR
48podstawowe możliwości, jak i część bardziej zaawansowanych jak
49przełączniki, widoki i funkcje (procedury składowane).
43017019 50
51%prep
891a6f8b 52%setup -q -a3
a7bd83cb 53%patch0 -p1
d373e486 54#%patch1 -p1
bb46dcab 55%patch2 -p1
93776806 56mv conf/config.inc.php{-dist,}
0bb50a65 57find . -name \*.orig -exec rm -f \{\} \;
43017019 58
71f9b5c7
ER
59# remove language source files (or one wants to make -devel subpackage?)
60mv -f lang/translations.php .
61rm -f lang/*.php
62rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
63mv -f translations.php lang/translations.php
64rm -f lang/recoded/README
65
66%install
67rm -rf $RPM_BUILD_ROOT
68install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
69
70cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
0bb50a65 71cp -a classes help images js lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
71f9b5c7 72cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
43017019 73
fddd5411 74install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
3d2e03cc 75install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
d5488ac9 76install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
71f9b5c7 77
e54d2cd8 78%triggerin -- apache1 < 1.3.37-3, apache1-base
71f9b5c7
ER
79%webapp_register apache %{_webapp}
80
e54d2cd8 81%triggerun -- apache1 < 1.3.37-3, apache1-base
71f9b5c7 82%webapp_unregister apache %{_webapp}
bacecd01 83
3d2e03cc 84%triggerin -- apache-base
71f9b5c7 85%webapp_register httpd %{_webapp}
bacecd01 86
3d2e03cc 87%triggerun -- apache-base
71f9b5c7
ER
88%webapp_unregister httpd %{_webapp}
89
d5488ac9
90%triggerin -- lighttpd
91%webapp_register lighttpd %{_webapp}
92
93%triggerun -- lighttpd
94%webapp_unregister lighttpd %{_webapp}
71f9b5c7
ER
95
96%triggerpostun -- %{name} < 4.0.1-1.2
97# rescue app config
98if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
99 mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
100 mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
325539ef 101fi
bacecd01 102
103# nuke very-old config location (this mostly for Ra)
71f9b5c7
ER
104if [ -f /etc/httpd/httpd.conf ]; then
105 sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
106 httpd_reload=1
107fi
108
1b84c4f3 109# change config version number for 4.1.2
17d1adea 110if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then
111 echo "Adjusting configuration for phpPgAdmin 4.1.2"
1b84c4f3 112 sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php
17d1adea 113fi
114
71f9b5c7
ER
115# migrate from httpd (apache2) config dir
116if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
117 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
118 mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
119 httpd_reload=1
120fi
121
122# migrate from apache-config macros
123if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
124 if [ -d /etc/apache/webapps.d ]; then
125 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
126 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
bacecd01 127 fi
71f9b5c7
ER
128
129 if [ -d /etc/httpd/webapps.d ]; then
130 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
131 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
132 fi
133 rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
345abfde
TO
134fi
135
bacecd01 136# place new config location, as trigger puts config only on first install, do it here.
137# apache1
71f9b5c7
ER
138if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
139 rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
140 /usr/sbin/webapp register apache %{_webapp}
141 apache_reload=1
bacecd01 142fi
143# apache2
71f9b5c7
ER
144if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
145 rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
146 /usr/sbin/webapp register httpd %{_webapp}
147 httpd_reload=1
148fi
149
150if [ "$httpd_reload" ]; then
5e3bbdfa 151 %service httpd reload
345abfde 152fi
71f9b5c7 153if [ "$apache_reload" ]; then
5e3bbdfa 154 %service apache reload
71f9b5c7 155fi
345abfde 156
bacecd01 157%clean
158rm -rf $RPM_BUILD_ROOT
159
43017019 160%files
161%defattr(644,root,root,755)
c2e6245c 162%doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
8a8a809b 163%doc plugins/Report/sql
71f9b5c7
ER
164%dir %attr(750,root,http) %{_sysconfdir}
165%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
166%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
d5488ac9 167%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
71f9b5c7
ER
168%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
169
bacecd01 170%{_appdir}
This page took 0.115666 seconds and 4 git commands to generate.