1 |
ennael |
67657 |
%define rname phpMyAdmin |
2 |
|
|
%define release %mkrel 2 |
3 |
|
|
|
4 |
|
|
Summary: Handles the administration of MySQL over the web |
5 |
|
|
Name: phpmyadmin |
6 |
|
|
Version: 3.3.9.2 |
7 |
|
|
Release: %release |
8 |
|
|
License: GPLv2 |
9 |
|
|
Group: System/Servers |
10 |
|
|
URL: http://www.phpmyadmin.net/ |
11 |
|
|
Source0: http://prdownloads.sourceforge.net/phpmyadmin/%{rname}-%{version}-all-languages.tar.bz2 |
12 |
|
|
Source1: phpmyadmin-16x16.png |
13 |
|
|
Source2: phpmyadmin-32x32.png |
14 |
|
|
Source3: phpmyadmin-48x48.png |
15 |
|
|
Requires: apache-mod_php |
16 |
|
|
Requires: php-mysql |
17 |
|
|
Requires: php-mbstring |
18 |
|
|
Requires: php-mcrypt |
19 |
|
|
BuildArch: noarch |
20 |
|
|
Obsoletes: phpMyAdmin |
21 |
|
|
|
22 |
|
|
%description |
23 |
|
|
phpMyAdmin is intended to handle the administration of MySQL over the web. |
24 |
|
|
Currently it can : create and drop databases, create, copy, drop and alter |
25 |
|
|
tables, delete, edit and add fields, execute any SQL-statement, even |
26 |
|
|
batch-queries, manage keys on fields, load text files into tables, create and |
27 |
|
|
read dumps of tables, export data to CSV value, administer multiple servers |
28 |
|
|
and single databases. |
29 |
|
|
|
30 |
|
|
%prep |
31 |
|
|
%setup -q -n %{rname}-%{version}-all-languages |
32 |
|
|
|
33 |
|
|
%build |
34 |
|
|
|
35 |
|
|
%install |
36 |
|
|
rm -rf %{buildroot} |
37 |
|
|
|
38 |
|
|
export DONT_RELINK=1 |
39 |
|
|
|
40 |
|
|
install -d %{buildroot}%{_sysconfdir}/%{name} |
41 |
|
|
install -d %{buildroot}%{_datadir}/%{name} |
42 |
|
|
|
43 |
|
|
cp -aRf * %{buildroot}%{_datadir}/%{name}/ |
44 |
|
|
|
45 |
|
|
# cleanup |
46 |
|
|
pushd %{buildroot}%{_datadir}/%{name} |
47 |
|
|
rm -f CREDITS ChangeLog Documentation.txt INSTALL LICENSE README |
48 |
|
|
rm -f README.VENDOR RELEASE-DATE-* TODO |
49 |
|
|
rm -rf scripts |
50 |
|
|
rm -rf contrib |
51 |
|
|
rm -f lang/*.sh libraries/transformations/*.sh |
52 |
|
|
find -name "\.htaccess" | xargs rm -f |
53 |
|
|
popd |
54 |
|
|
|
55 |
|
|
# fix config file location |
56 |
|
|
mv %{buildroot}%{_datadir}/%{name}/config.sample.inc.php \ |
57 |
|
|
%{buildroot}%{_sysconfdir}/%{name}/config.php |
58 |
|
|
|
59 |
|
|
pushd %{buildroot}%{_datadir}/%{name} |
60 |
|
|
ln -s %{_sysconfdir}/%{name}/config.php config.inc.php |
61 |
|
|
popd |
62 |
|
|
chmod 640 %{buildroot}%{_sysconfdir}/%{name}/config.php |
63 |
|
|
|
64 |
|
|
cat > README.urpmi << EOF |
65 |
|
|
The actual configuration file is /etc/phpmyadmin/config.php. |
66 |
|
|
The config.default.inc.php file contains default values, and is not supposed to |
67 |
|
|
be modified. |
68 |
|
|
EOF |
69 |
|
|
|
70 |
|
|
install -d -m 755 %{buildroot}%{webappconfdir} |
71 |
|
|
cat > %{buildroot}%{webappconfdir}/%{name}.conf << EOF |
72 |
|
|
Alias /%{name} %{_datadir}/%{name} |
73 |
|
|
|
74 |
|
|
<Directory %{_datadir}/%{name}> |
75 |
|
|
Order deny,allow |
76 |
|
|
Deny from all |
77 |
|
|
Allow from 127.0.0.1 |
78 |
|
|
ErrorDocument 403 "Access denied per %{webappconfdir}/%{name}.conf" |
79 |
|
|
|
80 |
|
|
php_flag session.auto_start 0 |
81 |
|
|
</Directory> |
82 |
|
|
|
83 |
|
|
<Directory %{_datadir}/%{name}/libraries> |
84 |
|
|
Order deny,allow |
85 |
|
|
Deny from all |
86 |
|
|
</Directory> |
87 |
|
|
EOF |
88 |
|
|
|
89 |
ennael |
71888 |
# new Icons |
90 |
ennael |
67657 |
install -d %{buildroot}%{_iconsdir} |
91 |
|
|
install -d %{buildroot}%{_miconsdir} |
92 |
|
|
install -d %{buildroot}%{_liconsdir} |
93 |
|
|
|
94 |
|
|
install -m0644 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png |
95 |
|
|
install -m0644 %{SOURCE2} %{buildroot}%{_iconsdir}/%{name}.png |
96 |
|
|
install -m0644 %{SOURCE3} %{buildroot}%{_liconsdir}/%{name}.png |
97 |
|
|
|
98 |
|
|
# install menu entry. |
99 |
|
|
# XDG menu |
100 |
|
|
install -d %{buildroot}%{_datadir}/applications |
101 |
|
|
cat > %{buildroot}%{_datadir}/applications/mandriva-%{name}.desktop << EOF |
102 |
|
|
[Desktop Entry] |
103 |
|
|
Name=phpMyAdmin |
104 |
|
|
Comment=%{summary} |
105 |
|
|
Exec=%{_bindir}/www-browser http://localhost/%{name}/ |
106 |
|
|
Icon=%{name} |
107 |
|
|
Terminal=false |
108 |
|
|
Type=Application |
109 |
|
|
Categories=X-MandrivaLinux-MoreApplications-Databases; |
110 |
|
|
EOF |
111 |
|
|
|
112 |
|
|
# fix borked permissions |
113 |
|
|
find %{buildroot}%{_datadir}/%{name} -type d -exec chmod 755 {} \; |
114 |
|
|
find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \; |
115 |
|
|
|
116 |
|
|
%pretrans |
117 |
|
|
# fix configuration file name change |
118 |
|
|
if [ -f %{_sysconfdir}/phpmyadmin/config.default.php ]; then |
119 |
|
|
mv %{_sysconfdir}/phpmyadmin/config.default.php \ |
120 |
|
|
%{_sysconfdir}/phpmyadmin/config.php |
121 |
|
|
fi |
122 |
|
|
if [ -L /var/www/phpmyadmin/libraries/config.default.php ]; then |
123 |
|
|
rm -f /var/www/phpmyadmin/libraries/config.default.php |
124 |
|
|
fi |
125 |
|
|
if [ -L %{_datadir}/phpmyadmin/libraries/config.default.php ]; then |
126 |
|
|
rm -f %{_datadir}/phpmyadmin/libraries/config.default.php |
127 |
|
|
fi |
128 |
|
|
|
129 |
|
|
%post |
130 |
|
|
# generate random secret |
131 |
|
|
secret=%_get_password 46 |
132 |
|
|
|
133 |
|
|
# blowfish secret |
134 |
|
|
perl -pi \ |
135 |
|
|
-e "s|\\\$cfg\\['blowfish_secret'\\] = ''|\\\$cfg\\['blowfish_secret'\\] = '$secret'|" \ |
136 |
|
|
%{_sysconfdir}/%{name}/config.php |
137 |
|
|
|
138 |
|
|
%clean |
139 |
|
|
rm -rf %{buildroot} |
140 |
|
|
|
141 |
|
|
%files |
142 |
|
|
%defattr(-,root,root) |
143 |
|
|
%doc CREDITS ChangeLog Documentation.txt INSTALL LICENSE README RELEASE-DATE-* TODO scripts README.urpmi |
144 |
|
|
%config(noreplace) %{webappconfdir}/%{name}.conf |
145 |
|
|
%dir %{_sysconfdir}/%{name} |
146 |
|
|
%attr(-,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.php |
147 |
|
|
%{_datadir}/%{name} |
148 |
|
|
%{_iconsdir}/%{name}.png |
149 |
|
|
%{_miconsdir}/%{name}.png |
150 |
|
|
%{_liconsdir}/%{name}.png |
151 |
|
|
%{_datadir}/applications/*.desktop |
152 |
|
|
|
153 |
|
|
|