]> git.pld-linux.org Git - packages/phpPgAdmin.git/blob - phpPgAdmin.spec
- seems to work fine, release 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:        1
9 License:        GPL v2+
10 Group:          Applications/Databases/Interfaces
11 Source0:        http://downloads.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}-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:       php(session)
27 Requires:       webapps
28 Requires:       webserver(php) >= 5.0
29 Conflicts:      apache-base < 2.4.0-1
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _appdir         %{_datadir}/%{name}
34 %define         _webapps        /etc/webapps
35 %define         _webapp         %{name}
36 %define         _sysconfdir     %{_webapps}/%{_webapp}
37
38 %description
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
42 functions (stored procedures).
43
44 %description -l pl.UTF-8
45 phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
46 administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
47 podstawowe możliwości, jak i część bardziej zaawansowanych jak
48 przełączniki, widoki i funkcje (procedury składowane).
49
50 %prep
51 %setup -q -a3
52 %patch0 -p1
53 %patch1 -p1
54 mv conf/config.inc.php{-dist,}
55 find . -name \*.orig -exec rm -f \{\} \;
56
57 # remove scripts used by translators
58 rm -f lang/{langcheck,synch}
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}
65 cp -a classes help images js lang libraries plugins themes xloadtree $RPM_BUILD_ROOT%{_appdir}
66 cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
67
68 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
69 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
70 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
71
72 %triggerin -- apache1 < 1.3.37-3, apache1-base
73 %webapp_register apache %{_webapp}
74
75 %triggerun -- apache1 < 1.3.37-3, apache1-base
76 %webapp_unregister apache %{_webapp}
77
78 %triggerin -- apache-base
79 %webapp_register httpd %{_webapp}
80
81 %triggerun -- apache-base
82 %webapp_unregister httpd %{_webapp}
83
84 %triggerin -- lighttpd
85 %webapp_register lighttpd %{_webapp}
86
87 %triggerun -- lighttpd
88 %webapp_unregister lighttpd %{_webapp}
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
95 fi
96
97 # nuke very-old config location (this mostly for Ra)
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
103 # change config version number for 4.1.2
104 if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then
105         echo "Adjusting configuration for phpPgAdmin 4.1.2"
106         sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php
107 fi
108
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
121         fi
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
128 fi
129
130 # place new config location, as trigger puts config only on first install, do it here.
131 # apache1
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
136 fi
137 # apache2
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
145         %service httpd reload
146 fi
147 if [ "$apache_reload" ]; then
148         %service apache reload
149 fi
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %files
155 %defattr(644,root,root,755)
156 %doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
157 %doc plugins/Report/sql
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
161 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
162 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
163
164 %{_appdir}
This page took 0.1528 seconds and 4 git commands to generate.