diff --git a/php-PHPParser.spec b/php-PHPParser.spec index d7630df..aef6ac0 100644 --- a/php-PHPParser.spec +++ b/php-PHPParser.spec @@ -1,7 +1,7 @@ # # RPM spec file for php-PHPParser # -# Copyright (c) 2012-2021 Shawn Iwinski +# Copyright (c) 2012-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -9,9 +9,6 @@ # Please preserve changelog entries # -# Outdated, see php-nikic-php-parser4 -%bcond_with tests - %global github_owner nikic %global github_name PHP-Parser %global github_version 1.4.1 @@ -23,13 +20,18 @@ %global php_min_ver 5.3 +%if 0 +%global script 1 +%else +%global script 0 +%endif + Name: php-%{lib_name_old} Version: %{github_version} -Release: 25%{?dist} +Release: 13%{?dist} Summary: A PHP parser written in PHP - version 1 -# Automatically converted from old format: BSD - review is highly recommended. -License: LicenseRef-Callaway-BSD +License: BSD URL: https://github.com/%{github_owner}/%{github_name} # Upstream tarball don't provide test suite # Use mksrc.sh to generate a git snapshot tarball @@ -42,9 +44,7 @@ Patch0: %{name}-command.patch BuildArch: noarch # For tests BuildRequires: php(language) >= %{php_min_ver} -%if %{with tests} BuildRequires: %{_bindir}/phpunit -%endif # For tests: phpcompatinfo (computed from version 1.4.1) BuildRequires: php-ctype BuildRequires: php-filter @@ -63,24 +63,30 @@ Requires: php-pcre Requires: php-spl Requires: php-xmlreader Requires: php-xmlwriter +%if %{script} +Requires: php-cli +%endif Provides: php-composer(nikic/php-parser) = %{version} %description A PHP parser written in PHP to simplify static analysis and code manipulation. - +%if %{script} +This package provides the library version 1 and the php-parse command. +The php-nikic-php-parser package provides the library version 2. +%else This package provides the library version 1. -The php-nikic-php-parser3 package provides the library version 3. -The php-nikic-php-parser4 package provides the library version 4. - +The php-nikic-php-parser package provides the library version 2 +and the php-parse command. +%endif Autoloader: '%{_datadir}/php/%{lib_name}/autoload.php'; %prep %setup -q -n %{github_name}-%{github_short} -%patch -P0 -p0 -b .rpm +%patch0 -p0 -b .rpm rm lib/%{lib_name}/*rpm @@ -97,63 +103,30 @@ mkdir -p -m 755 %{buildroot}%{_datadir}/php/%{lib_name_old} ln -s ../%{lib_name}/Autoloader.php \ %{buildroot}%{_datadir}/php/%{lib_name_old}/Autoloader.php +%if %{script} +install -Dpm 755 bin/php-parse.php %{buildroot}%{_bindir}/php-parse +%endif + %check -%if %{with tests} %{_bindir}/phpunit \ --bootstrap %{buildroot}%{_datadir}/php/%{lib_name}/autoload.php \ --filter '^((?!(testResolveLocations)).)*$' \ --verbose -%else -: Test suite disabled -%endif %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md doc grammar composer.json +%if %{script} +%{_bindir}/php-parse +%endif %{_datadir}/php/%{lib_name_old} %{_datadir}/php/%{lib_name} %changelog -* Fri Jul 25 2025 Fedora Release Engineering - 1.4.1-25 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sat Jan 18 2025 Fedora Release Engineering - 1.4.1-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Wed Sep 4 2024 Miroslav Suchý - 1.4.1-23 -- convert license to SPDX - -* Fri Jul 19 2024 Fedora Release Engineering - 1.4.1-22 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Thu Jan 25 2024 Fedora Release Engineering - 1.4.1-21 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sun Jan 21 2024 Fedora Release Engineering - 1.4.1-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jul 21 2023 Fedora Release Engineering - 1.4.1-19 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Fri Jan 20 2023 Fedora Release Engineering - 1.4.1-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Fri Jul 22 2022 Fedora Release Engineering - 1.4.1-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Jan 21 2022 Fedora Release Engineering - 1.4.1-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 1.4.1-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Mar 30 2021 Remi Collet - 1.4.1-14 -- outdated package, disable test suite - * Wed Jan 27 2021 Fedora Release Engineering - 1.4.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild