# # RPM spec file for php-PHPParser # # Copyright (c) 2012-2021 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT # # 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 %global github_commit f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51 %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global lib_name PhpParser %global lib_name_old PHPParser %global php_min_ver 5.3 Name: php-%{lib_name_old} Version: %{github_version} Release: 14%{?dist} Summary: A PHP parser written in PHP - version 1 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 Source0: %{name}-%{github_version}-%{github_short}.tgz Source1: makesrc.sh # Patch for distribution 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 BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-tokenizer BuildRequires: php-xmlreader BuildRequires: php-xmlwriter # composer.json Requires: php(language) >= %{php_min_ver} Requires: php-tokenizer # phpcompatinfo (computed from version 1.4.1) Requires: php-filter Requires: php-pcre Requires: php-spl Requires: php-xmlreader Requires: php-xmlwriter Provides: php-composer(nikic/php-parser) = %{version} %description A PHP parser written in PHP to simplify static analysis and code manipulation. 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. Autoloader: '%{_datadir}/php/%{lib_name}/autoload.php'; %prep %setup -q -n %{github_name}-%{github_short} %patch0 -p0 -b .rpm rm lib/%{lib_name}/*rpm %build # Empty build section, nothing to build %install mkdir -p -m 755 %{buildroot}%{_datadir}/php cp -rp lib/%{lib_name} %{buildroot}%{_datadir}/php/%{lib_name} # Compat with old version (< 1.0.0) mkdir -p -m 755 %{buildroot}%{_datadir}/php/%{lib_name_old} ln -s ../%{lib_name}/Autoloader.php \ %{buildroot}%{_datadir}/php/%{lib_name_old}/Autoloader.php %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 %{_datadir}/php/%{lib_name_old} %{_datadir}/php/%{lib_name} %changelog * Tue Mar 30 2021 Remi Collet - 1.4.1-14 - outdated package, disable test suite * Tue Feb 4 2020 Remi Collet - 1.4.1-11 - skip 1 failed test with 7.4 * Fri May 20 2016 Remi Collet - 1.4.1-4 - drop the php-parse command, provided by php-nikic-php-parser * Sun Sep 20 2015 Remi Collet - 1.4.1-1 - update to 1.4.1 * Sun Aug 9 2015 Remi Collet - 1.4.0-1 - update to 1.4.0 - add a simple autoload.php * Mon May 4 2015 Remi Collet - 1.3.0-1 - update to 1.3.0 * Sat Apr 4 2015 Remi Collet - 1.2.2-1 - update to 1.2.2 * Wed Feb 25 2015 Remi Collet - 1.1.0-2 - provide the php-parse command * Wed Feb 25 2015 Remi Collet - 1.1.0-1 - update to 1.1.0 - use git snapshot as upstream tarball don't provide the test suite * Wed Nov 5 2014 Remi Collet 1.0.2-1 - Update to 1.0.2 * Thu Oct 16 2014 Remi Collet 1.0.1-1 - Update to 1.0.1 * Fri Sep 12 2014 Remi Collet 1.0.0-1 - Update to 1.0.0 * Wed Jul 23 2014 Remi Collet 1.0.0-0.2.beta1 - composer dependencies - fix license handling * Mon May 12 2014 Remi Collet 1.0.0-0.1.beta1 - Update to 1.0.0beta1 - library in /usr/share/php/PhpParser - provide /usr/share/php/PHPParser/Autoloader.php for compatibility - drop dependencies on xmlreader and xmlwriter * Sat Nov 16 2013 Remi Collet 0.9.4-1 - backport 0.9.4 for remi repo. * Fri Nov 15 2013 Shawn Iwinski 0.9.4-1 - Updated to 0.9.4 - Spec cleanup * Tue Jan 8 2013 Remi Collet 0.9.3-2 - backport 0.9.3 for remi repo. * Mon Dec 31 2012 Shawn Iwinski 0.9.3-2 - Added php_min_ver - Fixed requires for php_min_ver and non-Fedora * Thu Dec 20 2012 Shawn Iwinski 0.9.3-1 - Initial package