*/*: [QA] Use consistent function definition formatting
[gentoo.git] / dev-php / recaptcha / recaptcha-1.2.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 DESCRIPTION="PHP client library for Google's reCAPTCHA service"
7 HOMEPAGE="https://github.com/google/recaptcha"
8 SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
9
10 LICENSE="BSD"
11 SLOT="0"
12 KEYWORDS="amd64 x86"
13 IUSE="examples test"
14 RESTRICT="!test? ( test )"
15
16 RDEPEND="dev-lang/php"
17 BDEPEND="test? ( ${RDEPEND} dev-php/phpunit )"
18
19 src_install() {
20         insinto "/usr/share/php/${PN}"
21         doins -r src/autoload.php src/ReCaptcha
22         dodoc CONTRIBUTING.md README.md
23         use examples && dodoc -r examples
24 }
25
26 src_test() {
27         phpunit || die "test suite failed"
28 }
29
30 pkg_postinst() {
31         elog "${PN} has been installed in /usr/share/php/${PN}/."
32         elog "To use it in a script, require('${PN}/autoload.php'),"
33         elog "and then use the ${PN} class normally. Most of the examples in"
34         elog "the documentation should work without further modification."
35 }