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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 410203 - (hide annotations) (download)
Tue Apr 16 16:32:26 2013 UTC (11 years ago) by zezinho
Original Path: cauldron/phpmyadmin/current/SPECS/phpmyadmin.spec
File size: 4493 byte(s)
new security fix version 3.5.8
1 guillomovitch 409847 %define upstream_name phpMyAdmin
2 ennael 67657
3     Summary: Handles the administration of MySQL over the web
4     Name: phpmyadmin
5 zezinho 410203 Version: 3.5.8
6     Release: %mkrel 1
7 ennael 67657 License: GPLv2
8     Group: System/Servers
9     URL: http://www.phpmyadmin.net/
10 guillomovitch 409847 Source0: http://prdownloads.sourceforge.net/phpmyadmin/%{upstream_name}-%{version}-all-languages.tar.xz
11 ennael 67657 Source1: phpmyadmin-16x16.png
12     Source2: phpmyadmin-32x32.png
13     Source3: phpmyadmin-48x48.png
14     Requires: apache-mod_php
15 zezinho 262522 Requires: php-mysqli
16 ennael 67657 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 guillomovitch 409847 %setup -q -n %{upstream_name}-%{version}-all-languages
31 ennael 67657
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 guillomovitch 291120 install -d -m 755 %{buildroot}%{_webappconfdir}
68     cat > %{buildroot}%{_webappconfdir}/%{name}.conf << EOF
69 ennael 67657 Alias /%{name} %{_datadir}/%{name}
70    
71     <Directory %{_datadir}/%{name}>
72 oden 332802 %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 guillomovitch 291120 Require local granted
79 oden 332802 %endif
80 guillomovitch 291120 ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf"
81 ennael 67657
82     php_flag session.auto_start 0
83     </Directory>
84    
85     <Directory %{_datadir}/%{name}/libraries>
86 oden 332802 %if %{mgaversion} < 3
87     Order deny,allow
88     Deny from all
89     %endif
90     %if %{mgaversion} >= 3
91 guillomovitch 291120 Require all denied
92 oden 332802 %endif
93    
94 ennael 67657 </Directory>
95     EOF
96    
97 ennael 71888 # new Icons
98 ennael 67657 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 wally 91807 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF
110 ennael 67657 [Desktop Entry]
111     Name=phpMyAdmin
112     Comment=%{summary}
113 guillomovitch 409847 Exec=%{_bindir}/www-browser http://localhost/%{name}/
114 ennael 67657 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 zezinho 230515 %doc ChangeLog Documentation.txt LICENSE README RELEASE-DATE-* README.urpmi
148 ennael 67657 %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