blob: 531fc842611f495529457fc968896cc336afc415 (
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
52
53
54
55
56
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=9
DESCRIPTION="A template engine for PHP"
HOMEPAGE="https://www.smarty.net/ https://github.com/smarty-php/smarty/"
SRC_URI="https://github.com/smarty-php/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc64 ~riscv ~sparc ~x86"
IUSE="doc examples"
# PHP unicode support is detected at runtime, and the cached templates
# that smarty generates depend on it. If, later on, PHP is reinstalled
# without unicode support, all of the previously-generated cached
# templates will begin to throw 500 errrors for missing mb_foo
# functions. See bug #532618.
RDEPEND="dev-lang/php:*[unicode]"
src_prepare() {
default
# Prepare the docs and examples for easy dodocing.
rm docs/_config.yml || die
mv -v demo examples || die
}
src_install() {
insinto "/usr/share/php/${PN}"
doins -r libs src
local DOCS=(
CHANGELOG.md
CONTRIBUTING.md
README.md
SECURITY.md
TODO.txt
)
use doc && dodoc -r docs/*
use examples && dodoc -r examples
einstalldocs
}
pkg_postinst() {
elog "${PN} has been installed in /usr/share/php/${PN}/."
elog
elog 'To use it in your scripts, include the Smarty.class.php file'
elog "from the \"${PN}\" directory; for example,"
elog
elog " require('${PN}/libs/Smarty.class.php');"
elog
elog 'After that, the Smarty class will be available to you.'
}
|