summaryrefslogtreecommitdiff
blob: 06daf4b9249fffb26af7d14dff6a1ab164f25532 (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
57
58
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit webapp

DESCRIPTION="An open-source PHP-based bulletin board package"
HOMEPAGE="https://www.phpbb.com/"
SRC_URI="https://download.phpbb.com/pub/release/$(ver_cut 1-2)/${PV}/${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~sparc ~x86"
IUSE="ftp gd mssql mysqli postgres sqlite zlib"
REQUIRED_USE="|| ( mssql mysqli postgres sqlite )"

PHP_RDEPEND="(
	virtual/httpd-php:@SLOT@
	dev-lang/php:@SLOT@[ftp?,gd?,json(+),mssql?,mysqli?,postgres?,sqlite?,xml,zlib?]
)"

RDEPEND="|| (
	${PHP_RDEPEND//@SLOT@/8.1}
	${PHP_RDEPEND//@SLOT@/8.0}
	${PHP_RDEPEND//@SLOT@/7.4}
	${PHP_RDEPEND//@SLOT@/7.3}
)"

need_httpd_cgi

S="${WORKDIR}/${PN}${PV%%.*}"

src_install() {
	webapp_src_preinst

	insinto "${MY_HTDOCSDIR}"
	doins -r .

	webapp_configfile  "${MY_HTDOCSDIR}"/config.php
	webapp_hook_script "${FILESDIR}"/permissions
	webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
	webapp_src_install

	# phpBB needs docs together with the other files.
	dosym ../webapps/${PN}/${SLOT}/htdocs/docs /usr/share/doc/${PF}
}

pkg_postinst() {
	einfo "phpBB needs a specific web server configuration. For Apache httpd, an"
	einfo "example configuration is provided via .htaccess files. For lighttpd and"
	einfo "NGINX, example configuration files can be found in the documentation."

	if use vhosts; then
		echo
		ewarn "When installing with webapp-config, specify a group that includes your"
		ewarn "PHP user with the -g option. It will default to the web server group"
		ewarn "when running webapp-config as root."
	fi
}