Name: phan Version: 6.0.7 Release: 1%{?dist} Summary: Static analyzer for PHP License: Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND OSL-3.0 URL: https://github.com/phan/phan Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/phan-%{version}.tar.gz Source1: phan-%{version}-vendor.tar.bz2 Source2: _phan Source3: phansnippet.vim Source4: phan-php.vim Source5: phan-pylint.vim Source6: phan.bash BuildArch: noarch BuildRequires: php-cli >= 8.1 BuildRequires: php-ast Requires: php-cli >= 8.1 Requires: php-ast Recommends: php-phan-helpers Provides: bundled(php-composer(composer/pcre)) = 3.3.2 Provides: bundled(php-composer(composer/semver)) = 3.4.4 Provides: bundled(php-composer(composer/xdebug-handler)) = 3.0.5 Provides: bundled(php-composer(danog/advanced-json-rpc)) = 3.2.1 Provides: bundled(php-composer(doctrine/deprecations)) = 1.1.5 Provides: bundled(php-composer(netresearch/jsonmapper)) = 4.5.0 Provides: bundled(php-composer(phan/tolerant-php-parser)) = 0.2.0 Provides: bundled(php-composer(phan/var_representation_polyfill)) = 0.1.4 Provides: bundled(php-composer(phpdocumentor/reflection-common)) = 2.2.0 Provides: bundled(php-composer(phpdocumentor/reflection-docblock)) = 5.6.6 Provides: bundled(php-composer(phpdocumentor/type-resolver)) = 1.12.0 Provides: bundled(php-composer(phpstan/phpdoc-parser)) = 2.3.2 Provides: bundled(php-composer(psr/container)) = 2.0.2 Provides: bundled(php-composer(psr/log)) = 3.0.2 Provides: bundled(php-composer(sabre/event)) = 6.0.1 Provides: bundled(php-composer(symfony/console)) = 6.4.32 Provides: bundled(php-composer(symfony/deprecation-contracts)) = 3.6.0 Provides: bundled(php-composer(symfony/polyfill-ctype)) = 1.33.0 Provides: bundled(php-composer(symfony/polyfill-intl-grapheme)) = 1.33.0 Provides: bundled(php-composer(symfony/polyfill-intl-normalizer)) = 1.33.0 Provides: bundled(php-composer(symfony/polyfill-mbstring)) = 1.33.0 Provides: bundled(php-composer(symfony/service-contracts)) = 3.6.1 Provides: bundled(php-composer(symfony/string)) = 6.4.30 Provides: bundled(php-composer(webmozart/assert)) = 1.12.1 %global debug_package %{nil} %description Phan is a static analyzer for PHP that prefers to minimize false positives. It checks for type errors, dead/unreachable code, and many other bug categories, using the php-ast extension to parse code. %prep %autosetup -n phan-%{version} # vendor/ is regenerated into Source1 at `make srpm` time (offline-gate rule). tar -xf %{S:1} %build # Nothing to compile — phan is plain PHP and vendor/ is pre-bundled (Source1). %install install -d %{buildroot}%{_datadir}/phan # Ship all three CLIs, the src tree, internal/ stubs, and .phan/ (the builtin # analysis plugins phan loads at runtime from .phan/plugins), plus the vendored # vendor/. phan's bins do `require __DIR__/src/phan.php`, so they sit beside src/. cp -a phan phan_client tocheckstyle src internal .phan vendor \ %{buildroot}%{_datadir}/phan/ # Strip VCS and dev-tool artifacts from the vendored tree. find %{buildroot}%{_datadir}/phan/vendor \ \( -name '.gitignore' -o -name '.github' -o -name '.phpdoc' \ -o -name '.php-cs-fixer.php' \) -exec rm -rf {} + install -d %{buildroot}%{_bindir} ln -s %{_datadir}/phan/phan %{buildroot}%{_bindir}/phan ln -s %{_datadir}/phan/phan_client %{buildroot}%{_bindir}/phan_client ln -s %{_datadir}/phan/tocheckstyle %{buildroot}%{_bindir}/tocheckstyle # zsh completion (export-ignored upstream; from Source2) install -Dpm0644 %{SOURCE2} %{buildroot}%{zsh_completions_dir}/_phan # bash completion (export-ignored upstream; from Source6) install -Dpm0644 %{SOURCE6} %{buildroot}%{bash_completions_dir}/phan # vim integration (export-ignored upstream; opt-in, under the pkg datadir) install -Dpm0644 %{SOURCE3} %{buildroot}%{_datadir}/phan/plugins/vim/phansnippet.vim install -Dpm0644 %{SOURCE4} %{buildroot}%{_datadir}/phan/plugins/vim/syntax/php.vim install -Dpm0644 %{SOURCE5} %{buildroot}%{_datadir}/phan/plugins/vim/syntax/pylint.vim %check # Use the buildroot path directly; the /usr/bin symlink resolves to install # destination which doesn't exist yet at check time. php %{buildroot}%{_datadir}/phan/phan --version %files %license LICENSE LICENSE.LANGUAGE_SERVER LICENSE.PHP_PARSER LICENSE.PHPSTORM_STUBS %doc README.md NEWS.md Phan-AGENTS.md V6_GENERICS.md MAINTAINERS.md %{_bindir}/phan %{_bindir}/phan_client %{_bindir}/tocheckstyle %{bash_completions_dir}/phan %{zsh_completions_dir}/_phan %{_datadir}/phan/ %changelog * Wed Jun 24 2026 Bahtiar `kalkin-` Gadimov - 6.0.7-1 - Initial package