summaryrefslogtreecommitdiff
blob: b9194e0e267ebff5011474e43e3dde0cc0050c25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

MY_PN="${PN/PEAR-/}"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="A class that facillitates the search of filesystems"
HOMEPAGE="http://pear.php.net/package/${MY_PN}"
SRC_URI="http://download.pear.php.net/package/${MY_P}.tgz"
LICENSE="PHP-3.01"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ia64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="test"

# Really only needs PEAR-Exception at runtime.
RDEPEND="dev-lang/php:*
	dev-php/PEAR-PEAR"
DEPEND="test? ( dev-php/PEAR-PEAR )"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	eapply_user

	# Without this sed, the test suite will try (and fail) to mess
	# around in /tmp.
	sed -i "s~'/tmp'~'${T}'~" tests/setup.php \
		|| die 'failed to fix temporary directory in tests/setup.php'
}

src_install() {
	insinto /usr/share/php
	doins -r File
}

src_test() {
	# Requires the "pear" executable from dev-php/PEAR-PEAR.
	pear run-tests tests || die

	# The command succeeds regardless of whether or not the test suite
	# passed, but this file is only written when there was a failure.
	[[ -f run-tests.log ]] && die "test suite failed"
}