summaryrefslogtreecommitdiff
blob: 25943e09fbc355962e1337873a0f00bb0d4735ae (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
46
47
48
49
50
51
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

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

DESCRIPTION="The Log framework provides an abstracted logging system"
HOMEPAGE="https://pear.php.net/package/Log"
SRC_URI="http://download.pear.php.net/package/${MY_P}.tgz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm ~hppa ~ia64 ppc ppc64 ~s390 sparc x86"
IUSE="examples test"
RESTRICT="!test? ( test )"

# The DB, Mail, and MDB2 dependencies are technically optional, but
# automagic. To avoid surprises, we require them unconditionally.
CDEPEND="dev-lang/php:*
	dev-php/PEAR-PEAR
	dev-php/PEAR-DB
	dev-php/PEAR-Mail
	dev-php/PEAR-MDB2"

BDEPEND="test? ( ${CDEPEND} )"

RDEPEND="${CDEPEND}"

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

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"
}

src_install() {
	dodoc docs/guide.txt misc/log.sql
	use examples && dodoc -r examples

	# I don't like installing "Log.php" right at the top-level, but any
	# packages depending on us will expect to find it there and not as
	# e.g. Log/Log.php.
	insinto "/usr/share/php/"
	doins Log.php
	doins -r Log
}