summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-12-13 15:01:57 +0100
committerRemi Collet <remi@php.net>2022-12-13 15:01:57 +0100
commit44b20805b049de55d10363b06bb658e41ba4c775 (patch)
tree09c887f84020c0e72a477b236be2e1db41e92793
parent6bec1b42ad6f06d81743313c89e02b6e986651eb (diff)
update to 2.0.0
rename to php-doctrine-lexer2 install in /usr/share/php/Doctrine/Common/Lexer2
-rw-r--r--composer.json37
-rw-r--r--php-doctrine-lexer2.spec54
2 files changed, 68 insertions, 23 deletions
diff --git a/composer.json b/composer.json
index c435647..be3013c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,8 @@
{
"name": "doctrine/lexer",
- "type": "library",
"description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
+ "license": "MIT",
+ "type": "library",
"keywords": [
"php",
"parser",
@@ -9,27 +10,41 @@
"annotations",
"docblock"
],
- "homepage": "https://www.doctrine-project.org/projects/lexer.html",
- "license": "MIT",
"authors": [
- {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
- {"name": "Roman Borschel", "email": "roman@code-factory.org"},
- {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
],
+ "homepage": "https://www.doctrine-project.org/projects/lexer.html",
"require": {
- "php": "^7.1 || ^8.0"
+ "php": "^7.1 || ^8.0",
+ "doctrine/deprecations": "^1.0"
},
"require-dev": {
- "doctrine/coding-standard": "^9.0",
+ "doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.11"
+ "psalm/plugin-phpunit": "^0.18.3",
+ "vimeo/psalm": "^4.11 || ^5.0"
},
"autoload": {
- "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" }
+ "psr-4": {
+ "Doctrine\\Common\\Lexer\\": "src"
+ }
},
"autoload-dev": {
- "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine" }
+ "psr-4": {
+ "Doctrine\\Tests\\Common\\Lexer\\": "tests"
+ }
},
"config": {
"allow-plugins": {
diff --git a/php-doctrine-lexer2.spec b/php-doctrine-lexer2.spec
index 282bf17..785c83b 100644
--- a/php-doctrine-lexer2.spec
+++ b/php-doctrine-lexer2.spec
@@ -12,9 +12,10 @@
# Github
%global github_owner doctrine
%global github_name lexer
-%global github_version 1.2.3
-%global github_commit c268e882d4dbdd85e36e4ad69e02dc284f89d229
+%global github_version 2.0.0
+%global github_commit 3cf140b81e55d5d640f73367d829db7e3023ef69
%global github_short %(c=%{github_commit}; echo ${c:0:7})
+%global major 2
# Namespace
%global ns_vendor Doctrine
%global ns_project Common
@@ -29,7 +30,7 @@
%{!?phpdir: %global phpdir %{_datadir}/php}
%global with_tests 0%{!?_without_tests:1}
-Name: php-%{composer_vendor}-%{composer_project}
+Name: php-%{composer_vendor}-%{composer_project}%{major}
Version: %{github_version}
Release: 1%{?github_release}%{?dist}
Summary: Base library for a lexer that can be used in top-down, recursive descent parsers
@@ -43,7 +44,14 @@ Source1: makesrc.sh
BuildArch: noarch
BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
+# remirepo:1
BuildRequires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires:(php-composer(doctrine/deprecations) >= 1.0 with php-composer(doctrine/deprecations) < 2)
+# remirepo:2
+%else
+BuildRequires: php-doctrine-deprecations >= 1.0
+%endif
BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: phpunit9
@@ -51,6 +59,13 @@ BuildRequires: phpunit9
# composer.json
Requires: php(language) >= %{php_min_ver}
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(doctrine/deprecations) >= 1.0 with php-composer(doctrine/deprecations) < 2)
+# remirepo:2
+%else
+Requires: php-doctrine-deprecations >= 1.0
+%endif
# phpcompatinfo (computed from version 1.1.0)
Requires: php-pcre
Requires: php-reflection
@@ -66,6 +81,8 @@ parsers.
This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL).
+This package provides %{composer_vendor}/%{composer_project} version %{major}.
+
Autoloader: %{phpdir}/%{ns_vendor}/%{ns_project}/%{ns_subproj}/autoload.php
@@ -76,14 +93,22 @@ Autoloader: %{phpdir}/%{ns_vendor}/%{ns_project}/%{ns_subproj}/autoload.php
%build
: Generate a simple autoloader
%{_bindir}/phpab \
- --output lib/%{ns_vendor}/%{ns_project}/%{ns_subproj}/autoload.php \
+ --output src/autoload.php \
--template fedora \
- lib/%{ns_vendor}/%{ns_project}
+ src
+
+cat << 'EOF' | tee -a src/autoload.php
+
+// Dependencies
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/%{ns_vendor}/Deprecations/autoload.php',
+]);
+EOF
%install
-mkdir -p %{buildroot}%{phpdir}
-cp -rp lib/* %{buildroot}%{phpdir}/
+mkdir -p %{buildroot}%{phpdir}/%{ns_vendor}/%{ns_project}
+cp -rp src %{buildroot}%{phpdir}/%{ns_vendor}/%{ns_project}/%{ns_subproj}%{major}
%check
@@ -96,14 +121,14 @@ mkdir vendor
tests
cat << 'EOF' | tee -a vendor/autoload.php
-require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_subproj}/autoload.php";
+require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_subproj}%{major}/autoload.php";
EOF
# we don't want PHPStan (which pull nette framework)
: Run test suite
ret=0
-for cmd in php php74 php80 php81; do
+for cmd in php php80 php81 php82; do
if which $cmd; then
$cmd %{_bindir}/phpunit9 \
--bootstrap vendor/autoload.php \
@@ -117,16 +142,21 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
-%dir %{_datadir}/php/Doctrine
-%dir %{_datadir}/php/Doctrine/Common
- %{_datadir}/php/Doctrine/Common/Lexer
+%dir %{_datadir}/php/%{ns_vendor}/%{ns_project}
+ %{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_subproj}%{major}
%changelog
+* Tue Dec 13 2022 Remi Collet <remi@remirepo.net> - 2.0.0-1
+- update to 2.0.0
+- rename to php-doctrine-lexer2
+- install in /usr/share/php/Doctrine/Common/Lexer2
+
* Mon Feb 28 2022 Remi Collet <remi@remirepo.net> - 1.2.3-1
- update to 1.2.3