diff options
-rw-r--r-- | glpi-fedora-autoloader.php | 58 | ||||
-rw-r--r-- | glpi.spec | 63 |
2 files changed, 84 insertions, 37 deletions
diff --git a/glpi-fedora-autoloader.php b/glpi-fedora-autoloader.php index 808881d..49ea0de 100644 --- a/glpi-fedora-autoloader.php +++ b/glpi-fedora-autoloader.php @@ -1,26 +1,42 @@ <?php $vendor = '##DATADIR##/php'; +require_once "$vendor/Fedora/Autoloader/autoload.php"; + // Dependencies from composer.json -// "jasig/phpcas": "~1.3.0", -require_once '##DATADIR##/pear/CAS/Autoload.php'; -// "iamcal/lib_autolink": "~1.7", -require_once $vendor . '/php-iamcal-lib-autolink/autoload.php'; -// "phpmailer/phpmailer": "~5.2", -require_once $vendor . '/PHPMailer/PHPMailerAutoload.php'; -// "sabre/vobject": "~4.1", -require_once $vendor . '/Sabre/VObject4/autoload.php'; -// "simplepie/simplepie": "^1.5", -require_once $vendor . '/php-simplepie/autoloader.php'; -// "tecnickcom/tcpdf": "~6.2", -require_once $vendor . '/tcpdf/autoload.php'; -// "zendframework/zend-cache": "^2.7", -// "zendframework/zend-i18n": "^2.7", -// "zendframework/zend-serializer": "^2.7", -require_once $vendor . '/Zend/autoload.php'; -// "michelf/php-markdown": "^1.6", -require_once $vendor . '/Michelf/markdown-autoload.php'; -// "true/punycode": "^2.1", -require_once $vendor . '/TrueBV/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + // "jasig/phpcas": "~1.3.0", + '##DATADIR##/pear/CAS/Autoload.php', + // "iamcal/lib_autolink": "~1.7", + "$vendor/php-iamcal-lib-autolink/autoload.php", + // "phpmailer/phpmailer": "~5.2", + "$vendor/PHPMailer/PHPMailerAutoload.php", + // "sabre/vobject": "~4.1", + "$vendor/Sabre/VObject4/autoload.php", + // "simplepie/simplepie": "^1.5", + "$vendor/php-simplepie/autoloader.php", + // "tecnickcom/tcpdf": "~6.2", + "$vendor/tcpdf/autoload.php", + // "zendframework/zend-cache": "^2.7", + [ + "$vendor/Zend/Cache/autoload.php", + "$vendor/Zend/autoload.php", + ], + // "zendframework/zend-i18n": "^2.7", + [ + "$vendor/Zend/I18n/autoload.php", + "$vendor/Zend/autoload.php", + ], + // "zendframework/zend-serializer": "^2.7", + [ + "$vendor/Zend/Serializer/autoload.php", + "$vendor/Zend/autoload.php", + ], + // "michelf/php-markdown": "^1.6", + "$vendor/Michelf/markdown-autoload.php", + // "true/punycode": "^2.1", + "$vendor/TrueBV/autoload.php", // "paragonie/random_compat": "^2.0" -require_once $vendor . '/random_compat/autoload.php'; + "$vendor/random_compat/autoload.php", +]); + @@ -41,7 +41,7 @@ Name: %{gh_project} Version: 9.2.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Free IT asset management software Summary(fr): Gestion Libre de Parc Informatique @@ -87,12 +87,23 @@ BuildRequires: php-composer(sabre/vobject) >= 4.1 BuildRequires: php-composer(simplepie/simplepie) < 2 BuildRequires: php-composer(tecnickcom/tcpdf) < 7 BuildRequires: php-composer(tecnickcom/tcpdf) >= 6.2.13 -BuildRequires: php-composer(zendframework/zend-cache) < 3 -BuildRequires: php-composer(zendframework/zend-cache) >= 2.7 -BuildRequires: php-composer(zendframework/zend-i18n) < 3 -BuildRequires: php-composer(zendframework/zend-i18n) >= 2.7 -BuildRequires: php-composer(zendframework/zend-serializer) < 3 -BuildRequires: php-composer(zendframework/zend-serializer) >= 2.7 +# remirepo:1 +%if 0%{?fedora} >= 25 +BuildRequires: php-autoloader(zendframework/zend-cache) < 3 +BuildRequires: php-autoloader(zendframework/zend-cache) >= 2.7 +BuildRequires: php-autoloader(zendframework/zend-i18n) < 3 +BuildRequires: php-autoloader(zendframework/zend-i18n) >= 2.7 +BuildRequires: php-autoloader(zendframework/zend-serializer) < 3 +BuildRequires: php-autoloader(zendframework/zend-serializer) >= 2.7 +# remirepo:8 +%else +BuildRequires: php-composer(zendframework/zend-cache) < 3 +BuildRequires: php-composer(zendframework/zend-cache) >= 2.7 +BuildRequires: php-composer(zendframework/zend-i18n) < 3 +BuildRequires: php-composer(zendframework/zend-i18n) >= 2.7 +BuildRequires: php-composer(zendframework/zend-serializer) < 3 +BuildRequires: php-composer(zendframework/zend-serializer) >= 2.7 +%endif BuildRequires: php-composer(michelf/php-markdown) < 2 BuildRequires: php-composer(michelf/php-markdown) >= 1.6 BuildRequires: php-composer(true/punycode) < 3 @@ -110,6 +121,8 @@ BuildRequires: php-composer(natxet/CssMin) < 4 BuildRequires: php-composer(natxet/CssMin) >= 3.0 BuildRequires: php-composer(patchwork/jsqueeze) < 3 BuildRequires: php-composer(patchwork/jsqueeze) >= 2.0 +# Autoloader +BuildRequires: php-composer(fedora/autoloader) %if %{with_nginx} Requires: nginx-filesystem @@ -157,13 +170,24 @@ Requires: php-composer(simplepie/simplepie) >= 1.5 # 6.2.13 to ensure we have the classmap autoloader Requires: php-composer(tecnickcom/tcpdf) < 7 Requires: php-composer(tecnickcom/tcpdf) >= 6.2.13 -Requires: php-composer(zendframework/zend-cache) < 3 -Requires: php-composer(zendframework/zend-cache) >= 2.7 -Requires: php-composer(zendframework/zend-i18n) < 3 -Requires: php-composer(zendframework/zend-i18n) >= 2.7 -Requires: php-composer(zendframework/zend-serializer) < 3 -Requires: php-composer(zendframework/zend-serializer) >= 2.7 +# remirepo:1 +%if 0%{?fedora} >= 25 +Requires: php-autoloader(zendframework/zend-cache) < 3 +Requires: php-autoloader(zendframework/zend-cache) >= 2.7 +Requires: php-autoloader(zendframework/zend-i18n) < 3 +Requires: php-autoloader(zendframework/zend-i18n) >= 2.7 +Requires: php-autoloader(zendframework/zend-serializer) < 3 +Requires: php-autoloader(zendframework/zend-serializer) >= 2.7 +# remirepo:9 +%else +Requires: php-composer(zendframework/zend-cache) < 3 +Requires: php-composer(zendframework/zend-cache) >= 2.7 +Requires: php-composer(zendframework/zend-i18n) < 3 +Requires: php-composer(zendframework/zend-i18n) >= 2.7 +Requires: php-composer(zendframework/zend-serializer) < 3 +Requires: php-composer(zendframework/zend-serializer) >= 2.7 Requires: php-composer(zendframework/zend-loader) +%endif Requires: php-composer(michelf/php-markdown) < 2 Requires: php-composer(michelf/php-markdown) >= 1.6 Requires: php-composer(true/punycode) < 3 @@ -183,6 +207,8 @@ Provides: bundled(js-fuzzy) Provides: bundled(js-jquery) Provides: bundled(prism) Provides: bundled(tiny_mce) = 4.3.13 +# Autoloader +Requires: php-composer(fedora/autoloader) Requires: %{_sysconfdir}/logrotate.d Requires(postun): /sbin/service @@ -355,8 +381,10 @@ rm composer.lock : Add developement dependecies cat << 'EOF' | tee -a vendor/autoload.php -// "guzzlehttp/guzzle": "~6" -require_once $vendor . '/GuzzleHttp6/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + // "guzzlehttp/guzzle": "~6" + "$vendor/GuzzleHttp6/autoload.php", +]); EOF : No internet on the builder @@ -364,7 +392,7 @@ export GLPI_SKIP_ONLINE=1 : Running a PHP server export GLPI_URI=http://127.0.0.1:8089 -%{_bindir}/php -S 127.0.0.1:8089 tests/router.php &>/dev/null & +%{_bindir}/php -S 127.0.0.1:8089 tests/router.php &>web.log & PHPPID=$! : Skip LDAP tests for now @@ -496,6 +524,9 @@ fi %changelog +* Fri Nov 24 2017 Remi Collet <remi@remirepo.net> - 9.2.1-5 +- switch to fedora/autoloader + * Sat Nov 18 2017 Remi Collet <remi@remirepo.net> - 9.2.1-4 - EL7: remove SELinux rules as default policy includes them |