]>
Commit | Line | Data |
---|---|---|
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 | 4 | Summary: phpPgAdmin - web-based PostgreSQL administration |
515becd9 | 5 | Summary(pl.UTF-8): phpPgAdmin - administracja bazami PostgreSQL przez WWW |
43017019 | 6 | Name: phpPgAdmin |
8a8a809b | 7 | Version: 5.1 |
09fc5579 | 8 | Release: 1 |
5a288fe8 | 9 | License: GPL v2+ |
43017019 | 10 | Group: Applications/Databases/Interfaces |
063aacb4 | 11 | Source0: http://downloads.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2 |
8a8a809b | 12 | # Source0-md5: ad8f05cef0c443d9ce2940bf36319c24 |
fddd5411 | 13 | Source1: %{name}-apache.conf |
d5488ac9 | 14 | Source2: %{name}-lighttpd.conf |
bb46dcab TP |
15 | Source3: http://www.quarto.pl/~gotar/%{name}-jscalendar.tar.bz2 |
16 | # Source3-md5: 84115f772a723cc742352c589df9af29 | |
3d2e03cc | 17 | Source4: %{name}-httpd.conf |
a7bd83cb | 18 | Patch0: %{name}-config.patch |
c2246312 | 19 | Patch1: %{name}-calendar.patch |
d00682a3 | 20 | URL: http://phppgadmin.sourceforge.net/ |
5e3bbdfa | 21 | BuildRequires: rpmbuild(macros) >= 1.268 |
bacecd01 | 22 | Requires(triggerpostun): sed >= 4.0 |
d373e486 | 23 | #Requires: adodb >= 4.67-1.17 |
b782471a ER |
24 | Requires: php(pcre) |
25 | Requires: php(pgsql) | |
bd266d2e | 26 | Requires: php(session) |
71f9b5c7 | 27 | Requires: webapps |
232a76d8 | 28 | Requires: webserver(php) >= 5.0 |
3d2e03cc | 29 | Conflicts: apache-base < 2.4.0-1 |
b70f7f36 | 30 | BuildArch: noarch |
dc9fec47 | 31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43017019 | 32 | |
bacecd01 | 33 | %define _appdir %{_datadir}/%{name} |
71f9b5c7 ER |
34 | %define _webapps /etc/webapps |
35 | %define _webapp %{name} | |
36 | %define _sysconfdir %{_webapps}/%{_webapp} | |
43017019 | 37 | |
38 | %description | |
dc9fec47 AM |
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 | |
232a76d8 | 42 | functions (stored procedures). |
43017019 | 43 | |
e8fce4fa JR |
44 | %description -l pl.UTF-8 |
45 | phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem | |
ac8df53c | 46 | administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie |
e8fce4fa JR |
47 | podstawowe możliwości, jak i część bardziej zaawansowanych jak |
48 | przełączniki, widoki i funkcje (procedury składowane). | |
43017019 | 49 | |
50 | %prep | |
891a6f8b | 51 | %setup -q -a3 |
a7bd83cb | 52 | %patch0 -p1 |
c2246312 | 53 | %patch1 -p1 |
93776806 | 54 | mv conf/config.inc.php{-dist,} |
0bb50a65 | 55 | find . -name \*.orig -exec rm -f \{\} \; |
43017019 | 56 | |
c2246312 MK |
57 | # remove scripts used by translators |
58 | rm -f lang/{langcheck,synch} | |
71f9b5c7 ER |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}} | |
63 | ||
64 | cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir} | |
c2246312 | 65 | cp -a classes help images js lang libraries plugins themes xloadtree $RPM_BUILD_ROOT%{_appdir} |
71f9b5c7 | 66 | cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir} |
43017019 | 67 | |
fddd5411 | 68 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
3d2e03cc | 69 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf |
d5488ac9 | 70 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf |
71f9b5c7 | 71 | |
e54d2cd8 | 72 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
71f9b5c7 ER |
73 | %webapp_register apache %{_webapp} |
74 | ||
e54d2cd8 | 75 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
71f9b5c7 | 76 | %webapp_unregister apache %{_webapp} |
bacecd01 | 77 | |
3d2e03cc | 78 | %triggerin -- apache-base |
71f9b5c7 | 79 | %webapp_register httpd %{_webapp} |
bacecd01 | 80 | |
3d2e03cc | 81 | %triggerun -- apache-base |
71f9b5c7 ER |
82 | %webapp_unregister httpd %{_webapp} |
83 | ||
d5488ac9 MŁ |
84 | %triggerin -- lighttpd |
85 | %webapp_register lighttpd %{_webapp} | |
86 | ||
87 | %triggerun -- lighttpd | |
88 | %webapp_unregister lighttpd %{_webapp} | |
71f9b5c7 ER |
89 | |
90 | %triggerpostun -- %{name} < 4.0.1-1.2 | |
91 | # rescue app config | |
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 | |
325539ef | 95 | fi |
bacecd01 | 96 | |
97 | # nuke very-old config location (this mostly for Ra) | |
71f9b5c7 ER |
98 | if [ -f /etc/httpd/httpd.conf ]; then |
99 | sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf | |
100 | httpd_reload=1 | |
101 | fi | |
102 | ||
1b84c4f3 | 103 | # change config version number for 4.1.2 |
17d1adea | 104 | if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then |
105 | echo "Adjusting configuration for phpPgAdmin 4.1.2" | |
1b84c4f3 | 106 | sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php |
17d1adea | 107 | fi |
108 | ||
71f9b5c7 ER |
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 | |
113 | httpd_reload=1 | |
114 | fi | |
115 | ||
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 | |
bacecd01 | 121 | fi |
71f9b5c7 ER |
122 | |
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 | |
126 | fi | |
127 | rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave | |
345abfde TO |
128 | fi |
129 | ||
bacecd01 | 130 | # place new config location, as trigger puts config only on first install, do it here. |
131 | # apache1 | |
71f9b5c7 ER |
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} | |
135 | apache_reload=1 | |
bacecd01 | 136 | fi |
137 | # apache2 | |
71f9b5c7 ER |
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} | |
141 | httpd_reload=1 | |
142 | fi | |
143 | ||
144 | if [ "$httpd_reload" ]; then | |
5e3bbdfa | 145 | %service httpd reload |
345abfde | 146 | fi |
71f9b5c7 | 147 | if [ "$apache_reload" ]; then |
5e3bbdfa | 148 | %service apache reload |
71f9b5c7 | 149 | fi |
345abfde | 150 | |
bacecd01 | 151 | %clean |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
43017019 | 154 | %files |
155 | %defattr(644,root,root,755) | |
c2e6245c | 156 | %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS |
8a8a809b | 157 | %doc plugins/Report/sql |
71f9b5c7 ER |
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 | |
d5488ac9 | 161 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
71f9b5c7 ER |
162 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php |
163 | ||
bacecd01 | 164 | %{_appdir} |