Sophie

Sophie

distrib > Mageia > 3 > x86_64 > media > core-updates-src > by-pkgid > 1bda7c3404298cd52a87f8b696c41d1f > files > 8

phpmyadmin-4.1.14.5-1.mga3.src.rpm

%define upstream_name phpMyAdmin

Summary:	Handles the administration of MySQL over the web
Name:		phpmyadmin
Version:	4.1.14.5
Release:	%mkrel 1
License:	GPLv2
Group:		System/Servers
URL:		http://www.phpmyadmin.net/
Source0:	http://prdownloads.sourceforge.net/phpmyadmin/%{upstream_name}-%{version}-all-languages.tar.xz
Source1:	phpmyadmin-16x16.png
Source2:	phpmyadmin-32x32.png
Source3:	phpmyadmin-48x48.png
Source4:	phpmyadmin.conf
Patch0:		phpMyAdmin-4.0.0-default_config.diff
Patch1:		phpMyAdmin-4.0.0-external_phpseclib.diff
Requires:	apache-mod_php
Requires:	php-mysqli
Requires:	php-mbstring
Requires:	php-mcrypt
BuildArch:	noarch
Obsoletes:	phpMyAdmin
# used by setup
Suggests:	php-bz2 php-zip
# parts of phpseclib is bundled in libraries/phpseclib/Crypt, but is incomplete
# http://sourceforge.net/projects/phpseclib/
Requires:	phpseclib

%description
phpMyAdmin is intended to handle the administration of MySQL over the web.
Currently it can : create and drop databases, create, copy, drop and alter
tables, delete, edit and add fields, execute any SQL-statement, even
batch-queries, manage keys on fields, load text files into tables, create and
read dumps of tables, export data to CSV value, administer multiple servers
and single databases.

%prep
%setup -q -n %{upstream_name}-%{version}-all-languages
%patch0 -p0

# Setup vendor config file
sed -e "/'CHANGELOG_FILE'/s@./ChangeLog@%{_datadir}/doc/%{name}/ChangeLog@" \
    -e "/'LICENSE_FILE'/s@./LICENSE@%{_datadir}/doc/%{name}/LICENSE@" \
    -e "/'CONFIG_DIR'/s@'./'@'%{_sysconfdir}/%{name}/'@" \
    -e "/'SETUP_CONFIG_FILE'/s@./config/config.inc.php@%{_localstatedir}/lib/%{name}/config/config.inc.php@" \
    -i libraries/vendor_config.php

%build

%install
export DONT_RELINK=1

install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}%{_datadir}/%{name}

cp -aRf * %{buildroot}%{_datadir}/%{name}/

# cleanup
pushd %{buildroot}%{_datadir}/%{name}
    rm -f CREDITS ChangeLog Documentation.txt INSTALL LICENSE README 
    rm -f README.VENDOR RELEASE-DATE-* TODO
    rm -rf scripts
    rm -rf contrib
    rm -rf doc
    rm -f lang/*.sh libraries/transformations/*.sh
    rm -rf libraries/phpseclib
    rm -rf phpunit.xml.nocoverage
    # nuke the patch backup, if any
    rm -f config.sample.inc.php.*
    find -name "\.htaccess" | xargs rm -f
popd

# fix docs
install -d %{buildroot}%{_datadir}/%{name}/doc/html/_static
install -m0644 doc/html/*.html doc/html/*.js %{buildroot}%{_datadir}/%{name}/doc/html/
install -m0644 doc/html/_static/* %{buildroot}%{_datadir}/%{name}/doc/html/_static/

# fix config file location
# keep the "config.inc.php" file name as this is hard coded everywhere.
mv %{buildroot}%{_datadir}/%{name}/config.sample.inc.php \
    %{buildroot}%{_sysconfdir}/%{name}/config.inc.php

chmod 640 %{buildroot}%{_sysconfdir}/%{name}/config.inc.php

install -d %{buildroot}%{_localstatedir}/lib/%{name}/{upload,save,config}

cat > README.urpmi << EOF
The actual configuration file is /etc/phpmyadmin/config.inc.php
The %{_datadir}/%{name}/config.default.inc.php file contains default
values, and is not supposed to be modified.
EOF

# new Icons
install -d %{buildroot}%{_iconsdir}
install -d %{buildroot}%{_miconsdir}
install -d %{buildroot}%{_liconsdir}

install -m0644 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
install -m0644 %{SOURCE2} %{buildroot}%{_iconsdir}/%{name}.png
install -m0644 %{SOURCE3} %{buildroot}%{_liconsdir}/%{name}.png

# install menu entry.
# XDG menu
install -d %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF
[Desktop Entry]
Name=phpMyAdmin
Comment=%{summary}
Exec=%{_bindir}/www-browser http://localhost/%{name}/
Icon=%{name}
Terminal=false
Type=Application
Categories=X-MandrivaLinux-MoreApplications-Databases;
EOF

install -d -m 755 %{buildroot}%{_webappconfdir}
install -m0644 %{SOURCE4} %{buildroot}%{_webappconfdir}/%{name}.conf

# fix borked permissions
find %{buildroot}%{_datadir}/%{name} -type d -exec chmod 755 {} \;
find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \;

%pretrans
# fix configuration file name change
if [ -f %{_sysconfdir}/phpmyadmin/config.default.php ]; then
    mv %{_sysconfdir}/phpmyadmin/config.default.php \
        %{_sysconfdir}/phpmyadmin/config.php
fi
# use the default file name
if [ -f %{_sysconfdir}/phpmyadmin/config.php ]; then
    mv %{_sysconfdir}/phpmyadmin/config.php \
        %{_sysconfdir}/phpmyadmin/config.inc.php
fi
if [ -L /var/www/phpmyadmin/libraries/config.default.php ]; then
    rm -f /var/www/phpmyadmin/libraries/config.default.php
fi
if [ -L %{_datadir}/phpmyadmin/libraries/config.default.php ]; then
    rm -f %{_datadir}/phpmyadmin/libraries/config.default.php
fi

%post
# generate random secret
secret=%_get_password 46

# blowfish secret
perl -pi \
    -e "s|\\\$cfg\\['blowfish_secret'\\] = ''|\\\$cfg\\['blowfish_secret'\\] = '$secret'|" \
    %{_sysconfdir}/%{name}/config.inc.php

%files
%doc ChangeLog LICENSE README RELEASE-DATE-* README.urpmi
%config(noreplace) %{webappconfdir}/%{name}.conf
%dir %{_sysconfdir}/%{name}
%attr(-,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
%{_datadir}/%{name}
%dir %{_localstatedir}/lib/%{name}/
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/upload
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/save
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/config
%{_iconsdir}/%{name}.png
%{_miconsdir}/%{name}.png
%{_liconsdir}/%{name}.png
%{_datadir}/applications/*.desktop


%changelog
* Wed Oct 01 2014 luigiwalser <luigiwalser> 4.1.14.5-1.mga3
+ Revision: 733850
- 4.1.14.5
- 4.1.14.4 (fixes CVE-2014-6300)
- 4.1.14.3 (fixes CVE-2014-5273 and CVE-2014-5274)
- 4.1.14.2 (fixes CVE-2014-4955 and CVE-2014-498[67])
- 4.1.14.1 (fixes CVE-2014-4349)
- 4.1.8
- 4.1.7 (fixes CVE-2014-1879)

  + oden <oden>
    - P0: fix static blowfish_secret wich prevents random generated one
    - 3.5.8.2

* Thu Apr 25 2013 zezinho <zezinho> 3.5.8.1-1.mga3
+ Revision: 411139
- security update

* Tue Apr 16 2013 zezinho <zezinho> 3.5.8-1.mga3
+ Revision: 410203
- new security fix version 3.5.8

* Sat Apr 13 2013 guillomovitch <guillomovitch> 3.5.7-3.mga3
+ Revision: 409847
- fix URL used in menu entry (#9664)

* Sun Mar 17 2013 guillomovitch <guillomovitch> 3.5.7-2.mga3
+ Revision: 403548
- no need to enforce mod_ssl usage by default, this is a sysadmin decision

* Wed Mar 13 2013 zezinho <zezinho> 3.5.7-1.mga3
+ Revision: 402343
- new bugfix version

* Thu Jan 31 2013 zezinho <zezinho> 3.5.6-1.mga3
+ Revision: 393825
- new version

* Thu Dec 20 2012 oden <oden> 3.5.5-1.mga3
+ Revision: 333360
- 3.5.5

* Wed Dec 19 2012 oden <oden> 3.5.4-2.mga3
+ Revision: 332803
- bump release
- make it backportable
- force ssl

* Sun Nov 18 2012 fwang <fwang> 3.5.4-1.mga3
+ Revision: 319515
- new version 3.5.4

* Tue Oct 16 2012 tmb <tmb> 3.5.3-3.mga3
+ Revision: 306855
- bump rel to preserve upgrade path from mga2

* Thu Oct 11 2012 zezinho <zezinho> 3.5.3-2.mga3
+ Revision: 304716
- bump release to be higher than in 2

* Wed Oct 10 2012 zezinho <zezinho> 3.5.3-1.mga3
+ Revision: 304499
- new version

  + guillomovitch <guillomovitch>
    - make webapp configuration file compatible with apache 2.4

* Wed Aug 22 2012 zezinho <zezinho> 3.5.2.2-1.mga3
+ Revision: 283048
- new version
- new version

* Thu Jun 21 2012 zezinho <zezinho> 3.5.1-2.mga3
+ Revision: 262522
- require php-mysqli for now, as it is the recommended upstream

* Fri May 11 2012 zezinho <zezinho> 3.5.1-1.mga2
+ Revision: 235361
- new bugfix release

* Thu Apr 12 2012 zezinho <zezinho> 3.5.0-2.mga2
+ Revision: 230515
- new version

* Thu Mar 29 2012 zezinho <zezinho> 3.4.10.2-1.mga2
+ Revision: 227530
- new version

* Tue Feb 21 2012 zezinho <zezinho> 3.4.10.1-1.mga2
+ Revision: 211462
- new version

* Sun Feb 19 2012 zezinho <zezinho> 3.4.10-1.mga2
+ Revision: 211010
- new version

* Tue Jan 03 2012 zezinho <zezinho> 3.4.9-1.mga2
+ Revision: 189887
- new version

* Mon Dec 05 2011 zezinho <zezinho> 3.4.8-1.mga2
+ Revision: 177084
- new version

* Mon Nov 14 2011 zezinho <zezinho> 3.4.7.1-1.mga2
+ Revision: 167617
- a security release

* Mon Nov 07 2011 zezinho <zezinho> 3.4.7-1.mga2
+ Revision: 164970
- new version

* Thu Oct 20 2011 zezinho <zezinho> 3.4.6-1.mga2
+ Revision: 156863
- new version

* Fri Sep 16 2011 fwang <fwang> 3.4.5-1.mga2
+ Revision: 144152
- new version 3.4.5
- new version 3.4.4

* Sun Jul 03 2011 fwang <fwang> 3.4.3.1-1.mga2
+ Revision: 117607
- new version 3.4.3.1

* Tue Apr 26 2011 wally <wally> 3.3.10-2.mga1
+ Revision: 91807
- fix desktop file name (mga#954)

* Mon Apr 11 2011 dams <dams> 3.3.10-1.mga1
+ Revision: 83210
- update to 3.3.10

* Tue Mar 15 2011 ennael <ennael> 3.3.9.2-2.mga1
+ Revision: 71888
- clean spec file
- imported package phpmyadmin