1 |
%define rname phpPgAdmin |
2 |
|
3 |
Summary: PostgreSQL database administration over the web interface |
4 |
Name: phppgadmin |
5 |
Version: 5.1 |
6 |
Release: %mkrel 7 |
7 |
License: GPLv2+ |
8 |
Group: System/Servers |
9 |
URL: http://sourceforge.net/projects/phppgadmin |
10 |
Source0: http://downloads.sourceforge.net/phppgadmin/%{rname}-%{version}.tar.bz2 |
11 |
Patch0: phpPgAdmin-4.1.1-mdv_conf.diff |
12 |
Requires: apache-mod_php |
13 |
Requires: php-pgsql |
14 |
Requires: php-gettext |
15 |
#Requires(post): ccp >= 0.4.0 #This requirement is currently commented out |
16 |
|
17 |
BuildRequires: ImageMagick |
18 |
BuildRequires: libjasper |
19 |
BuildRequires: recode |
20 |
BuildArch: noarch |
21 |
|
22 |
%description |
23 |
phpPgAdmin is phpMyAdmin (for MySQL) ported to PostgreSQL. |
24 |
phpPgAdmin is a fully functional PostgreSQL administration |
25 |
utility. You can use it to create and maintain multiple databases |
26 |
and even multiple servers. |
27 |
|
28 |
%prep |
29 |
%setup -q -n %{rname}-%{version} |
30 |
%patch0 -p0 |
31 |
|
32 |
# clean up CVS stuff |
33 |
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do |
34 |
if [ -e "$i" ]; then rm -r $i; fi >&/dev/null |
35 |
done |
36 |
|
37 |
%build |
38 |
|
39 |
%install |
40 |
|
41 |
export DONT_RELINK=1 |
42 |
|
43 |
install -d %{buildroot}%{webappconfdir} |
44 |
install -d %{buildroot}%{_sysconfdir}/%{name} |
45 |
install -d %{buildroot}/var/www/%{name} |
46 |
|
47 |
cp -aRf * %{buildroot}/var/www/%{name}/ |
48 |
|
49 |
mv %{buildroot}/var/www/%{name}/conf/config.inc.php-dist %{buildroot}%{_sysconfdir}/%{name}/config.inc.php |
50 |
rm -rf %{buildroot}/var/www/%{name}/conf |
51 |
|
52 |
# generate UTF-8 files |
53 |
pushd lang |
54 |
# make DESTDIR=./recoded |
55 |
popd |
56 |
install -m0644 lang/*.php %{buildroot}/var/www/%{name}/lang/ |
57 |
|
58 |
# cleanup |
59 |
pushd %{buildroot}/var/www/%{name} |
60 |
rm -rf sql |
61 |
rm -f CREDITS DEVELOPERS FAQ HISTORY INSTALL LICENSE TODO TRANSLATORS |
62 |
rm -f lang/Makefile lang/convert.awk lang/php2po lang/po2php lang/synch lang/langcheck |
63 |
popd |
64 |
|
65 |
cat > %{buildroot}%{webappconfdir}/%{name}.conf << EOF |
66 |
Alias /%{name} /var/www/%{name} |
67 |
|
68 |
<Directory /var/www/%{name}> |
69 |
<IfModule mod_authz_core.c> |
70 |
# Apache 2.4 |
71 |
<RequireAny> |
72 |
Require ip 127.0.0.1 |
73 |
Require ip ::1 |
74 |
</RequireAny> |
75 |
</IfModule> |
76 |
<IfModule !mod_authz_core.c> |
77 |
# Apache 2.2 |
78 |
Order Deny,Allow |
79 |
Deny from All |
80 |
Allow from 127.0.0.1 |
81 |
Allow from ::1 |
82 |
</IfModule> |
83 |
ErrorDocument 403 "Access denied per %{webappconfdir}/%{name}.conf" |
84 |
</Directory> |
85 |
EOF |
86 |
|
87 |
# fix dir perms |
88 |
find %{buildroot} -type d | xargs chmod 755 |
89 |
|
90 |
# fix file perms |
91 |
find %{buildroot} -type f | xargs chmod 644 |
92 |
|
93 |
# Mandriva Icons |
94 |
install -d %{buildroot}%{_iconsdir} |
95 |
install -d %{buildroot}%{_miconsdir} |
96 |
install -d %{buildroot}%{_liconsdir} |
97 |
|
98 |
convert images/themes/default/title.png -resize 16x16 %{buildroot}%{_miconsdir}/%{name}.png |
99 |
convert images/themes/default/title.png -resize 32x32 %{buildroot}%{_iconsdir}/%{name}.png |
100 |
convert images/themes/default/title.png -resize 48x48 %{buildroot}%{_liconsdir}/%{name}.png |
101 |
|
102 |
|
103 |
# FreeDesktop menu |
104 |
install -d %{buildroot}%{_datadir}/applications |
105 |
cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF |
106 |
[Desktop Entry] |
107 |
Name=phpPgAdmin |
108 |
Comment=phpPgAdmin is a web administration GUI for PostgreSQL. |
109 |
Exec=%{_bindir}/www-browser http://localhost/%{name}/ |
110 |
Icon=%{name} |
111 |
Terminal=false |
112 |
Type=Application |
113 |
Categories=Database; |
114 |
EOF |
115 |
|
116 |
%post |
117 |
#Since we already create a config.inc.php.rpmnew automatically, then we should |
118 |
#probably remove this. Otherwise we should do more specific checking for options |
119 |
#ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version \ |
120 |
# --oldfile %{_sysconfdir}/%{name}/config.inc.php \ |
121 |
# --newfile %{_sysconfdir}/%{name}/config.inc.php.rpmnew |
122 |
|
123 |
%files |
124 |
%doc CREDITS DEVELOPERS FAQ HISTORY INSTALL LICENSE TODO TRANSLATORS plugins/Report/sql/reports-pgsql.sql |
125 |
%config(noreplace) %{webappconfdir}/%{name}.conf |
126 |
%dir %{_sysconfdir}/%{name} |
127 |
%attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/config.inc.php |
128 |
/var/www/%{name} |
129 |
%{_iconsdir}/%{name}.png |
130 |
%{_miconsdir}/%{name}.png |
131 |
%{_liconsdir}/%{name}.png |
132 |
%{_datadir}/applications/*.desktop |
133 |
|
134 |
|