diff options
Diffstat (limited to 'php-sabre-xml2.spec')
-rw-r--r-- | php-sabre-xml2.spec | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/php-sabre-xml2.spec b/php-sabre-xml2.spec new file mode 100644 index 0000000..1bd190b --- /dev/null +++ b/php-sabre-xml2.spec @@ -0,0 +1,141 @@ +# remirepo/fedora spec file for php-sabre-xml +# +# Copyright (c) 2016-2019 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit a367665f1df614c3b8fefc30a54de7cd295e444e +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner sabre-io +%global gh_project xml +%global with_tests 0%{!?_without_tests:1} + +Name: php-sabre-%{gh_project} +Summary: XML library that you may not hate +Version: 1.5.1 +Release: 1%{?dist} + +URL: https://github.com/%{gh_owner}/%{gh_project} +License: BSD +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +Source1: %{name}-autoload.php + +BuildArch: noarch +%if %{with_tests} +BuildRequires: php(language) >= 5.5.5 +BuildRequires: php-xmlwriter +BuildRequires: php-xmlreader +BuildRequires: php-dom +BuildRequires: php-composer(sabre/uri) >= 1.0 +BuildRequires: php-pcre +BuildRequires: php-spl +# From composer.json, "require-dev": { +# "sabre/cs": "~1.0.0", +# "phpunit/phpunit" : "~4.8|~5.7" +BuildRequires: php-composer(phpunit/phpunit) +# Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# From composer.json, "require" : { +# "php" : ">=5.5.5", +# "ext-xmlwriter" : "*", +# "ext-xmlreader" : "*", +# "ext-dom" : "*", +# "lib-libxml" : ">=2.6.20", +# "sabre/uri" : ">=1.0,<3.0.0" +Requires: php(language) >= 5.5.5 +Requires: php-xmlwriter +Requires: php-xmlreader +Requires: php-dom +Requires: php-composer(sabre/uri) >= 1.0 +Requires: php-composer(sabre/uri) < 3 +# From phpcompatinfo report for version 1.4.0 +Requires: php-pcre +Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(sabre/xml) = %{version} + + +%description +The sabre/xml library is a specialized XML reader and writer. + +Autoloader: %{_datadir}/php/Sabre/Xml/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +cp %{SOURCE1} lib/autoload.php + + +%build +# nothing to build + + +%install +# Install as a PSR-0 library +mkdir -p %{buildroot}%{_datadir}/php/Sabre +cp -pr lib %{buildroot}%{_datadir}/php/Sabre/Xml + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php +<?php +require_once '%{buildroot}%{_datadir}/php/Sabre/Xml/autoload.php'; +// Tests +require_once '%{_datadir}/php/Symfony/Component/ClassLoader/Psr4ClassLoader.php'; +\Fedora\Autoloader\Autoload::addPsr4('Sabre\\Xml\\', dirname(__DIR__).'/tests/Sabre/Xml/'); +EOF +cd tests + +: Run upstream test suite against installed library +ret=0 +for cmd in php php56 php70 php71 php72 php73; do + if which $cmd; then + $cmd %{_bindir}/phpunit || ret=1 + fi +done +exit $ret +%else +: Skip upstream test suite +%endif + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *md +%doc composer.json +%{_datadir}/php/Sabre/Xml + + +%changelog +* Wed Jan 9 2019 Remi Collet <remi@remirepo.net> - 1.5.1-1 +- update to 1.5.1 + +* Tue Jun 5 2018 Remi Collet <remi@remirepo.net> - 1.5.0-6 +- fix project URL + +* Sat Oct 29 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-2 +- switch from symfony/class-loader to fedora/autoloader + +* Mon Oct 10 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-1 +- update to 1.5.0 +- raise dependency on PHP 5.5 + +* Fri May 20 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-1 +- update to 1.4.2 + +* Tue Mar 29 2016 Remi Collet <remi@fedoraproject.org> - 1.4.1-1 +- update to 1.4.1 + +* Fri Mar 11 2016 Remi Collet <remi@fedoraproject.org> - 1.4.0-1 +- Initial packaging + |