From 5f1b86a6a5aab9dd5907822750080e00d4a5f7d1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Apr 2020 14:41:16 +0200 Subject: update to 2.0.0 rename to php-composer-semver2 install in /usr/share/php/Composer/Semver2 switch to classmap autoloader --- composer.json | 5 +++-- makesrc.sh | 2 +- php-composer-semver2.spec | 57 +++++++++++++++++++++++++++-------------------- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 981e7d1..f313f4d 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpunit/phpunit": "^4.5 || ^5.0.5 || ^7", + "phpstan/phpstan": "^0.12.19" }, "autoload": { "psr-4": { @@ -48,7 +49,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "2.x-dev" } }, "scripts": { diff --git a/makesrc.sh b/makesrc.sh index c047df5..dfd5c2a 100755 --- a/makesrc.sh +++ b/makesrc.sh @@ -1,6 +1,6 @@ #!/bin/bash -NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec) +NAME=$(basename $PWD) OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) diff --git a/php-composer-semver2.spec b/php-composer-semver2.spec index 9444d5b..c32554b 100644 --- a/php-composer-semver2.spec +++ b/php-composer-semver2.spec @@ -1,4 +1,4 @@ -# remirepo/fedora spec file for php-composer-semver +# remirepo/fedora spec file for php-composer-semver2 # # Copyright (c) 2015-2020 Remi Collet # License: CC-BY-SA @@ -6,43 +6,47 @@ # # Please, preserve the changelog entries # -%global gh_commit c6bea70230ef4dd483e6bbcab6005f682ed3a8de +%global gh_commit 0ec124f57c7e23925c006cbad0de853e3aec3ba2 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20150717 %global gh_owner composer %global gh_project semver +%global ns_vendor Composer +%global ns_project Semver %global php_home %{_datadir}/php +%global major 2 %global with_tests 0%{!?_without_tests:1} -Name: php-composer-semver -Version: 1.5.1 +Name: php-%{gh_owner}-%{gh_project}%{major} +Version: 2.0.0 Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} -Summary: Semver library that offers utilities, version constraint parsing and validation +Summary: Semver library version %{major} License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} # git snapshot to get upstream test suite Source0: %{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -Source2: %{name}-autoload.php BuildArch: noarch %if %{with_tests} # For tests -BuildRequires: php(language) >= 5.3.2 +# BR 7.1 as we use phpunit7 +BuildRequires: php(language) >= 7.1 BuildRequires: php-pcre BuildRequires: php-spl # From composer.json, "require-dev": { -# "phpunit/phpunit": "^4.5 || ^5.0.5" -BuildRequires: php-composer(phpunit/phpunit) >= 4.5 +# "phpunit/phpunit": "^4.5 || ^5.0.5 || ^7", +# "phpstan/phpstan": "^0.12.19" +BuildRequires: phpunit7 # Autoloader -BuildRequires: php-composer(fedora/autoloader) +BuildRequires: php-fedora-autoloader-devel %endif # From composer.json, "require": { # "php": "^5.3.2 || ^7.0", Requires: php(language) >= 5.3.2 -# From phpcompatinfo report for version 1.5.0 +# From phpcompatinfo report for version 2.0.0 Requires: php-pcre Requires: php-spl # Autoloader @@ -52,38 +56,37 @@ Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} %description -Semver library that offers utilities, version constraint parsing -and validation. +Semver library version %{major} that offers utilities, version constraint +parsing and validation. Originally written as part of composer/composer, now extracted and made available as a stand-alone library. -Autoloader: %{_datadir}/php/Composer/Semver/autoload.php +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -cp %{SOURCE2} src/autoload.php - %build -# Empty build section, most likely nothing required. +: Generate classmap autoloader +phpab --template fedora --output src/autoload.php src %install : Library -mkdir -p %{buildroot}%{php_home}/Composer/ -cp -pr src %{buildroot}%{php_home}/Composer/Semver +mkdir -p %{buildroot}%{php_home}/%{ns_vendor}/ +cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major} %check %if %{with_tests} ret=0 -for cmd in php php72 php73 php74; do +for cmd in php php72 php73 php74 php80; do if which $cmd; then - $cmd %{_bindir}/phpunit \ - --bootstrap %{buildroot}%{php_home}/Composer/Semver/autoload.php \ + $cmd %{_bindir}/phpunit7 \ + --bootstrap %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php \ --verbose || ret=1 fi done @@ -99,11 +102,17 @@ exit $ret %license LICENSE %doc composer.json %doc *.md -%dir %{php_home}/Composer - %{php_home}/Composer/Semver +%dir %{php_home}/%{ns_vendor} + %{php_home}/%{ns_vendor}/%{ns_project}%{major} %changelog +* Wed Apr 22 2020 Remi Collet - 2.0.0-1 +- update to 2.0.0 +- rename to php-composer-semver2 +- install in /usr/share/php/Composer/Semver2 +- switch to classmap autoloader + * Tue Jan 14 2020 Remi Collet - 1.5.1-1 - update to 1.5.1 -- cgit