2 # - save config to /etc:
3 # $ phpcs --config-set default_standard PEAR
4 # PHP Warning: file_put_contents(/usr/share/pear/data/PHP_CodeSniffer/CodeSniffer.conf): failed to open stream: Permission denied in /usr/share/pear/PHP/CodeSniffer.php on line 1532
5 %define pearname PHP_CodeSniffer
6 %define php_min_version 5.4.0
7 %include /usr/lib/rpm/macros.php
8 Summary: PHP_CodeSniffer tokenises PHP code and detects violations of a defined set of coding standards
9 Summary(pl.UTF-8): PHP_CodeSniffer analizuje kod PHP pod kątem naruszeń zdefiniowanych standardów kodowania
14 Group: Development/Languages/PHP
15 Source0: https://pear.php.net/get/%{pearname}-%{version}.tgz
16 # Source0-md5: daedf0015977e8d398f381bb2e05ae6b
17 URL: https://github.com/squizlabs/PHP_CodeSniffer
18 BuildRequires: php-pear-PEAR
19 BuildRequires: rpm-php-pearprov >= 4.4.2-11
20 BuildRequires: rpmbuild(macros) >= 1.580
21 Requires: php(core) >= %{php_min_version}
27 Requires: php(simplexml)
29 Requires: php(tokenizer)
30 Requires: php(xmlwriter)
32 Provides: php-pear-PHP_CodeSniffer = 1:%{version}-%{release}
33 Obsoletes: php-pear-PHP_CodeSniffer
34 Obsoletes: php-pear-PHP_CodeSniffer-tests
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script
40 that tokenizes PHP, JavaScript and CSS files to detect violations of a
41 defined coding standard, and a second phpcbf script to automatically
42 correct coding standard violations. PHP_CodeSniffer is an essential
43 development tool that ensures your code remains clean and consistent.
45 %description -l pl.UTF-8
46 PHP_CodeSniffer jest skryptem PHP5 służącym do rozkładu tekstu kodu
47 PHP w celu wykrycia naruszeń pewnych zdefiniowanych standardów
48 kodowania. Jest to istotne narzędzie, dzięki któremu można zapewnić
49 czystość i spójność kodu. Może także pomóc w zapobieganiu popełniania
50 przez programistów pewnych częstych błędów semantycznych.
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir}}
60 install -p .%{_bindir}/* $RPM_BUILD_ROOT%{_bindir}
63 rm -rf $RPM_BUILD_ROOT
66 %defattr(644,root,root,755)
68 %{php_pear_dir}/.registry/*.reg
69 %attr(755,root,root) %{_bindir}/phpcs
70 %attr(755,root,root) %{_bindir}/phpcbf
71 %{php_pear_dir}/PHP/CodeSniffer
72 %{php_pear_dir}/data/PHP_CodeSniffer