Project

General

Profile

Tvheadend gentoo » History » Version 14

William Peters, 2011-01-11 20:20
changed from svn to git.

1 10 William Peters
This article describes how to build Tvheadend from source 
2 1 William Peters
3 14 William Peters
Make sure you have avahi and git installed, these are required to build Tvheadend
4 1 William Peters
5 13 William Peters
<pre>
6 14 William Peters
# emerge -av avahi git
7 13 William Peters
</pre>
8 1 William Peters
9 2 William Peters
now create the following directories
10 1 William Peters
11 13 William Peters
<pre>
12 1 William Peters
mkdir -p /opt/tvheadend/src
13 13 William Peters
</pre>
14 1 William Peters
15 14 William Peters
now you need to fetch the Tvheadend source code using git
16 1 William Peters
17 13 William Peters
<pre>
18 14 William Peters
git clone https://github.com/andoma/tvheadend.git /opt/tvheadend/src/
19 13 William Peters
</pre>
20 1 William Peters
21 9 William Peters
now you need to prepare the Tvheadend source code
22 1 William Peters
23 13 William Peters
<pre>
24 1 William Peters
cd /opt/tvheadend/src
25 4 William Peters
./configure --prefix=/opt/tvheadend 
26 13 William Peters
</pre>
27 1 William Peters
28 9 William Peters
if all went well you can compile the Tvheadend source code
29 1 William Peters
30 13 William Peters
<pre>
31 1 William Peters
make
32 13 William Peters
</pre>
33 1 William Peters
34
If the source is compiled with no errors you can install the compiled source
35
36 13 William Peters
<pre>
37 1 William Peters
make install
38 13 William Peters
</pre>
39 1 William Peters
40 9 William Peters
if you want you can also create this init script to start Tvheadend at boot time
41 7 William Peters
42 6 William Peters
/etc/init.d/tvheadend
43 13 William Peters
<pre>
44 1 William Peters
#!/sbin/runscript
45
# Copyright 1999-2010 Gentoo Foundation
46
# Distributed under the terms of the GNU General Public License v2
47
# $Header:
48
49
depend() {
50
        need net
51
}
52
53
start() {
54 11 William Peters
        ebegin "Starting tvheadend"
55
        start-stop-daemon --start \
56
                --user ${TVHUSER} \
57
                --exec ${TVHBIN} -- -C -f
58 1 William Peters
        eend $?
59
}
60
61
stop() {
62 11 William Peters
        ebegin "Stopping tvheadend"
63
        start-stop-daemon --stop --quiet --name ${TVHNAME} --signal 2
64 1 William Peters
        eend $?
65
}
66 13 William Peters
</pre>
67 1 William Peters
68 11 William Peters
/etc/conf.d/tvheadend
69
70 13 William Peters
<pre>
71 11 William Peters
# /etc/conf.d/tvheadend: config file for /etc/init.d/tvheadend
72
73
TVHROOT="/opt/tvheadend"
74
TVHNAME="tvheadend"
75
TVHBIN="${TVHROOT}/bin/${TVHNAME}"
76
TVHUSER="${TVHNAME}"
77 13 William Peters
</pre>
78 11 William Peters
79 1 William Peters
now set /etc/init.d/tvheadend as executable
80
81 13 William Peters
<pre>
82 1 William Peters
chmod +x /etc/init.d/tvheadend
83 13 William Peters
</pre>
84 11 William Peters
85 12 William Peters
Create the tvheadend and add tvheadend to the group video
86 11 William Peters
87 13 William Peters
<pre>
88 1 William Peters
useradd -d /opt/tvheadend/home/ -G tvheadend -s /sbin/nologin -m tvheadend
89 12 William Peters
gpasswd -a tvheadend video
90 13 William Peters
</pre>
91 1 William Peters
92 9 William Peters
now you can try to start Tvheadend
93 1 William Peters
94 13 William Peters
<pre>
95 1 William Peters
/etc/init.d/tvheadend start
96 13 William Peters
</pre>
97 1 William Peters
98 9 William Peters
if this works fine you can also add it to runlevel default so Tvheadend starts automatically
99 1 William Peters
100 13 William Peters
<pre>
101 1 William Peters
rc-update add tvheadend default
102 13 William Peters
</pre>
103 1 William Peters
104 13 William Peters
now you can go to "http://hostname:9981/":http://hostname:9981/ and start using/configuring Tvheadend