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