1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs user
8 DESCRIPTION="A video/audio/data interactive streaming server"
9 HOMEPAGE="http://www.fastpath.it/products/palantir/index.php"
10 SRC_URI="http://www.fastpath.it/products/${PN}/pub/${P}.tgz"
25 PALANTIR_USER="palantir"
26 PALANTIR_PIPE_PATH="/var/run/palantir/telmu_pipe"
28 enewuser ${PALANTIR_USER}
32 # this one isn't mangled by Makefile
33 sed -i -e "s#/usr/local/share/palantir/telmu_pipe#${PALANTIR_PIPE_PATH}#" \
34 tools/set_sensor || die
35 # install the config file in correct location
36 sed -i -e 's:$(SYS_DIR)/palantir.conf:$(CONFIG_FILE).sample:' Makefile || die
37 # tools/ like LDFLAGS too
38 sed -i -e 's:-o:$(LDFLAGS) -o:' tools/Makefile || die
39 # set the paths in sample configfile
41 -e "s:^# \(NamedPipe \).*:\1${PALANTIR_PIPE_PATH}:" \
42 -e "s:^# \(LogFile .*\):\1.log:" \
43 ${PN}.conf.sample || die
44 # use system-wide libgsm headers
45 sed -i -e 's:\(#include \)"libgsm/inc/gsm.h":\1<gsm/gsm.h>:' audio.h || die
49 # libgsm=-lgsm to avoid bundling it
50 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
53 CONFIG_FILE=/etc/${PN}/${PN}.conf \
54 NAMED_PIPE=${PALANTIR_PIPE_PATH} \
59 # we're mangling a lot here, so we need to create the dirs ourselves
60 dodir ${PALANTIR_PIPE_PATH%/*} /etc/${PN} /var/log || die
61 # XXX: make keeps relinking palantir
62 emake install CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
65 CONFIG_FILE="${D}"etc/${PN}/${PN}.conf \
66 NAMED_PIPE="${D}"${PALANTIR_PIPE_PATH#/} \
67 LOG_FILE="${D}"var/log/${PN}.log \
68 OWNER=${PALANTIR_USER} \
71 newbin tools/set_sensor palantir_set_sensor || die
72 dodoc doc/* README TODO || die
73 newinitd "${FILESDIR}"/${PN}.init ${PN} || die