diff --git a/.gitignore b/.gitignore index 59b228e..567a3f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +clog /php-hamcrest2-2.0.0-776503d.tar.gz +/php-hamcrest2-2.0.1-8c3d0a3.tar.gz +/php-hamcrest2-2.1.1-f8b1c01.tgz diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..142ce02 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec) +DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.spec) +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) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +DATE=$(date -d "$DATE -4 days" +%Y-%m-%d) + +if [ -f $NAME-$VERSION-$SHORT.tgz ]; then + echo "Skip $NAME-$VERSION-$SHORT.tgz" +else + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT, Date=$DATE\n" + + echo "Cloning..." + git clone --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || exit 1 + + echo "Getting commit..." + pushd $PROJECT-$COMMIT + git checkout $COMMIT || exit1 + cp composer.json ../ + popd + + echo "Archiving..." + tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT + + echo "Cleaning..." + rm -rf $PROJECT-$COMMIT +fi + diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 5e38d9c..d041f07 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -1,57 +1,53 @@ -# remirepo/fedora spec file for php-hamcrest +# remirepo/fedora spec file for php-hamcrest2 # -# Copyright (c) 2015-2018 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2015-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -%global gh_commit 776503d3a8e85d4f9a1148614f95b7a608b046ad +%global gh_date 2025-04-30 +%global gh_commit f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner hamcrest %global gh_project hamcrest-php %global ns_project Hamcrest %global major 2 -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests Name: php-hamcrest2 -Version: 2.0.0 -Release: 1%{?dist} +Version: 2.1.1 +Release: 2%{?dist} Summary: PHP port of Hamcrest Matchers -Group: Development/Libraries -License: BSD +License: BSD-3-Clause URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +# git snapshot with tests +Source0: %{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh # Use generated autoloader instead of composer one Patch0: bootstrap-autoload.patch BuildArch: noarch BuildRequires: php-fedora-autoloader-devel -%if %{with_tests} +%if %{with tests} # From composer.json, require-dev: -# "satooshi/php-coveralls": "^1.0", -# "phpunit/php-file-iterator": "1.3.3", -# "phpunit/phpunit": "~4.0" -BuildRequires: php-composer(phpunit/phpunit) -# composer.json, require: -# "php": "^5.3|^7.0" -BuildRequires: php(language) >= 5.3 -# From phpcompatinfo report for 2.0.0 -BuildRequires: php-reflection +# "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", +# "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" +BuildRequires: phpunit9 +BuildRequires: php(language) >= 7.4 +# From phpcompatinfo report for 2.1.1 BuildRequires: php-ctype BuildRequires: php-dom -BuildRequires: php-pcre -BuildRequires: php-spl %endif -Requires: php(language) >= 5.3 -# From phpcompatinfo report for 2.0.0 +# composer.json, require: +# "php": "^7.4|^8.0" +Requires: php(language) >= 7.4 +# From phpcompatinfo report for 2.1.1 Requires: php-ctype Requires: php-dom -Requires: php-pcre -Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -72,8 +68,8 @@ Autoloader: %{_datadir}/php/%{ns_project}%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p0 -b .rpm -find . -name \*.rpm -exec rm {} \; +%patch -P0 -p0 -b .rpm +find . -name \*.rpm -exec rm {} \; -print # Move to Library tree mv hamcrest/%{ns_project}.php hamcrest/%{ns_project}/%{ns_project}.php @@ -99,12 +95,12 @@ cp -pr hamcrest/%{ns_project} %{buildroot}%{_datadir}/php/%{ns_project}%{major} %check -%if %{with_tests} +%if %{with tests} cd tests ret=0 -for cmd in php php56 php70 php71 php72 php73; do +for cmd in php php81 php82 php83 php84; do if which $cmd; then - $cmd %{_bindir}/phpunit --verbose || ret=1 + $cmd %{_bindir}/phpunit9 || ret=1 fi done exit $ret @@ -114,14 +110,73 @@ exit $ret %files -%{!?_licensedir:%global license %%doc} %license LICENSE.txt -%doc CHANGES.txt README.md TODO.txt +%doc CHANGES.txt README.md %doc composer.json %{_datadir}/php/%{ns_project}%{major} %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 2.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Tue May 6 2025 Remi Collet - 2.1.1-1 +- update to 2.1.1 +- raise dependency on PHP 7.4 + +* Wed Jan 22 2025 Remi Collet - 2.0.1-12 +- switch to phpunit9 +- re-license spec file to CECILL-2.1 + +* Sat Jan 18 2025 Fedora Release Engineering - 2.0.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Wed Sep 4 2024 Miroslav Suchý - 2.0.1-12 +- convert license to SPDX + +* Fri Jul 19 2024 Fedora Release Engineering - 2.0.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 2.0.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 2.0.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 2.0.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jan 20 2023 Fedora Release Engineering - 2.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 2.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 2.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 2.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 2.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 2.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jul 9 2020 Remi Collet - 2.0.1-1 +- update to 2.0.1 +- switch to phpunit7 + +* Thu Jan 30 2020 Fedora Release Engineering - 2.0.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 2.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 2.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Mon Jan 22 2018 Remi Collet - 2.0.0-1 - Update to 2.0.0 - rename to php-hamcrest2 diff --git a/sources b/sources index e686dc6..df95ef0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-hamcrest2-2.0.0-776503d.tar.gz) = 9f99e71d6ad3231be44970947e2aca05a8b90e763531aa11ae575348c7f0399ffb26ce86d3c422909508d2ba0cefbf7b0edf75e6c77148dbf13d68b1ef28057c +SHA512 (php-hamcrest2-2.1.1-f8b1c01.tgz) = 04bd4aa0c71e49622cfd275ab93886f6e0150607d5918a89458c80964abf81031f57b4558786b0b07530d84b36a5c5d8db83ebc51edefde790d163e57a89fec5