You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.1 KiB

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils systemd user versionator
MY_PV="$(get_version_component_range 1-3)-Beta-$(get_version_component_range 4)"
DESCRIPTION="TeamSpeak Server - Voice Communication Software"
if [[ ${PV} = "*_beta*" ]] ; then
SRC_URI="amd64? (${MY_PV}/teamspeak3-server_linux-amd64-$(get_version_component_range 1-3).tar.gz )
x86? (${MY_PV}/teamspeak3-server_linux-x86-$(get_version_component_range 1-3).tar.gz )"
SRC_URI="amd64? (${PV}/teamspeak3-server_linux-amd64-${PV}.tar.gz )
x86? (${PV}/teamspeak3-server_linux-x86-${PV}.tar.gz )"
RESTRICT="fetch mirror strip"
LICENSE="teamspeak3 GPL-2"
KEYWORDS="~amd64 ~x86"
IUSE="doc pdf mysql tsdns"
DEPEND="mysql? ( >=virtual/mysql-5.5 )"
pkg_nofetch() {
if use amd64 ; then
einfo "Please download teamspeak3-server_linux-amd64-${PV}.tar.gz"
elif use x86 ; then
einfo "Please download teamspeak3-server_linux-x86-${PV}.tar.gz"
einfo "from ${HOMEPAGE}?page=downloads and place this"
einfo "file in ${DISTDIR}"
pkg_setup() {
enewuser teamspeak3
src_install() {
# Install TeamSpeak 3 server into /opt/teamspeak3-server.
local opt_dir="/opt/teamspeak3-server"
into ${opt_dir}
insinto ${opt_dir}
# Install binary, wrapper, shell files and libraries.
newsbin ts3server_linux_${ARCH} ts3server-bin
exeinto /usr/sbin
doexe "${FILESDIR}"/ts3server
exeinto ${opt_dir}
doexe *.sh
doins *.so
# '' is hard-coded into the ts3-server binary :(
use mysql && doexe redist/
doins -r sql
# Install documentation and tsdns.
dodoc -r CHANGELOG doc/*.txt
use doc && dodoc -r serverquerydocs
use pdf && dodoc doc/*.pdf
if use tsdns; then
newsbin tsdns/tsdnsserver_linux_${ARCH} tsdnsserver
newdoc tsdns/README README.tsdns
newdoc tsdns/USAGE USAGE.tsdns
dodoc tsdns/tsdns_settings.ini.sample
insinto /etc/teamspeak3-server
newins tsdns/tsdns_settings.ini.sample tsdns_settings.ini
# Install the runtime FS layout.
insinto /etc/teamspeak3-server
doins "${FILESDIR}"/server.conf
use mysql && doins "${FILESDIR}"/ts3db_mariadb.ini
keepdir /{etc,var/{lib,log,run}}/teamspeak3-server
# Install the init script and systemd unit.
newinitd "${FILESDIR}"/${PN}.rc teamspeak3-server
use tsdns && newinitd "${FILESDIR}/teamspeak-tsdns-server.rc" teamspeak3-tsdns-server
systemd_dounit "${FILESDIR}"/systemd/teamspeak3.service
use tsdns && systemd_dounit "${FILESDIR}"/systemd/teamspeak3-tsdns-server.service
systemd_dotmpfilesd "${FILESDIR}"/systemd/teamspeak3.conf
# Fix up permissions.
fowners teamspeak3 /{etc,var/{lib,log,run}}/teamspeak3-server
fowners teamspeak3 ${opt_dir}
fperms 700 /{etc,var/{lib,log,run}}/teamspeak3-server
fperms 755 ${opt_dir}