dev-qt/qtxml: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-im / coturn / coturn-4.5.1.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit eutils systemd tmpfiles
6 DESCRIPTION="coturn TURN server project"
7 HOMEPAGE="https://github.com/coturn/coturn"
8
9 if [ ${PV} = 9999 ]; then
10         KEYWORDS=""
11         EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
12         inherit git-r3
13         DEPEND="dev-vcs/git"
14 #       S="${WORKDIR}/${PN}-master"
15 else
16         KEYWORDS="~amd64 ~x86"
17         SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
18 fi
19
20 LICENSE="BSD"
21 SLOT="0"
22 IUSE="mongodb mysql postgres redis sqlite"
23 RDEPEND="acct-group/turnserver
24          acct-user/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 )"
31
32 DEPEND="${RDEPEND}"
33
34 src_configure() {
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
41         fi
42         if ! use mysql; then
43                 export TURN_NO_MYSQL=yes
44         fi
45         if ! use postgres; then
46                 export TURN_NO_PQ=yes
47         fi
48         if ! use redis; then
49                 export TURN_NO_HIREDIS=yes
50         fi
51         if ! use sqlite; then
52                 export TURN_NO_SQLITE=yes
53         fi
54
55         econf $(use_with sqlite)
56 }
57
58 src_install() {
59         default
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"
65 }
66
67 pkg_postinst() {
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."
71 }