From 07d9d9269d4fc0ac7ba88c75945b49da4b7c9e80 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 1 Mar 2018 15:35:50 +0100 Subject: update to 4.8.0-alpha1 add dependency on psr/container add dependency on twig/twig add dependency on twig/extensions add dependency on symfony/expression-language add optional dependency on bacon/bacon-qr-code dependency on tecnickcom/tcpdf is now optional --- composer.json | 49 +++++++++++++++---- phpMyAdmin-certs.patch | 20 ++++---- phpMyAdmin.spec | 127 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 133 insertions(+), 63 deletions(-) diff --git a/composer.json b/composer.json index 11e4343..65be479 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,14 @@ "non-feature-branches": ["RELEASE_.*"], "autoload": { "psr-4": { - "PMA\\": "./" + "PhpMyAdmin\\": "libraries/classes", + "PhpMyAdmin\\Setup\\": "setup/lib" + } + }, + "autoload-dev": { + "psr-4": { + "PhpMyAdmin\\Tests\\": "test/classes", + "PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/" } }, "repositories": [ @@ -33,20 +40,29 @@ ], "require": { "php": ">=5.5.0", - "ext-mbstring": "*", "ext-mysqli": "*", "ext-xml": "*", "ext-pcre": "*", "ext-json": "*", + "ext-ctype": "*", + "ext-hash": "*", "phpmyadmin/sql-parser": "^4.2.3", "phpmyadmin/motranslator": "^4.0", "phpmyadmin/shapefile": "^2.0", - "tecnickcom/tcpdf": "^6.2", "phpseclib/phpseclib": "^2.0", - "google/recaptcha": "^1.1" + "google/recaptcha": "^1.1", + "psr/container": "^1.0", + "twig/twig": "^1.34", + "twig/extensions": "~1.5.1", + "symfony/expression-language": "^3.2 || ^2.8", + "symfony/polyfill-mbstring": "^1.3" }, "conflict": { - "phpseclib/phpseclib": "2.0.8" + "phpseclib/phpseclib": "2.0.8", + "tecnickcom/tcpdf": "<6.2", + "pragmarx/google2fa": "<2.0", + "bacon/bacon-qr-code": "<1.0", + "samyoul/u2f-php-server": "<1.1" }, "suggest": { "ext-openssl": "Cookie encryption", @@ -56,13 +72,26 @@ "ext-bz2": "For bzip2 import and export", "ext-zip": "For zip import and export", "ext-gd2": "For image transformations", - "tecnickcom/tcpdf": "For PDF support" + "ext-mbstring": "For best performance", + "tecnickcom/tcpdf": "For PDF support", + "pragmarx/google2fa": "For 2FA authentication", + "bacon/bacon-qr-code": "For 2FA authentication", + "samyoul/u2f-php-server": "For FIDO U2F authentication" }, "require-dev": { - "phpunit/phpunit": "~4.1", + "phpunit/phpunit": "^4.8.36 || ^5.7", "codacy/coverage": "^1.3.0", - "phpunit/phpunit-selenium": "~1.2", - "squizlabs/php_codesniffer": "2.*", - "phpmyadmin/coding-standard": ">=0.1.0" + "phpunit/phpunit-selenium": "~1.2 || ^3.0", + "squizlabs/php_codesniffer": "^3.0", + "tecnickcom/tcpdf": "^6.2", + "pragmarx/google2fa": "^2.0", + "bacon/bacon-qr-code": "^1.0", + "samyoul/u2f-php-server": "^1.1", + "phpmyadmin/coding-standard": "^0.3" + }, + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } } } diff --git a/phpMyAdmin-certs.patch b/phpMyAdmin-certs.patch index 31ca029..709f9d9 100644 --- a/phpMyAdmin-certs.patch +++ b/phpMyAdmin-certs.patch @@ -1,18 +1,18 @@ -diff -up ./libraries/Util.php.rpm ./libraries/Util.php ---- ./libraries/Util.php.rpm 2017-06-30 07:17:37.000000000 +0200 -+++ ./libraries/Util.php 2017-06-30 07:18:14.000000000 +0200 -@@ -4782,12 +4782,12 @@ class Util +diff -up ./libraries/classes/Utils/HttpRequest.php.rpm ./libraries/classes/Utils/HttpRequest.php +--- ./libraries/classes/Utils/HttpRequest.php.rpm 2018-03-01 15:05:29.388126314 +0100 ++++ ./libraries/classes/Utils/HttpRequest.php 2018-03-01 15:06:51.922563502 +0100 +@@ -139,12 +139,12 @@ class HttpRequest * * See https://letsencrypt.org/certificates/ */ -- $certs_dir = dirname(__file__) . '/certs/'; -+ $certs_dir = '/etc/pki/tls/'; +- $certsDir = dirname(__file__) . '/../../certs/'; ++ $certsDir = '/etc/pki/tls/'; /* See code below for logic */ if ($ssl == CURLOPT_CAPATH) { - $curl_status &= curl_setopt($curl_handle, CURLOPT_CAPATH, $certs_dir); + $curlStatus &= curl_setopt($curlHandle, CURLOPT_CAPATH, $certsDir); } elseif ($ssl == CURLOPT_CAINFO) { -- $curl_status &= curl_setopt($curl_handle, CURLOPT_CAINFO, $certs_dir . 'cacert.pem'); -+ $curl_status &= curl_setopt($curl_handle, CURLOPT_CAINFO, $certs_dir . 'cert.pem'); +- $curlStatus &= curl_setopt($curlHandle, CURLOPT_CAINFO, $certsDir . 'cacert.pem'); ++ $curlStatus &= curl_setopt($curlHandle, CURLOPT_CAINFO, $certsDir . 'cert.pem'); } - $curl_status &= curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,true); + $curlStatus &= curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); diff --git a/phpMyAdmin.spec b/phpMyAdmin.spec index 23b2261..51b690c 100644 --- a/phpMyAdmin.spec +++ b/phpMyAdmin.spec @@ -9,7 +9,6 @@ # # Please, preserve the changelog entries # -#global prever rc1 %{!?_pkgdocdir: %global _pkgdocdir %{_datadir}/doc/%{name}-%{version}} %if 0%{?fedora} >= 21 # nginx 1.6 with nginx-filesystem @@ -21,9 +20,12 @@ %global with_httpd 0 %endif +%global upstream_version 4.8.0 +%global upstream_prever alpha1 + Name: phpMyAdmin -Version: 4.7.8 -Release: 1%{?dist} +Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} +Release: 2%{?dist} Summary: Web based MySQL browser written in php # MIT (js/jquery/, js/jqplot, js/codemirror/, js/tracekit/) @@ -31,8 +33,8 @@ Summary: Web based MySQL browser written in php # GPLv2+ (the rest) License: GPLv2+ and MIT and BSD URL: https://www.phpmyadmin.net/ -Source0: https://files.phpmyadmin.net/%{name}/%{version}%{?prever:-%prever}/%{name}-%{version}%{?prever:-%prever}-all-languages.tar.xz -Source1: https://files.phpmyadmin.net/%{name}/%{version}%{?prever:-%prever}/%{name}-%{version}%{?prever:-%prever}-all-languages.tar.xz.asc +Source0: https://files.phpmyadmin.net/%{name}/%{upstream_version}%{?upstream_prever:-%upstream_prever}/%{name}-%{upstream_version}%{?upstream_prever:-%upstream_prever}-all-languages.tar.xz +Source1: https://files.phpmyadmin.net/%{name}/%{upstream_version}%{?upstream_prever:-%upstream_prever}/%{name}-%{upstream_version}%{?upstream_prever:-%upstream_prever}-all-languages.tar.xz.asc Source2: phpMyAdmin.htaccess Source3: phpMyAdmin.nginx @@ -53,47 +55,55 @@ Suggests: httpd %endif # From composer.json, "require": { # "php": ">=5.5.0", -# "ext-mbstring": "*", # "ext-mysqli": "*", # "ext-xml": "*", # "ext-pcre": "*", # "ext-json": "*", +# "ext-ctype": "*", +# "ext-hash": "*", # "phpmyadmin/sql-parser": "^4.2.3", # "phpmyadmin/motranslator": "^4.0", # "phpmyadmin/shapefile": "^2.0", -# "tecnickcom/tcpdf": "^6.2", # "phpseclib/phpseclib": "^2.0", -# "google/recaptcha": "^1.1" +# "google/recaptcha": "^1.1", +# "psr/container": "^1.0", +# "twig/twig": "^1.34", +# "twig/extensions": "~1.5.1", +# "symfony/expression-language": "^3.2 || ^2.8", +# "symfony/polyfill-mbstring": "^1.3" # "conflict": { -# "phpseclib/phpseclib": "2.0.8" +# "phpseclib/phpseclib": "2.0.8", +# "tecnickcom/tcpdf": "<6.2", +# "pragmarx/google2fa": "<2.0", +# "bacon/bacon-qr-code": "<1.0", +# "samyoul/u2f-php-server": "<1.1" Requires: php(language) >= 5.5 -Requires: php-mbstring Requires: php-mysqli -Requires: php-openssl Requires: php-xml Requires: php-pcre Requires: php-json -Requires: php-tcpdf-dejavu-sans-fonts +Requires: php-ctype +Requires: php-hash %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(phpmyadmin/sql-parser) >= 4.2.3 with php-composer(phpmyadmin/sql-parser) < 5) -Requires: (php-composer(phpmyadmin/motranslator) >= 4.0 with php-composer(phpmyadmin/motranslator) < 5) -Requires: (php-composer(phpmyadmin/shapefile) >= 2.0 with php-composer(phpmyadmin/shapefile) < 3) -Requires: (php-composer(tecnickcom/tcpdf) >= 6.2 with php-composer(tecnickcom/tcpdf) < 7) -Requires: (php-composer(phpseclib/phpseclib) >= 2.0.9 with php-composer(phpseclib/phpseclib) < 3) -Requires: (php-composer(google/recaptcha) >= 1.1 with php-composer(google/recaptcha) < 2) +Requires: (php-composer(phpmyadmin/sql-parser) >= 4.2.3 with php-composer(phpmyadmin/sql-parser) < 5) +Requires: (php-composer(phpmyadmin/motranslator) >= 4.0 with php-composer(phpmyadmin/motranslator) < 5) +Requires: (php-composer(phpmyadmin/shapefile) >= 2.0 with php-composer(phpmyadmin/shapefile) < 3) +Requires: (php-composer(phpseclib/phpseclib) >= 2.0.9 with php-composer(phpseclib/phpseclib) < 3) +Requires: (php-composer(google/recaptcha) >= 1.1 with php-composer(google/recaptcha) < 2) +Requires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) +Requires: (php-composer(twig/twig) >= 1.34 with php-composer(twig/twig) < 2) +Requires: (php-composer(twig/extensions) >= 1.5.1 with php-composer(twig/extensions) < 2) +Requires: (php-composer(symfony/expression-language) >= 2.8 with php-composer(symfony/expression-language) < 4) %else -Requires: php-composer(phpmyadmin/sql-parser) < 5 -Requires: php-composer(phpmyadmin/sql-parser) >= 4.2.3 -Requires: php-composer(phpmyadmin/motranslator) < 5 -Requires: php-composer(phpmyadmin/motranslator) >= 4.0 -Requires: php-composer(phpmyadmin/shapefile) < 3 -Requires: php-composer(phpmyadmin/shapefile) >= 2.0 -Requires: php-composer(tecnickcom/tcpdf) < 7 -Requires: php-composer(tecnickcom/tcpdf) >= 6.2 -Requires: php-composer(phpseclib/phpseclib) < 3 -Requires: php-composer(phpseclib/phpseclib) >= 2.0.9 -Requires: php-composer(google/recaptcha) < 2 -Requires: php-composer(google/recaptcha) >= 1.1 +Requires: php-phpmyadmin-sql-parser >= 4.2.3 +Requires: php-phpmyadmin-motranslator >= 4.0 +Requires: php-phpmyadmin-shapefile >= 2.0 +Requires: php-phpseclib >= 2.0.9 +Requires: php-google-recaptcha >= 1.1 +Requires: php-psr-container >= 1.0 +Requires: php-twig >= 1.34 +Requires: php-twig-extensions >= 1.5.1 +Requires: php-symfony-expression-language < 4 %endif # Autoloader Requires: php-composer(fedora/autoloader) @@ -105,20 +115,28 @@ Requires: php-composer(fedora/autoloader) # "ext-bz2": "For bzip2 import and export", # "ext-zip": "For zip import and export", # "ext-gd2": "For image transformations", -# "tecnickcom/tcpdf": "For PDF support" +# "ext-mbstring": "For best performance", +# "tecnickcom/tcpdf": "For PDF support", +# "pragmarx/google2fa": "For 2FA authentication", +# "bacon/bacon-qr-code": "For 2FA authentication", +# "samyoul/u2f-php-server": "For FIDO U2F authentication" Requires: php-openssl Requires: php-curl Requires: php-zlib Requires: php-bz2 Requires: php-zip Requires: php-gd -%if 0%{?fedora} >= 21 +# Keep mandatory to avoid polyfill +Requires: php-mbstring +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 Recommends: php-opcache +Recommends: php-composer(bacon/bacon-qr-code) >= 1.0 +Recommends: php-composer(tecnickcom/tcpdf) >= 6.2 +Recommends: php-tcpdf-dejavu-sans-fonts >= 6.2 %endif -# From phpcompatinfo reports for 4.7.0 +# From phpcompatinfo reports for 4.8.0 Requires: php-date Requires: php-filter -Requires: php-hash Requires: php-iconv Requires: php-libxml Requires: php-recode @@ -132,7 +150,7 @@ Requires: ca-certificates # Bundled JS library Provides: bundled(js-codemirror) Provides: bundled(js-jqplot) = 1.0.9 -Provides: bundled(js-jquery) = 3.1.1 +Provides: bundled(js-jquery) = 3.2.1 Provides: bundled(js-openlayers) Provides: bundled(js-tracekit) @@ -151,7 +169,7 @@ is available in 50 languages %prep -%setup -qn phpMyAdmin-%{version}%{?prever:-%prever}-all-languages +%setup -qn phpMyAdmin-%{upstream_version}%{?upstream_prever:-%upstream_prever}-all-languages %patch0 -p1 # Minimal configuration file @@ -169,6 +187,8 @@ sed -e "/'CHANGELOG_FILE'/s@./ChangeLog@%{_pkgdocdir}/ChangeLog@" \ %if 0%{?_licensedir:1} -e '/LICENSE_FILE/s:%_defaultdocdir:%_defaultlicensedir:' \ %endif + -e '/AUTOLOAD_FILE/s@./vendor@%{_datadir}/%{name}/vendor@' \ + -e '/TEMP_DIR/s@./tmp@%{_localstatedir}/lib/%{name}/temp@' \ -i libraries/vendor_config.php # For debug @@ -181,14 +201,25 @@ cat << 'EOF' | tee vendor/autoload.php /* Autoloader for phpMyAdmin and its dependencies */ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; -\Fedora\Autoloader\Autoload::addPsr4('PMA\\', dirname(__DIR__)); +\Fedora\Autoloader\Autoload::addPsr4('PhpMyAdmin\\', dirname(__DIR__) . '/libraries/classes'); +\Fedora\Autoloader\Autoload::addPsr4('PhpMyAdmin\\Setup\\', dirname(__DIR__) . '/setup/lib'); \Fedora\Autoloader\Dependencies::required([ '%{_datadir}/php/PhpMyAdmin/SqlParser/autoload.php', '%{_datadir}/php/PhpMyAdmin/MoTranslator/autoload.php', '%{_datadir}/php/PhpMyAdmin/ShapeFile/autoload.php', - '%{_datadir}/php/tcpdf/autoload.php', '%{_datadir}/php/phpseclib/autoload.php', '%{_datadir}/php/ReCaptcha/autoload.php', + '%{_datadir}/php/Psr/Container/autoload.php', + '%{_datadir}/php/Twig/autoload.php', + '%{_datadir}/php/Twig/Extensions/autoload.php', + [ + '%{_datadir}/php/Symfony3/Component/ExpressionLanguage/autoload.php', + '%{_datadir}/php/Symfony/Component/ExpressionLanguage/autoload.php', + ], +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{_datadir}/php/tcpdf/autoload.php', + '%{_datadir}/php/BaconQrCode/autoload.php', ]); EOF @@ -218,8 +249,8 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/contrib rm %{buildroot}/%{_datadir}/%{name}/composer.* # JS libraries sources -rm -r %{buildroot}%{_datadir}/%{name}/js/jquery/src -rm -r %{buildroot}%{_datadir}/%{name}/js/openlayers/src +#rm -r %{buildroot}%{_datadir}/%{name}/js/jquery/src +#rm -r %{buildroot}%{_datadir}/%{name}/js/openlayers/src # Bundled certificates rm -r %{buildroot}%{_datadir}/%{name}/libraries/certs @@ -230,10 +261,10 @@ rm -rf %{buildroot}%{_datadir}/%{name}/doc/ mkdir -p %{buildroot}%{_datadir}/%{name}/doc/ ln -s %{_pkgdocdir}/html %{buildroot}%{_datadir}/%{name}/doc/html -mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/{upload,save,config} +mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/{upload,save,config,temp} -mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/js/jquery/MIT-LICENSE.txt LICENSE-jquery -mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/js/codemirror/LICENSE LICENSE-codemirror +mv -f %{buildroot}%{_datadir}/%{name}/js/vendor/jquery/MIT-LICENSE.txt LICENSE-jquery +mv -f %{buildroot}%{_datadir}/%{name}/js/vendor/codemirror/LICENSE LICENSE-codemirror %pretrans @@ -267,9 +298,19 @@ sed -e "/'blowfish_secret'/s/MUSTBECHANGEDONINSTALL/$SECRET/" \ %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/upload %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/save %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/config +%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/temp %changelog +* Thu Mar 1 2018 Remi Collet 4.8.0~alpha1-2 +- update to 4.8.0-alpha1 +- add dependency on psr/container +- add dependency on twig/twig +- add dependency on twig/extensions +- add dependency on symfony/expression-language +- add optional dependency on bacon/bacon-qr-code +- dependency on tecnickcom/tcpdf is now optional + * Wed Feb 21 2018 Remi Collet 4.7.8-1 - update to 4.7.8 (2018-02-20, security release) - raise dependency on phpmyadmin/motranslator version 4.0 -- cgit