+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+DESCRIPTION="PHP client library for Google's reCAPTCHA service"
+HOMEPAGE="https://github.com/google/recaptcha/"
+COMMIT="e90c632d22c1f349fa22d60f69e272fd4bd244ae"
+SRC_URI="https://github.com/google/recaptcha/archive/${COMMIT}.zip"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND="app-arch/zip
+ test? ( >=dev-php/phpunit-4 )"
+RDEPEND="dev-lang/php"
+
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+src_test(){
+ phpunit || die "test suite failed"
+}
+
+src_install(){
+ insinto "/usr/share/php/${PN}"
+ doins src/autoload.php
+ doins -r src/ReCaptcha
+
+ dodoc CONTRIBUTING.md README.md
+ dodoc -r examples
+}
+
+pkg_postinst(){
+ elog "${PN} has been installed in /usr/share/php/${PN}/."
+ elog
+ elog 'To use it in your scripts, include the autoload.php file'
+ elog "from the \"${PN}\" directory; for example,"
+ elog
+ elog " require('${PN}/autoload.php');"
+ elog
+ elog 'After that, the ReCaptcha class will be available to you.'
+}