diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-12-06 08:49:58 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-12-06 08:49:58 +0100 |
commit | 4887b7e2cd2c229dc99723d142b5f6afa082e9df (patch) | |
tree | 708579a5a91d72fabe19a8581d7978ced661f740 | |
parent | ffed9272f4ace4e31e3f36af9895d3ec097dfad5 (diff) |
php-symfony-polyfill: backport
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | php-symfony-polyfill.spec | 104 |
2 files changed, 35 insertions, 75 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3af85b3 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + +diff: + colordiff --ignore-blank-lines -I 'Group:' -I 'defattr' -u /work/fedora/php-symfony/*spec *spec
\ No newline at end of file diff --git a/php-symfony-polyfill.spec b/php-symfony-polyfill.spec index a98d72b..723c216 100644 --- a/php-symfony-polyfill.spec +++ b/php-symfony-polyfill.spec @@ -1,3 +1,4 @@ +# remirepo spec file for php-symfony-polyfill # # Fedora spec file for php-symfony-polyfill # @@ -23,32 +24,6 @@ # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} -%global php_version_id %(%{_bindir}/php -r "echo PHP_VERSION_ID;") - -%if %{php_version_id} < 50400 -%global with_php54 1 -%else -%global with_php54 0 -%endif - -%if %{php_version_id} < 50500 -%global with_php55 1 -%else -%global with_php55 0 -%endif - -%if %{php_version_id} < 50600 -%global with_php56 1 -%else -%global with_php56 0 -%endif - -%if %{php_version_id} < 70000 -%global with_php70 1 -%else -%global with_php70 0 -%endif - %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} @@ -61,6 +36,10 @@ License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# See https://github.com/symfony/polyfill/pull/15 +Patch0: %{name}-pr15.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # PHP_VERSION_ID BuildRequires: php-cli @@ -71,12 +50,8 @@ BuildRequires: php-composer(theseer/autoload) BuildRequires: php-composer(phpunit/phpunit) ## composer.json BuildRequires: php(language) >= %{php_min_ver} -%if %{with_php55} BuildRequires: php-composer(ircmaxell/password-compat) -%endif -%if %{with_php70} BuildRequires: php-composer(paragonie/random_compat) -%endif ## phpcompatinfo (computed from version 1.0.0) BuildRequires: php-hash BuildRequires: php-json @@ -89,12 +64,8 @@ BuildRequires: php-spl # composer.json Requires: php(language) >= %{php_min_ver} -%if %{with_php55} Requires: php-composer(ircmaxell/password-compat) -%endif -%if %{with_php70} Requires: php-composer(paragonie/random_compat) -%endif # phpcompatinfo (computed from version 1.0.0) Requires: php-hash Requires: php-json @@ -106,18 +77,11 @@ Requires: php-spl # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} Provides: php-composer(%{composer_vendor}/%{composer_project}-util) = %{version} -%if %{with_php54} Provides: php-composer(%{composer_vendor}/%{composer_project}-php54) = %{version} -%endif -%if %{with_php55} Provides: php-composer(%{composer_vendor}/%{composer_project}-php55) = %{version} -%endif -%if %{with_php56} Provides: php-composer(%{composer_vendor}/%{composer_project}-php56) = %{version} -%endif -%if %{with_php70} Provides: php-composer(%{composer_vendor}/%{composer_project}-php70) = %{version} -%endif + %description %{summary}. @@ -128,6 +92,8 @@ Autoloader: %{phpdir}/Symfony/Polyfill/autoload.php %prep %setup -qn %{github_name}-%{github_commit} +%patch0 -p1 + : Docs mkdir docs mv *.md composer.json docs/ @@ -136,44 +102,29 @@ mv *.md composer.json docs/ rm -rf {src,tests}/{Iconv,Intl,Mbstring,Xml} : Php54 -%if %{with_php54} : Docs mkdir docs/Php54 cp -p src/Php54/{*.md,composer.json} docs/Php54/ -%else -: Remove unneeded polyfill -rm -rf {src,tests}/Php54 -%endif : Php55 -%if %{with_php55} : Docs mkdir docs/Php55 cp -p src/Php55/{*.md,composer.json} docs/Php55/ -%else -: Remove unneeded polyfill -rm -rf {src,tests}/Php55 -%endif : Php56 -%if %{with_php56} : Docs mkdir docs/Php56 cp -p src/Php56/{*.md,composer.json} docs/Php56/ -%else -: Remove unneeded polyfill -rm -rf {src,tests}/Php56 -%endif : Php70 -%if %{with_php70} : Docs mkdir docs/Php70 cp -p src/Php70/{*.md,composer.json} docs/Php70/ -%else -: Remove unneeded polyfill -rm -rf {src,tests}/Php70 -%endif + +: Util +: Docs +mkdir docs/Util +cp -p src/Util/{*.md,composer.json} docs/Php70/ %build @@ -181,44 +132,43 @@ rm -rf {src,tests}/Php70 %{_bindir}/phpab --nolower --tolerant --output src/autoload.php src/ cat <<'AUTOLOAD' >> src/autoload.php -%if %{with_php54} require_once __DIR__ . '/Php54/bootstrap.php'; -%endif -%if %{with_php55} require_once '%{phpdir}/password_compat/password.php'; require_once __DIR__ . '/Php55/bootstrap.php'; -%endif -%if %{with_php56} require_once __DIR__ . '/Php56/bootstrap.php'; -%endif -%if %{with_php70} require_once '%{phpdir}/random_compat/autoload.php'; require_once __DIR__ . '/Php70/bootstrap.php'; -%endif AUTOLOAD cat src/autoload.php %install +rm -rf %{buildroot} + mkdir -p %{buildroot}%{phpdir}/Symfony/Polyfill cp -rp src/* %{buildroot}%{phpdir}/Symfony/Polyfill/ %check -%if 0%{with_php54}%{with_php55}%{with_php56}%{with_php70} < 1 -: No polyfills required -exit 1 -%endif - %if %{with_tests} %{_bindir}/phpunit --verbose \ --bootstrap %{buildroot}%{phpdir}/Symfony/Polyfill/autoload.php + +if which php70; then + php70 %{_bindir}/phpunit --verbose \ + --bootstrap %{buildroot}%{phpdir}/Symfony/Polyfill/autoload.php +fi %else : Tests skipped %endif +%clean +rm -rf %{buildroot} + + %files +%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc docs/* @@ -229,5 +179,9 @@ exit 1 %changelog +* Sun Dec 6 2015 Remi Collet <remi@remirepo.net> - 1.0.0-1 +- provide everything for all PHP version +- add backport stuff + * Wed Nov 25 2015 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1 - Initial package |