/[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 798086 - (hide annotations) (download)
Fri Nov 21 18:21:41 2014 UTC (4 years, 7 months ago) by luigiwalser
File size: 5566 byte(s)
4.1.14.7 (fixes CVE-2014-895[89] and CVE-2014-896[01])
1 guillomovitch 409847 %define upstream_name phpMyAdmin
2 ennael 67657
3     Summary: Handles the administration of MySQL over the web
4     Name: phpmyadmin
5 luigiwalser 798086 Version: 4.1.14.7
6 zezinho 410203 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 luigiwalser 595284 Source4: phpmyadmin.conf
15     Patch0: phpMyAdmin-4.0.0-default_config.diff
16     Patch1: phpMyAdmin-4.0.0-external_phpseclib.diff
17 ennael 67657 Requires: apache-mod_php
18 zezinho 262522 Requires: php-mysqli
19 ennael 67657 Requires: php-mbstring
20     Requires: php-mcrypt
21     BuildArch: noarch
22     Obsoletes: phpMyAdmin
23 luigiwalser 595284 # used by setup
24     Suggests: php-bz2 php-zip
25     # parts of phpseclib is bundled in libraries/phpseclib/Crypt, but is incomplete
26     # http://sourceforge.net/projects/phpseclib/
27     Requires: phpseclib
28 ennael 67657
29     %description
30     phpMyAdmin is intended to handle the administration of MySQL over the web.
31     Currently it can : create and drop databases, create, copy, drop and alter
32     tables, delete, edit and add fields, execute any SQL-statement, even
33     batch-queries, manage keys on fields, load text files into tables, create and
34     read dumps of tables, export data to CSV value, administer multiple servers
35     and single databases.
36    
37     %prep
38 guillomovitch 409847 %setup -q -n %{upstream_name}-%{version}-all-languages
39 oden 466670 %patch0 -p0
40 ennael 67657
41 luigiwalser 595284 # Setup vendor config file
42     sed -e "/'CHANGELOG_FILE'/s@./ChangeLog@%{_datadir}/doc/%{name}/ChangeLog@" \
43     -e "/'LICENSE_FILE'/s@./LICENSE@%{_datadir}/doc/%{name}/LICENSE@" \
44     -e "/'CONFIG_DIR'/s@'./'@'%{_sysconfdir}/%{name}/'@" \
45     -e "/'SETUP_CONFIG_FILE'/s@./config/config.inc.php@%{_localstatedir}/lib/%{name}/config/config.inc.php@" \
46     -i libraries/vendor_config.php
47    
48 ennael 67657 %build
49    
50     %install
51     export DONT_RELINK=1
52    
53     install -d %{buildroot}%{_sysconfdir}/%{name}
54     install -d %{buildroot}%{_datadir}/%{name}
55    
56     cp -aRf * %{buildroot}%{_datadir}/%{name}/
57    
58     # cleanup
59     pushd %{buildroot}%{_datadir}/%{name}
60     rm -f CREDITS ChangeLog Documentation.txt INSTALL LICENSE README
61     rm -f README.VENDOR RELEASE-DATE-* TODO
62     rm -rf scripts
63     rm -rf contrib
64 luigiwalser 595284 rm -rf doc
65 ennael 67657 rm -f lang/*.sh libraries/transformations/*.sh
66 luigiwalser 595284 rm -rf libraries/phpseclib
67     rm -rf phpunit.xml.nocoverage
68     # nuke the patch backup, if any
69     rm -f config.sample.inc.php.*
70 ennael 67657 find -name "\.htaccess" | xargs rm -f
71     popd
72    
73 luigiwalser 595284 # fix docs
74     install -d %{buildroot}%{_datadir}/%{name}/doc/html/_static
75     install -m0644 doc/html/*.html doc/html/*.js %{buildroot}%{_datadir}/%{name}/doc/html/
76     install -m0644 doc/html/_static/* %{buildroot}%{_datadir}/%{name}/doc/html/_static/
77    
78 ennael 67657 # fix config file location
79 luigiwalser 595284 # keep the "config.inc.php" file name as this is hard coded everywhere.
80 ennael 67657 mv %{buildroot}%{_datadir}/%{name}/config.sample.inc.php \
81 luigiwalser 595284 %{buildroot}%{_sysconfdir}/%{name}/config.inc.php
82 ennael 67657
83 luigiwalser 595284 chmod 640 %{buildroot}%{_sysconfdir}/%{name}/config.inc.php
84 ennael 67657
85 luigiwalser 595284 install -d %{buildroot}%{_localstatedir}/lib/%{name}/{upload,save,config}
86    
87 ennael 67657 cat > README.urpmi << EOF
88 luigiwalser 595284 The actual configuration file is /etc/phpmyadmin/config.inc.php
89     The %{_datadir}/%{name}/config.default.inc.php file contains default
90     values, and is not supposed to be modified.
91 ennael 67657 EOF
92    
93 ennael 71888 # new Icons
94 ennael 67657 install -d %{buildroot}%{_iconsdir}
95     install -d %{buildroot}%{_miconsdir}
96     install -d %{buildroot}%{_liconsdir}
97    
98     install -m0644 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
99     install -m0644 %{SOURCE2} %{buildroot}%{_iconsdir}/%{name}.png
100     install -m0644 %{SOURCE3} %{buildroot}%{_liconsdir}/%{name}.png
101    
102     # install menu entry.
103     # XDG menu
104     install -d %{buildroot}%{_datadir}/applications
105 wally 91807 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF
106 ennael 67657 [Desktop Entry]
107     Name=phpMyAdmin
108     Comment=%{summary}
109 guillomovitch 409847 Exec=%{_bindir}/www-browser http://localhost/%{name}/
110 ennael 67657 Icon=%{name}
111     Terminal=false
112     Type=Application
113     Categories=X-MandrivaLinux-MoreApplications-Databases;
114     EOF
115    
116 luigiwalser 595284 install -d -m 755 %{buildroot}%{_webappconfdir}
117     install -m0644 %{SOURCE4} %{buildroot}%{_webappconfdir}/%{name}.conf
118    
119 ennael 67657 # fix borked permissions
120     find %{buildroot}%{_datadir}/%{name} -type d -exec chmod 755 {} \;
121     find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \;
122    
123     %pretrans
124     # fix configuration file name change
125     if [ -f %{_sysconfdir}/phpmyadmin/config.default.php ]; then
126     mv %{_sysconfdir}/phpmyadmin/config.default.php \
127     %{_sysconfdir}/phpmyadmin/config.php
128     fi
129 luigiwalser 595284 # use the default file name
130     if [ -f %{_sysconfdir}/phpmyadmin/config.php ]; then
131     mv %{_sysconfdir}/phpmyadmin/config.php \
132     %{_sysconfdir}/phpmyadmin/config.inc.php
133     fi
134 ennael 67657 if [ -L /var/www/phpmyadmin/libraries/config.default.php ]; then
135     rm -f /var/www/phpmyadmin/libraries/config.default.php
136     fi
137     if [ -L %{_datadir}/phpmyadmin/libraries/config.default.php ]; then
138     rm -f %{_datadir}/phpmyadmin/libraries/config.default.php
139     fi
140    
141     %post
142     # generate random secret
143     secret=%_get_password 46
144    
145     # blowfish secret
146     perl -pi \
147     -e "s|\\\$cfg\\['blowfish_secret'\\] = ''|\\\$cfg\\['blowfish_secret'\\] = '$secret'|" \
148 luigiwalser 595284 %{_sysconfdir}/%{name}/config.inc.php
149 ennael 67657
150     %files
151 luigiwalser 595284 %doc ChangeLog LICENSE README RELEASE-DATE-* README.urpmi
152 ennael 67657 %config(noreplace) %{webappconfdir}/%{name}.conf
153     %dir %{_sysconfdir}/%{name}
154 luigiwalser 595284 %attr(-,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
155 ennael 67657 %{_datadir}/%{name}
156 luigiwalser 595284 %dir %{_localstatedir}/lib/%{name}/
157     %dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/upload
158     %dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/save
159     %dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/config
160 ennael 67657 %{_iconsdir}/%{name}.png
161     %{_miconsdir}/%{name}.png
162     %{_liconsdir}/%{name}.png
163     %{_datadir}/applications/*.desktop

  ViewVC Help
Powered by ViewVC 1.1.26