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