/[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 409847 - (show annotations) (download)
Sat Apr 13 10:59:12 2013 UTC (11 years ago) by guillomovitch
Original Path: cauldron/phpmyadmin/current/SPECS/phpmyadmin.spec
File size: 4493 byte(s)
fix URL used in menu entry (#9664)
1 %define upstream_name phpMyAdmin
2
3 Summary: Handles the administration of MySQL over the web
4 Name: phpmyadmin
5 Version: 3.5.7
6 Release: %mkrel 3
7 License: GPLv2
8 Group: System/Servers
9 URL: http://www.phpmyadmin.net/
10 Source0: http://prdownloads.sourceforge.net/phpmyadmin/%{upstream_name}-%{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 %{upstream_name}-%{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 %if %{mgaversion} < 3
73 Order deny,allow
74 Deny from all
75 Allow from 127.0.0.1
76 %endif
77 %if %{mgaversion} >= 3
78 Require local granted
79 %endif
80 ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf"
81
82 php_flag session.auto_start 0
83 </Directory>
84
85 <Directory %{_datadir}/%{name}/libraries>
86 %if %{mgaversion} < 3
87 Order deny,allow
88 Deny from all
89 %endif
90 %if %{mgaversion} >= 3
91 Require all denied
92 %endif
93
94 </Directory>
95 EOF
96
97 # new Icons
98 install -d %{buildroot}%{_iconsdir}
99 install -d %{buildroot}%{_miconsdir}
100 install -d %{buildroot}%{_liconsdir}
101
102 install -m0644 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
103 install -m0644 %{SOURCE2} %{buildroot}%{_iconsdir}/%{name}.png
104 install -m0644 %{SOURCE3} %{buildroot}%{_liconsdir}/%{name}.png
105
106 # install menu entry.
107 # XDG menu
108 install -d %{buildroot}%{_datadir}/applications
109 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF
110 [Desktop Entry]
111 Name=phpMyAdmin
112 Comment=%{summary}
113 Exec=%{_bindir}/www-browser http://localhost/%{name}/
114 Icon=%{name}
115 Terminal=false
116 Type=Application
117 Categories=X-MandrivaLinux-MoreApplications-Databases;
118 EOF
119
120 # fix borked permissions
121 find %{buildroot}%{_datadir}/%{name} -type d -exec chmod 755 {} \;
122 find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \;
123
124 %pretrans
125 # fix configuration file name change
126 if [ -f %{_sysconfdir}/phpmyadmin/config.default.php ]; then
127 mv %{_sysconfdir}/phpmyadmin/config.default.php \
128 %{_sysconfdir}/phpmyadmin/config.php
129 fi
130 if [ -L /var/www/phpmyadmin/libraries/config.default.php ]; then
131 rm -f /var/www/phpmyadmin/libraries/config.default.php
132 fi
133 if [ -L %{_datadir}/phpmyadmin/libraries/config.default.php ]; then
134 rm -f %{_datadir}/phpmyadmin/libraries/config.default.php
135 fi
136
137 %post
138 # generate random secret
139 secret=%_get_password 46
140
141 # blowfish secret
142 perl -pi \
143 -e "s|\\\$cfg\\['blowfish_secret'\\] = ''|\\\$cfg\\['blowfish_secret'\\] = '$secret'|" \
144 %{_sysconfdir}/%{name}/config.php
145
146 %files
147 %doc ChangeLog Documentation.txt LICENSE README RELEASE-DATE-* README.urpmi
148 %config(noreplace) %{webappconfdir}/%{name}.conf
149 %dir %{_sysconfdir}/%{name}
150 %attr(-,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.php
151 %{_datadir}/%{name}
152 %{_iconsdir}/%{name}.png
153 %{_miconsdir}/%{name}.png
154 %{_liconsdir}/%{name}.png
155 %{_datadir}/applications/*.desktop

  ViewVC Help
Powered by ViewVC 1.1.30