]> git.pld-linux.org Git - packages/php-cs-fixer.git/blob - php-cs-fixer.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/php-cs-fixer.git] / php-cs-fixer.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build with tests
4
5 %define         php_min_version 5.3.6
6 Summary:        PHP Coding Standards Fixer
7 Name:           php-cs-fixer
8 Version:        1.13.3
9 Release:        1
10 License:        MIT
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
14 Source1:        autoload.php
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
20 %if %{with tests}
21 BuildRequires:  %{php_name}-cli
22 BuildRequires:  %{php_name}-ctype
23 BuildRequires:  %{php_name}-phar
24 BuildRequires:  %{php_name}-tokenizer
25 %endif
26 Requires:       /usr/bin/php
27 Requires:       php(core) >= %{php_min_version}
28 Requires:       php(ctype)
29 Requires:       php(phar)
30 Requires:       php(posix)
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
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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.
46
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.
50
51 %prep
52 %setup -qn PHP-CS-Fixer-%{version}
53 %patch0 -p1
54 %patch1 -p1
55
56 mv Symfony/CS/Resources/phar-stub.php .
57 cp -p %{SOURCE1} Symfony/CS/autoload.php
58
59 %build
60 ver=$(awk -F"'" '/const VERSION/{print $(NF-1)}' Symfony/CS/Fixer.php)
61 test "$ver" = %{version}
62
63 %install
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}
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %files
73 %defattr(644,root,root,755)
74 %attr(755,root,root) %{_bindir}/%{name}
75 %{php_data_dir}/Symfony/CS
This page took 0.099143 seconds and 4 git commands to generate.