/[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 332802 - (show annotations) (download)
Wed Dec 19 11:16:57 2012 UTC (11 years, 4 months ago) by oden
Original Path: cauldron/phpmyadmin/current/SPECS/phpmyadmin.spec
File size: 4685 byte(s)
- make it backportable
- force ssl

1 %define rname phpMyAdmin
2
3 Summary: Handles the administration of MySQL over the web
4 Name: phpmyadmin
5 Version: 3.5.4
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: apache-mod_ssl
16 Requires: php-mysqli
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 export DONT_RELINK=1
37
38 install -d %{buildroot}%{_sysconfdir}/%{name}
39 install -d %{buildroot}%{_datadir}/%{name}
40
41 cp -aRf * %{buildroot}%{_datadir}/%{name}/
42
43 # cleanup
44 pushd %{buildroot}%{_datadir}/%{name}
45 rm -f CREDITS ChangeLog Documentation.txt INSTALL LICENSE README
46 rm -f README.VENDOR RELEASE-DATE-* TODO
47 rm -rf scripts
48 rm -rf contrib
49 rm -f lang/*.sh libraries/transformations/*.sh
50 find -name "\.htaccess" | xargs rm -f
51 popd
52
53 # fix config file location
54 mv %{buildroot}%{_datadir}/%{name}/config.sample.inc.php \
55 %{buildroot}%{_sysconfdir}/%{name}/config.php
56
57 pushd %{buildroot}%{_datadir}/%{name}
58 ln -s %{_sysconfdir}/%{name}/config.php config.inc.php
59 popd
60 chmod 640 %{buildroot}%{_sysconfdir}/%{name}/config.php
61
62 cat > README.urpmi << EOF
63 The actual configuration file is /etc/phpmyadmin/config.php.
64 The config.default.inc.php file contains default values, and is not supposed to
65 be modified.
66 EOF
67
68 install -d -m 755 %{buildroot}%{_webappconfdir}
69 cat > %{buildroot}%{_webappconfdir}/%{name}.conf << EOF
70 Alias /%{name} %{_datadir}/%{name}
71
72 <Directory %{_datadir}/%{name}>
73 %if %{mgaversion} < 3
74 Order deny,allow
75 Deny from all
76 Allow from 127.0.0.1
77 %endif
78 %if %{mgaversion} >= 3
79 Require local granted
80 %endif
81 ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf"
82
83 php_flag session.auto_start 0
84 </Directory>
85
86 <Location "/%{name}">
87 Options +FollowSymLinks
88 RewriteEngine On
89 RewriteCond %{SERVER_PORT} ^80$
90 RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
91 </Location>
92
93 <Directory %{_datadir}/%{name}/libraries>
94 %if %{mgaversion} < 3
95 Order deny,allow
96 Deny from all
97 %endif
98 %if %{mgaversion} >= 3
99 Require all denied
100 %endif
101
102 </Directory>
103 EOF
104
105 # new Icons
106 install -d %{buildroot}%{_iconsdir}
107 install -d %{buildroot}%{_miconsdir}
108 install -d %{buildroot}%{_liconsdir}
109
110 install -m0644 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
111 install -m0644 %{SOURCE2} %{buildroot}%{_iconsdir}/%{name}.png
112 install -m0644 %{SOURCE3} %{buildroot}%{_liconsdir}/%{name}.png
113
114 # install menu entry.
115 # XDG menu
116 install -d %{buildroot}%{_datadir}/applications
117 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF
118 [Desktop Entry]
119 Name=phpMyAdmin
120 Comment=%{summary}
121 Exec=%{_bindir}/www-browser https://localhost/%{name}/
122 Icon=%{name}
123 Terminal=false
124 Type=Application
125 Categories=X-MandrivaLinux-MoreApplications-Databases;
126 EOF
127
128 # fix borked permissions
129 find %{buildroot}%{_datadir}/%{name} -type d -exec chmod 755 {} \;
130 find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \;
131
132 %pretrans
133 # fix configuration file name change
134 if [ -f %{_sysconfdir}/phpmyadmin/config.default.php ]; then
135 mv %{_sysconfdir}/phpmyadmin/config.default.php \
136 %{_sysconfdir}/phpmyadmin/config.php
137 fi
138 if [ -L /var/www/phpmyadmin/libraries/config.default.php ]; then
139 rm -f /var/www/phpmyadmin/libraries/config.default.php
140 fi
141 if [ -L %{_datadir}/phpmyadmin/libraries/config.default.php ]; then
142 rm -f %{_datadir}/phpmyadmin/libraries/config.default.php
143 fi
144
145 %post
146 # generate random secret
147 secret=%_get_password 46
148
149 # blowfish secret
150 perl -pi \
151 -e "s|\\\$cfg\\['blowfish_secret'\\] = ''|\\\$cfg\\['blowfish_secret'\\] = '$secret'|" \
152 %{_sysconfdir}/%{name}/config.php
153
154 %clean
155
156 %files
157 %doc ChangeLog Documentation.txt LICENSE README RELEASE-DATE-* README.urpmi
158 %config(noreplace) %{webappconfdir}/%{name}.conf
159 %dir %{_sysconfdir}/%{name}
160 %attr(-,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.php
161 %{_datadir}/%{name}
162 %{_iconsdir}/%{name}.png
163 %{_miconsdir}/%{name}.png
164 %{_liconsdir}/%{name}.png
165 %{_datadir}/applications/*.desktop

  ViewVC Help
Powered by ViewVC 1.1.30