1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils systemd tmpfiles
6 DESCRIPTION="coturn TURN server project"
7 HOMEPAGE="https://github.com/coturn/coturn"
9 if [ ${PV} = 9999 ]; then
11 EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
14 # S="${WORKDIR}/${PN}-master"
16 KEYWORDS="~amd64 ~x86"
17 SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
22 IUSE="mongodb mysql postgres redis sqlite"
23 RDEPEND="acct-group/turnserver
25 || ( dev-libs/libevent[-ssl,libressl] dev-libs/libevent[ssl,-libressl] >dev-libs/libevent-2.1.8[ssl,libressl] )
26 mongodb? ( dev-libs/mongo-c-driver )
27 mysql? ( dev-db/mysql-connector-c )
28 postgres? ( dev-db/postgresql:* )
29 redis? ( dev-libs/hiredis )
30 sqlite? ( dev-db/sqlite )"
35 sed 's:#log-file=/var/tmp/turn.log:log-file=/var/log/turnserver.log:' \
36 -i "${S}/examples/etc/turnserver.conf" || die "sed for logdir failed"
37 sed 's:#simple-log:simple-log:' -i "${S}/examples/etc/turnserver.conf" \
38 || die "sed for simple-log failed"
39 if ! use mongodb; then
40 export TURN_NO_MONGO=yes
43 export TURN_NO_MYSQL=yes
45 if ! use postgres; then
49 export TURN_NO_HIREDIS=yes
52 export TURN_NO_SQLITE=yes
55 econf $(use_with sqlite)
60 newinitd "${FILESDIR}/turnserver.init" turnserver
61 insinto /etc/logrotate.d
62 newins "${FILESDIR}/logrotate.${PN}" "${PN}"
63 systemd_dounit "${FILESDIR}/${PN}.service"
64 dotmpfiles "${FILESDIR}/${PN}.conf"
68 tmpfiles_process "${PN}.conf"
69 elog "You need to copy /etc/turnserver.conf.default to"
70 elog "/etc/turnserver.conf and do your settings there."