3 %bcond_with tests # build with tests
5 %define php_min_version 5.3.6
6 Summary: PHP Coding Standards Fixer
11 Group: Development/Languages/PHP
12 Source0: https://github.com/FriendsOfPHP/PHP-CS-Fixer/archive/v%{version}/%{name}-%{version}.tar.gz
13 # Source0-md5: 7cb0ac32777359db0f68025a881e4cb5
15 Patch0: autoload.patch
16 Patch1: allow-cache.patch
17 URL: http://cs.sensiolabs.org/
18 BuildRequires: rpm-php-pearprov >= 4.4.2-11
19 BuildRequires: rpmbuild(macros) >= 1.461
21 BuildRequires: %{php_name}-cli
22 BuildRequires: %{php_name}-ctype
23 BuildRequires: %{php_name}-phar
24 BuildRequires: %{php_name}-tokenizer
26 Requires: /usr/bin/php
27 Requires: php(core) >= %{php_min_version}
31 Requires: php(tokenizer)
32 Requires: php-sebastian-diff >= 1.1
33 Requires: php-symfony2-ClassLoader >= 2.7.7
34 Requires: php-symfony2-Console >= 2.3
35 Requires: php-symfony2-EventDispatcher >= 2.1
36 Requires: php-symfony2-Finder >= 2.1
37 Requires: php-symfony2-Process >= 2.3
38 Requires: php-symfony2-Stopwatch >= 2.5
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 The PHP Coding Standards Fixer tool fixes most issues in your code
44 when you want to follow the PHP coding standards as defined in the
45 PSR-1 and PSR-2 documents.
47 If you are already using PHP_CodeSniffer to identify coding standards
48 problems in your code, you know that fixing them by hand is tedious,
49 especially on large projects. This tool does the job for you.
52 %setup -qn PHP-CS-Fixer-%{version}
56 mv Symfony/CS/Resources/phar-stub.php .
57 cp -p %{SOURCE1} Symfony/CS/autoload.php
60 ver=$(awk -F"'" '/const VERSION/{print $(NF-1)}' Symfony/CS/Fixer.php)
61 test "$ver" = %{version}
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Symfony/CS}
66 cp -a Symfony $RPM_BUILD_ROOT%{php_data_dir}
67 install -p php-cs-fixer $RPM_BUILD_ROOT%{_bindir}/%{name}
70 rm -rf $RPM_BUILD_ROOT
73 %defattr(644,root,root,755)
74 %attr(755,root,root) %{_bindir}/%{name}
75 %{php_data_dir}/Symfony/CS