From 3efe286cca172dea845e848f39fc975c7856c548 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 27 Jun 2023 15:51:00 +0200 Subject: duplicate v4 --- .gitignore | 9 ++ Makefile | 4 + composer.json | 41 +++++ makesrc.sh | 28 ++++ php-nikic-php-parser5-rpm.patch | 18 +++ php-nikic-php-parser5.spec | 323 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 423 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json create mode 100755 makesrc.sh create mode 100644 php-nikic-php-parser5-rpm.patch create mode 100644 php-nikic-php-parser5.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2fd064a --- /dev/null +++ b/composer.json @@ -0,0 +1,41 @@ +{ + "name": "nikic/php-parser", + "type": "library", + "description": "A PHP parser written in PHP", + "keywords": [ + "php", + "parser" + ], + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Nikita Popov" + } + ], + "require": { + "php": ">=7.0", + "ext-tokenizer": "*" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", + "ircmaxell/php-yacc": "^0.0.7" + }, + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "autoload-dev": { + "psr-4": { + "PhpParser\\": "test/PhpParser/" + } + }, + "bin": [ + "bin/php-parse" + ] +} diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..7d752c6 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +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) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT\n" + +echo "Cloning..." +git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + +echo "Getting commit..." +pushd $PROJECT-$COMMIT +git checkout $COMMIT +cp composer.json ../composer.json +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT + +echo "Cleaning..." +rm -rf $PROJECT-$COMMIT + +echo "Done." + diff --git a/php-nikic-php-parser5-rpm.patch b/php-nikic-php-parser5-rpm.patch new file mode 100644 index 0000000..66edc42 --- /dev/null +++ b/php-nikic-php-parser5-rpm.patch @@ -0,0 +1,18 @@ +diff -up ./bin/php-parse.rpm ./bin/php-parse +--- ./bin/php-parse.rpm 2016-04-19 15:41:41.000000000 +0200 ++++ ./bin/php-parse 2016-04-20 06:33:22.712063600 +0200 +@@ -1,12 +1,7 @@ + #!/usr/bin/env php + = 7.3 +BuildRequires: php-tokenizer +BuildRequires: php-reflection +BuildRequires: php-ctype +BuildRequires: php-json +BuildRequires: php-pcre +BuildRequires: php-spl +# From composer.json, "require-dev": { +# "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", +# "ircmaxell/php-yacc": "0.0.7" +%global phpunit %{_bindir}/phpunit9 +BuildRequires: phpunit9 +# Autoloader +%endif +BuildRequires: php-fedora-autoloader-devel + +# From composer.json, "require": { +# "php": ">=7.0", +# "ext-tokenizer": "*" +Requires: php(language) >= 7.0 +Requires: php-tokenizer +# From phpcompatinfo report for version 4.0.0 +Requires: php-reflection +Requires: php-ctype +Requires: php-json +Requires: php-pcre +Requires: php-spl +Requires: php-cli +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(%{gh_owner}/%{pk_project}) = %{version} + + +%description +This is a PHP parser written in PHP. +Its purpose is to simplify static code analysis and manipulation. + +This package provides the library version %{major} and the php-parse%{major} command. + +Documentation: https://github.com/nikic/PHP-Parser/tree/master/doc + +Autoloader: %{php_home}/%{ns_project}%{major}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +%patch -P0 -p1 -b .rpm + + +%build +: Generate an simple classmap autoloader +phpab --template fedora \ + --output lib/%{ns_project}/autoload.php \ + lib/%{ns_project} + + +%install +: Library +mkdir -p %{buildroot}%{php_home} +cp -pr lib/%{ns_project} %{buildroot}%{php_home}/%{ns_project}%{major} + +: Command +install -Dpm 0755 bin/php-parse %{buildroot}%{_bindir}/php-parse%{major} + + +%check +%if %{with tests} +: Test the command +sed -e 's:%{php_home}:%{buildroot}%{php_home}:' \ + bin/php-parse > bin/php-parse-test +php bin/php-parse-test --help + +: Test suite autoloader +mkdir vendor +cat << 'AUTOLOAD' | tee vendor/autoload.php + - 4.16.0-1 +- update to 4.16.0 + +* Wed May 24 2023 Remi Collet - 4.15.5-1 +- update to 4.15.5 + +* Mon Mar 6 2023 Remi Collet - 4.15.4-1 +- update to 4.15.4 + +* Tue Jan 17 2023 Remi Collet - 4.15.3-1 +- update to 4.15.3 + +* Mon Nov 14 2022 Remi Collet - 4.15.2-1 +- update to 4.15.2 + +* Thu Sep 8 2022 Remi Collet - 4.15.1-1 +- update to 4.15.1 + +* Mon Jun 13 2022 Remi Collet - 4.14.0-2 +- only run test suite on Fedora, not on EL + +* Wed Jun 1 2022 Remi Collet - 4.14.0-1 +- update to 4.14.0 + +* Wed Dec 1 2021 Remi Collet - 4.13.2-1 +- update to 4.13.2 + +* Thu Nov 4 2021 Remi Collet - 4.13.1-1 +- update to 4.13.1 + +* Tue Sep 21 2021 Remi Collet - 4.13.0-1 +- update to 4.13.0 + +* Wed Jul 21 2021 Remi Collet - 4.12.0-1 +- update to 4.12.0 + +* Wed Jul 21 2021 Remi Collet - 4.11.0-2 +- add upstream patches for PHP 8.1 + +* Mon Jul 5 2021 Remi Collet - 4.11.0-1 +- update to 4.11.0 +- switch to phpunit9 + +* Tue May 4 2021 Remi Collet - 4.10.5-1 +- update to 4.10.5 + +* Mon Dec 21 2020 Remi Collet - 4.10.4-1 +- update to 4.10.4 + +* Fri Dec 4 2020 Remi Collet - 4.10.3-1 +- update to 4.10.3 + +* Mon Sep 28 2020 Remi Collet - 4.10.2-1 +- update to 4.10.2 + +* Thu Sep 24 2020 Remi Collet - 4.10.1-1 +- update to 4.10.1 + +* Sun Sep 20 2020 Remi Collet - 4.10.0-1 +- update to 4.10.0 + +* Mon Aug 31 2020 Remi Collet - 4.9.1-1 +- update to 4.9.1 + +* Wed Aug 19 2020 Remi Collet - 4.9.0-1 +- update to 4.9.0 + +* Mon Aug 10 2020 Remi Collet - 4.8.0-1 +- update to 4.8.0 + +* Sun Jul 26 2020 Remi Collet - 4.7.0-1 +- update to 4.7.0 + +* Fri Jul 3 2020 Remi Collet - 4.6.0-1 +- update to 4.6.0 + +* Thu Jun 25 2020 Remi Collet - 4.5.0-2 +- switch to classmap autoloader +- add missing dependency on fedora/autoloader + +* Wed Jun 3 2020 Remi Collet - 4.5.0-1 +- update to 4.5.0 + +* Mon Apr 13 2020 Remi Collet - 4.4.0-1 +- update to 4.4.0 + +* Tue Nov 12 2019 Remi Collet - 4.3.0-1 +- update to 4.3.0 + +* Mon Oct 28 2019 Remi Collet - 4.2.5-1 +- update to 4.2.5 +- sources from git snapshot + +* Mon Sep 2 2019 Remi Collet - 4.2.4-1 +- update to 4.2.4 + +* Mon Aug 19 2019 Remi Collet - 4.2.3-1 +- update to 4.2.3 +- use phpunit8 + +* Mon May 27 2019 Remi Collet - 4.2.2-1 +- update to 4.2.2 + +* Mon Feb 18 2019 Remi Collet - 4.2.1-1 +- update to 4.2.1 + +* Sun Jan 13 2019 Remi Collet - 4.2.0-1 +- update to 4.2.0 + +* Thu Dec 27 2018 Remi Collet - 4.1.1-1 +- update to 4.1.1 + +* Wed Oct 10 2018 Remi Collet - 4.1.0-1 +- update to 4.1.0 +- https://github.com/nikic/PHP-Parser/issues/539 - PHP 7.3 + +* Tue Sep 18 2018 Remi Collet - 4.0.4-1 +- update to 4.0.4 + +* Mon Jul 16 2018 Remi Collet - 4.0.3-1 +- update to 4.0.3 + +* Mon Jun 4 2018 Remi Collet - 4.0.2-1 +- update to 4.0.2 + +* Mon Mar 26 2018 Remi Collet - 4.0.1-1 +- update to 4.0.1 + +* Thu Mar 22 2018 Remi Collet - 4.0.0-1 +- Update to 4.0.0 +- rename to php-nikic-php-parser4 and move to /usr/share/php/PhpParser4 +- raise dependency on PHP 7 +- use phpunit6 or phpunit7 (F28+) + +* Thu Mar 1 2018 Remi Collet - 3.1.5-1 +- Update to 3.1.5 + +* Fri Jan 26 2018 Remi Collet - 3.1.4-1 +- Update to 3.1.4 + +* Wed Dec 27 2017 Remi Collet - 3.1.3-1 +- Update to 3.1.3 + +* Mon Nov 6 2017 Remi Collet - 3.1.2-1 +- Update to 3.1.2 + +* Mon Sep 4 2017 Remi Collet - 3.1.1-1 +- Update to 3.1.1 + +* Sat Aug 5 2017 Remi Collet - 3.1.0-1 +- Update to 3.1.0 + +* Thu Jun 29 2017 Remi Collet - 3.0.6-1 +- Update to 3.0.6 + +* Mon Mar 6 2017 Remi Collet - 3.0.5-1 +- Update to 3.0.5 +- always provide the command, with version suffix + +* Sat Feb 11 2017 Remi Collet - 3.0.4-1 +- update to 3.0.4 + +* Sat Feb 4 2017 Remi Collet - 3.0.3-1 +- update to 3.0.3 + +* Wed Dec 7 2016 Remi Collet - 3.0.2-1 +- new package for library version 3 + -- cgit