]> git.pld-linux.org Git - packages/phpPgAdmin.git/blob - phpPgAdmin.spec
- update webapp triggers due apache1 package split
[packages/phpPgAdmin.git] / phpPgAdmin.spec
1 # TODO
2 # - separate internal files (classes, libraries) and public files (.js, .css, index.php) to htdocs and above and point docroot to htdocs dir
3 Summary:        phpPgAdmin - web-based PostgreSQL administration
4 Summary(pl):    phpPgAdmin - administracja bazami PostgreSQL przez WWW
5 Name:           phpPgAdmin
6 Version:        4.0.1
7 Release:        4.2
8 License:        GPL v2+
9 Group:          Applications/Databases/Interfaces
10 Source0:        http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
11 # Source0-md5:  7e0c18a01538572d3c2b435725e68fe2
12 Source1:        %{name}-apache.conf
13 Patch0:         %{name}-config.patch
14 #Patch1:                %{name}-adodb.patch
15 URL:            http://phppgadmin.sourceforge.net/
16 BuildRequires:  rpmbuild(macros) >= 1.268
17 Requires(triggerpostun):        sed >= 4.0
18 #Requires:      adodb >= 4.67-1.17
19 Requires:       php >= 3:4.1
20 Requires:       php-pcre
21 Requires:       php-pgsql >= 3:4.1
22 Requires:       webapps
23 BuildArch:      noarch
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _appdir         %{_datadir}/%{name}
27 %define         _webapps        /etc/webapps
28 %define         _webapp         %{name}
29 %define         _sysconfdir     %{_webapps}/%{_webapp}
30
31 %description
32 phpPgAdmin is a fully functional web-based administration utility for
33 a PostgreSQL database server. It handles all the basic functionality
34 as well as some advanced features such as triggers, views and
35 functions (stored procs).
36
37 %description -l pl
38 phpPgAdmin jest w pe³ni funkcjonalnym, bazowanym na WWW, narzêdziem
39 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
40 podstawowe mo¿liwo¶ci, jak i czê¶æ bardziej zaawansowanych jak
41 prze³±czniki, widoki i funkcje (procedury sk³adowane).
42
43 %prep
44 %setup -q
45 %patch0 -p1
46 #%patch1 -p1
47 rm -f conf/config.inc.php-dist
48
49 # remove language source files (or one wants to make -devel subpackage?)
50 mv -f lang/translations.php .
51 rm -f lang/*.php
52 rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
53 mv -f translations.php lang/translations.php
54 rm -f lang/recoded/README
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
59
60 cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
61 cp -a classes help images lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
62 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
63
64 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
65 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
66 #install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
67
68 %triggerin -- apache1 < 1.3.37-3, apache1-base
69 %webapp_register apache %{_webapp}
70
71 %triggerun -- apache1 < 1.3.37-3, apache1-base
72 %webapp_unregister apache %{_webapp}
73
74 %triggerin -- apache < 2.2.0, apache-base
75 %webapp_register httpd %{_webapp}
76
77 %triggerun -- apache < 2.2.0, apache-base
78 %webapp_unregister httpd %{_webapp}
79
80 #%%triggerin -- lighttpd
81 #%%webapp_register lighttpd %{_webapp}
82 #
83 #%%triggerun -- lighttpd
84 #%%webapp_unregister lighttpd %{_webapp}
85
86 %triggerpostun -- %{name} < 4.0.1-1.2
87 # rescue app config
88 if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
89         mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
90         mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
91 fi
92
93 # nuke very-old config location (this mostly for Ra)
94 if [ -f /etc/httpd/httpd.conf ]; then
95         sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
96         httpd_reload=1
97 fi
98
99 # migrate from httpd (apache2) config dir
100 if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
101         cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
102         mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
103         httpd_reload=1
104 fi
105
106 # migrate from apache-config macros
107 if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
108         if [ -d /etc/apache/webapps.d ]; then
109                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
110                 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
111         fi
112
113         if [ -d /etc/httpd/webapps.d ]; then
114                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
115                 cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
116         fi
117         rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
118 fi
119
120 # place new config location, as trigger puts config only on first install, do it here.
121 # apache1
122 if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
123         rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
124         /usr/sbin/webapp register apache %{_webapp}
125         apache_reload=1
126 fi
127 # apache2
128 if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
129         rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
130         /usr/sbin/webapp register httpd %{_webapp}
131         httpd_reload=1
132 fi
133
134 if [ "$httpd_reload" ]; then
135         %service httpd reload
136 fi
137 if [ "$apache_reload" ]; then
138         %service apache reload
139 fi
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %files
145 %defattr(644,root,root,755)
146 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
147 %doc sql
148 %dir %attr(750,root,http) %{_sysconfdir}
149 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
150 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
151 #%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
152 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
153
154 %{_appdir}
This page took 0.056608 seconds and 4 git commands to generate.