gentoo/media-sound/teamspeak-server-bin/teamspeak-server-bin-3.0.13.4.ebuild

93 lines
2.6 KiB
Bash
Raw Normal View History

# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit eutils multilib systemd user versionator
MY_PV="$(get_version_component_range 1-4)-Beta-$(get_version_component_range 5)"
DESCRIPTION="Voice Communication Software - Server"
HOMEPAGE="http://www.teamspeak.com/"
if [[ ${PV} != "*_beta*" ]] ; then
SRC_URI="
amd64? ( http://dl.4players.de/ts/releases/${PV}/teamspeak3-server_linux_amd64-${PV}.tar.bz2 )
x86? ( http://dl.4players.de/ts/releases/${PV}/teamspeak3-server_linux_x86-${PV}.tar.bz2 )"
else
SRC_URI="
amd64? ( http://dl.4players.de/ts/releases/pre_releases/server/${MY_PV}/teamspeak3-server_linux_amd64-${MY_PV}.tar.bz2 )
x86? ( http://dl.4players.de/ts/releases/pre_releases/server/${MY_PV}/teamspeak3-server_linux_x86-${MY_PV}.tar.bz2 )"
fi
SLOT="0"
LICENSE="teamspeak3 GPL-2"
IUSE="doc mysql tsdns"
KEYWORDS="~amd64 ~x86"
DEPEND="mysql? ( >=virtual/mysql-5.5 )"
RDEPEND="${DEPEND}"
RESTRICT="installsources mirror strip"
S="${WORKDIR}/teamspeak3-server_linux_${ARCH}"
QA_PREBUILT="/opt/*"
pkg_nofetch() {
elog "Please download ${A}"
elog "from ${HOMEPAGE}?page=downloads and place this"
elog "file in ${DISTDIR}"
}
pkg_setup() {
enewuser teamspeak3
}
src_install() {
2015-03-31 10:18:17 +02:00
# Install wrapper
dosbin "${FILESDIR}"/ts3server
# Install TeamSpeak 3 server into /opt/teamspeak3-server.
local opt_dir="/opt/teamspeak3-server"
into ${opt_dir}
insinto ${opt_dir}
exeinto ${opt_dir}
newsbin ts3server ts3server-bin
doexe *.sh
doins *.so
# 'libmariadb.so.2' is hard-coded into the ts3-server binary :(
use mysql && doexe redist/libmariadb.so.2
doins -r sql
# Install documentation and tsdns.
dodoc -r CHANGELOG doc/*.txt
use doc && dodoc -r serverquerydocs doc/serverquery/* && \
docompress -x /usr/share/doc/${PF}/serverquerydocs && \
dosym ../../usr/share/doc/${PF}/serverquerydocs ${opt_dir}/serverquerydocs
if use tsdns; then
newsbin tsdns/tsdnsserver tsdnsserver
newdoc tsdns/README README.tsdns
newdoc tsdns/USAGE USAGE.tsdns
dodoc tsdns/tsdns_settings.ini.sample
fi
# Install the runtime FS layout.
insinto /etc/teamspeak3-server
doins "${FILESDIR}"/server.conf "${FILESDIR}"/ts3db_mariadb.ini
keepdir /{etc,var/{lib,log}}/teamspeak3-server
# Install the init script and systemd unit.
newinitd "${FILESDIR}"/${PN}-init-r1 teamspeak3-server
systemd_dounit "${FILESDIR}"/systemd/teamspeak3.service
systemd_dotmpfilesd "${FILESDIR}"/systemd/teamspeak3.conf
# Fix up permissions.
fowners teamspeak3 /{etc,var/{lib,log}}/teamspeak3-server
fowners teamspeak3 ${opt_dir}
fperms 700 /{etc,var/{lib,log}}/teamspeak3-server
fperms 755 ${opt_dir}
}