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