1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 DESCRIPTION="Detect violations of PHP code standards"
8 HOMEPAGE="https://github.com/squizlabs/PHP_CodeSniffer"
9 SRC_URI="https://github.com/squizlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
16 DEPEND="test? ( >=dev-php/phpunit-4 )"
17 RDEPEND="dev-lang/php:*[cli,tokenizer,xmlwriter]"
19 DOCS=( CONTRIBUTING.md README.md )
21 insinto "/usr/share/${PN}"
22 doins -r CodeSniffer CodeSniffer.php
24 # These load code via relative paths, so they have to be symlinked
26 exeinto "/usr/share/${PN}/scripts"
27 for script in phpcbf phpcs; do
28 doexe "scripts/${script}"
29 dosym "/usr/share/${PN}/scripts/${script}" "/usr/bin/${script}"
35 # The test suite isn't part of the tarball at the moment, keep an eye on
36 # https://github.com/squizlabs/PHP_CodeSniffer/issues/548
39 phpunit || die "test suite failed"