/[packages]/updates/3/phpmyadmin/current/SPECS/phpmyadmin.spec
ViewVC logotype

Contents of /updates/3/phpmyadmin/current/SPECS/phpmyadmin.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30