Project

General

Profile

Packaging » History » Version 13

Bob Lightfoot, 2015-03-22 18:40

1 1 Adam Sutton
h1. Packaging
2
3
To be able to install TVHeadend permanently on your system, or distribute to others, its highly recommend that you build a package.
4
5
But before you can do this make sure you have read the basic build instructions [[Building|here]]
6
7
Different distributions will have different package formats, however TVHeadend comes with scripts to help build several common ones.
8
9 2 Adam Sutton
h2. Ubuntu / Debian
10 1 Adam Sutton
11
To build a deb package for the latest version of Ubuntu (Precise, at the time of writing) you can do the following:
12
13
> x86 32-bit
14
<pre>
15 6 Adam Sutton
$ ./Autobuild.sh -t precise-i386
16 1 Adam Sutton
</pre>
17
18
> x86 64-bit
19
<pre>
20 6 Adam Sutton
$ ./Autobuild.sh -t precise-amd64
21 1 Adam Sutton
</pre>
22 2 Adam Sutton
23
Note: Although the scripts are named precise (for Ubuntu 12.04) they will work just fine with most recent versions of Debian/Ubuntu.
24 1 Adam Sutton
25 3 Adam Sutton
Note: the generated deb will be in the directory above that containing Autobuild.sh (i.e. outside of the tvheadend directory).
26
27 4 Adam Sutton
Note: the -dbg package contains debug symbols, generally you won't need these.
28
29 7 Adam Sutton
h3. Configure Options
30
31
You can also pass specific configuration options to the configure script by setting the _AUTOBUILD_CONFIGURE_EXTRA_ environment variable.
32
33
<pre>
34
$ AUTOBUILD_CONFIGURE_EXTRA=--enable-bundle ./Autobuild.sh -t precise-amd64
35
</pre>
36
37 1 Adam Sutton
h2. Redhat/CentOS/Fedora
38
39 10 Bob Lightfoot
h4. Redhat/Centos/Fedora Build assumptions
40
41
<pre>
42
Redhat/Centos/Fedora are a package managed OS and as such tvheadend should be installed from an rpm on a production system.  
43
This set of instructions details using tools git, mock and rpmbuild to package the source into an rpm and then install the rpm
44
</pre>
45
46
h4. Build Environment Configuration
47
   
48
   install the software used for building tvheadened
49
<pre>
50
$sudo yum install git mock
51
</pre>
52
53 13 Bob Lightfoot
     create a user to do the building as -- this is not a requirement, but does provide a modicum of compartmentaliztion when building
54 10 Bob Lightfoot
<pre>
55 13 Bob Lightfoot
$sudo useradd -g mock mock
56 10 Bob Lightfoot
$sudo passwd mock
57
</pre>
58
59
     for more details view the Centos/Fedora Mock pages starting
60
     http://fedoraproject.org/wiki/Projects/Mock
61
62
h4. Getting the files to work with
63
64
    tvheadend sources are retrieved as follow
65
<pre>
66
$su mock
67
$mkdir git
68
$cd git
69
$ git clone https://github.com/tvheadend/tvheadend.git
70
</pre>
71
72
     create a workfiles holding directory
73
<pre>
74
$mkdir ~/tvheadend
75
</pre>
76
77
     you'll also need a starter source rpm and specfile found through one of the following in the ~/tvheadend folder:
78
     https://tvheadend.org/boards/4/topics/14666
79
     https://tvheadend.org/attachments/download/2823/tvheadend-4.0.01012015-1.src.rpm
80
     https://tvheadend.org/attachments/download/2738/tvheadend-4.0.01012015-1.spec
81
82
h4. Step by Step Building the RPM
83
84
     enter the local git repository and reset local to most current remote
85
<pre>
86
$cd ~/git/tvheadend
87
$git fetch origin
88
$git reset --hard origin/master
89
</pre>
90
91
      determine the commit id of the master branch
92
<pre>
93
$git show-ref --head
94
</pre>
95
96
      create the spec file for the next version note new and old are the date-revision strings
97
<pre>
98
$cp tvheadend-old.spec tvheadend-new.spec
99
</pre>
100
101
      open the new spec and edit as follows
102
      update the global commit string to match the current master commit
103
      change the version string to match the new being built
104
      change the git archive comment line to be the correct values commit tag and filename
105
      change the source0 filename also
106 11 Bob Lightfoot
      modify the changelog to reflect the new version
107 10 Bob Lightfoot
      save the spec file for use later
108
<pre>
109 12 Bob Lightfoot
$vi tvheadend-new.spec
110 10 Bob Lightfoot
</pre>
111
112
      switch to the git tvheadened master and export the archive file called for in the new spec to the ~/tvheadend folder
113
<pre>
114
$cd ~/git/tvheadend
115
$git archive 96898a66e96927e4ace9a637ea923fd9f514dd1d --format=tar --prefix=tvheadend/ | gzip > ../tvheadend-4.0.03182015.tar.gz
116
$mv ../tvheadend-4.0.03182015.tar.gz ~/tvheadend
117
</pre>
118
119
      mock setup
120
           {for Fedora you'll need to use the rpmfusion environment}
121
           {for centos you'll need to use nuxro's repos as an environment}
122
      the /etc/mock/nux-7-x86_64.cfg can be created by adding following to the epel7.cfg and renaming as saved
123
124
<pre>
125
[nux-dextop]
126
name=Nux.Ro RPMs for general desktop use
127
baseurl=http://li.nux.ro/download/nux/dextop/el7/$basearch/ http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/$basearch/
128
enabled=1
129
gpgcheck=1
130
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro
131
protect=0
132
133
[nux-dextop-testing]
134
name=Nux.Ro RPMs for general desktop use - testing
135
baseurl=http://li.nux.ro/download/nux/dextop-testing/el7/$basearch/
136
enabled=0
137
gpgcheck=1
138
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro
139
protect=0
140
</pre>
141
142
      clean the mock build environment 
143
<pre>
144
$mock --init -r nux-7-x86_64
145
</pre>
146
147
      now build the previous version in the clean environment
148
<pre>
149
$mock -r nux-7-x86_64 --rebuild tvheadend-4.0.01012015-1.src.rpm
150
</pre>
151
152
      copy in the new source tar and spec files
153
<pre>
154
$mock -r nux-7-x86_64 --no-clean --copyin tvheadend-4.0.03182015.tar.gz builddir/build/SOURCES/
155
$mock -r nux-7-x86_64 --no-clean --copyin tvheadend-4.0.03182015-1.spec builddir/build/SPECS/tvheadend.spec
156
</pre>
157
158
       shell in and confirm new source and spec are present and then build new src.rpm
159
<pre>
160
$mock -r nux-7-x86_64 --no-clean --shell
161
<mock>$ls -lah builddir/build/SOURCES
162
<mock>$ls -lah builddir/build/SPECS
163
<mock>$rpmbuild -bs builddir/build/SPECS/tvheadend.spec
164
<mock>$exit
165
</pre>
166
167
       copy out the new src.rpm
168
<pre>
169
$mock -r nux-7-x86_64 --no-clean --copyout builddir/build/SRPMS/tvheadend-4.0.03182015-1.src.rpm ./
170
</pre>
171
172
       build the new version from the source rpm
173
<pre>
174
$mock -r nux-7-x86_64 --rebuild tvheadend-4.0.03182015-1.src.rpm
175
</pre>
176
177
       move the results to your working folder
178
<pre>
179
$cp /var/lib/mock/nux-7-x86_64/result/*.rpm ./
180
</pre>
181
182
h4. Install the RPM
183
184
<pre>
185
$sudo yum install /home/mock/tvheadend/tvheadend-4.0.03182015-1.x86_64.rpm
186
</pre>
187
188
189
190 1 Adam Sutton
191
h2. Gentoo
192
193 5 John Törnblom
tvheadend is now available in portage so you can just install it like you usually do with other applications:
194
<pre>
195
$ emerge -av media-tv/tvheadend
196
</pre>
197 1 Adam Sutton
198 8 Adam Sutton
h2. ArchLinux
199
200
If you'd like to build the latest git master for Arch, then you can issue the following commands:
201
202
<pre>
203
$ yaourt -S tvheadend-git
204
$ systemctl enable tvheadend
205
$ systemctl start tvheadend
206
</pre>
207
208 9 Adam Sutton
To install XBMC-PVR + Tvheadend:
209
210
<pre>
211
$ yaourt -S xbmc-pvr-addons-git xbmc-git tvheadend-git
212
</pre>
213
214 1 Adam Sutton
h2. Package Maintainers
215
216
If you wish to become a package maintainer for your favourite distribution, please contact a member of the development [[Team|team]].