Packaging » History » Version 14
Bob Lightfoot, 2015-03-22 20:05
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 | |
38 | 14 | Bob Lightfoot | h2. Redhat / Centos / Fedora |
39 | |||
40 | 10 | Bob Lightfoot | h4. Redhat/Centos/Fedora Build assumptions |
41 | |||
42 | <pre> |
||
43 | Redhat/Centos/Fedora are a package managed OS and as such tvheadend should be installed from an rpm on a production system. |
||
44 | This set of instructions details using tools git, mock and rpmbuild to package the source into an rpm and then install the rpm |
||
45 | </pre> |
||
46 | |||
47 | h4. Build Environment Configuration |
||
48 | |||
49 | install the software used for building tvheadened |
||
50 | <pre> |
||
51 | $sudo yum install git mock |
||
52 | </pre> |
||
53 | |||
54 | 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 |
55 | 10 | Bob Lightfoot | <pre> |
56 | 13 | Bob Lightfoot | $sudo useradd -g mock mock |
57 | 10 | Bob Lightfoot | $sudo passwd mock |
58 | </pre> |
||
59 | |||
60 | for more details view the Centos/Fedora Mock pages starting |
||
61 | http://fedoraproject.org/wiki/Projects/Mock |
||
62 | |||
63 | h4. Getting the files to work with |
||
64 | |||
65 | tvheadend sources are retrieved as follow |
||
66 | <pre> |
||
67 | $su mock |
||
68 | $mkdir git |
||
69 | $cd git |
||
70 | $ git clone https://github.com/tvheadend/tvheadend.git |
||
71 | </pre> |
||
72 | |||
73 | create a workfiles holding directory |
||
74 | <pre> |
||
75 | $mkdir ~/tvheadend |
||
76 | </pre> |
||
77 | |||
78 | 14 | Bob Lightfoot | you'll also need a starter source rpm and specfile such as attached placed in the ~/tvheadend folder: |
79 | tvheadend-3.9.2618-git.e5dc86b.1.spec |
||
80 | tvheadend-3.9.2618-git.e5rc86b.1.el7.centos.src.rpm |
||
81 | 10 | Bob Lightfoot | |
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 | 1 | Adam Sutton | |
91 | 14 | Bob Lightfoot | determine the commit id of the master branch - for ex. "e5dc86b3dd32f80c337da75cc0d2e00702c45fe1" |
92 | 1 | Adam Sutton | <pre> |
93 | $git show-ref --head |
||
94 | </pre> |
||
95 | |||
96 | 14 | Bob Lightfoot | determine the version id of this build as well - for ex. "v3.9-2618-ge5dc86b" |
97 | |||
98 | 10 | Bob Lightfoot | <pre> |
99 | 14 | Bob Lightfoot | $git describe --dirty --match "v*" |
100 | </pre> |
||
101 | |||
102 | create the spec file for the next version note new and old are the revision strings |
||
103 | in this example tvheadend-new-spec would be tvheadend-3.9.2618-git.e5dc86b.1.spec |
||
104 | <pre> |
||
105 | 10 | Bob Lightfoot | $cp tvheadend-old.spec tvheadend-new.spec |
106 | </pre> |
||
107 | |||
108 | open the new spec and edit as follows |
||
109 | 14 | Bob Lightfoot | update the global commit string to match the current master commit - for ex. "e5dc86b3dd32f80c337da75cc0d2e00702c45fe1" |
110 | change the version string to match the new being built - - for ex. version "3.9-2618" note the revision is automatic |
||
111 | except for the 1,2,3 or whatever patch might be applied |
||
112 | 1 | Adam Sutton | change the git archive comment line to be the correct values commit tag and filename |
113 | 11 | Bob Lightfoot | change the source0 filename also |
114 | 14 | Bob Lightfoot | also modify the changelog to reflect the new version |
115 | 10 | Bob Lightfoot | save the spec file for use later |
116 | 12 | Bob Lightfoot | <pre> |
117 | 1 | Adam Sutton | $vi tvheadend-new.spec |
118 | 10 | Bob Lightfoot | </pre> |
119 | |||
120 | switch to the git tvheadened master and export the archive file called for in the new spec to the ~/tvheadend folder |
||
121 | <pre> |
||
122 | $cd ~/git/tvheadend |
||
123 | 14 | Bob Lightfoot | $git archive e5dc86b3dd32f80c337da75cc0d2e00702c45fe1 --format=tar --prefix=tvheadend/ | gzip > ../tvheadend-3.9.2618-git.e5dc86b.tar.gz |
124 | $mv ../tvheadend-3.9.2618-git.e5dc86b.tar.gz ~/tvheadend |
||
125 | 10 | Bob Lightfoot | </pre> |
126 | |||
127 | mock setup |
||
128 | {for Fedora you'll need to use the rpmfusion environment} |
||
129 | {for centos you'll need to use nuxro's repos as an environment} |
||
130 | 14 | Bob Lightfoot | the /nux-7-x86_64.cfg attached works for me with nux.ro's repo and centos7 |
131 | 10 | Bob Lightfoot | |
132 | <pre> |
||
133 | [nux-dextop] |
||
134 | name=Nux.Ro RPMs for general desktop use |
||
135 | baseurl=http://li.nux.ro/download/nux/dextop/el7/$basearch/ http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/$basearch/ |
||
136 | enabled=1 |
||
137 | gpgcheck=1 |
||
138 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro |
||
139 | protect=0 |
||
140 | |||
141 | [nux-dextop-testing] |
||
142 | name=Nux.Ro RPMs for general desktop use - testing |
||
143 | 1 | Adam Sutton | baseurl=http://li.nux.ro/download/nux/dextop-testing/el7/$basearch/ |
144 | 10 | Bob Lightfoot | enabled=0 |
145 | gpgcheck=1 |
||
146 | 1 | Adam Sutton | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro |
147 | protect=0 |
||
148 | 10 | Bob Lightfoot | </pre> |
149 | |||
150 | clean the mock build environment |
||
151 | <pre> |
||
152 | $mock --init -r nux-7-x86_64 |
||
153 | </pre> |
||
154 | |||
155 | now build the previous version in the clean environment |
||
156 | <pre> |
||
157 | 14 | Bob Lightfoot | $mock -r nux-7-x86_64 --rebuild tvheadend-3.9.2618-git.e5dc86b.1.el7.centos.src.rpm |
158 | 10 | Bob Lightfoot | </pre> |
159 | |||
160 | 1 | Adam Sutton | copy in the new source tar and spec files |
161 | 10 | Bob Lightfoot | <pre> |
162 | 14 | Bob Lightfoot | $mock -r nux-7-x86_64 --no-clean --copyin tvheadend-3.9.2618-git.e5dc86b.1.tar.gz builddir/build/SOURCES/ |
163 | $mock -r nux-7-x86_64 --no-clean --copyin tvheadend-3.9.2618-git.e5dc86b.1.spec builddir/build/SPECS/tvheadend.spec |
||
164 | 1 | Adam Sutton | </pre> |
165 | 10 | Bob Lightfoot | |
166 | shell in and confirm new source and spec are present and then build new src.rpm |
||
167 | <pre> |
||
168 | $mock -r nux-7-x86_64 --no-clean --shell |
||
169 | <mock>$ls -lah builddir/build/SOURCES |
||
170 | <mock>$ls -lah builddir/build/SPECS |
||
171 | <mock>$rpmbuild -bs builddir/build/SPECS/tvheadend.spec |
||
172 | <mock>$exit |
||
173 | </pre> |
||
174 | 1 | Adam Sutton | |
175 | 10 | Bob Lightfoot | copy out the new src.rpm |
176 | <pre> |
||
177 | 14 | Bob Lightfoot | $mock -r nux-7-x86_64 --no-clean --copyout builddir/build/SRPMS/tvheadend-3.9.2618-git.e5dc86b.1.el7.centos.src.rpm ./ |
178 | 10 | Bob Lightfoot | </pre> |
179 | |||
180 | build the new version from the source rpm |
||
181 | <pre> |
||
182 | 14 | Bob Lightfoot | $mock -r nux-7-x86_64 --rebuild tvheadend-3.9.2618-git.e5dc86b.1.el7.centos.src.rpm |
183 | 10 | Bob Lightfoot | </pre> |
184 | |||
185 | move the results to your working folder |
||
186 | <pre> |
||
187 | $cp /var/lib/mock/nux-7-x86_64/result/*.rpm ./ |
||
188 | </pre> |
||
189 | |||
190 | h4. Install the RPM |
||
191 | |||
192 | <pre> |
||
193 | 14 | Bob Lightfoot | $sudo yum install /home/mock/tvheadend/tvheadend-3.9.2618-git.e5dc86b.1.el7.centos.x86_64.rpm |
194 | 10 | Bob Lightfoot | </pre> |
195 | |||
196 | 1 | Adam Sutton | |
197 | h2. Gentoo |
||
198 | |||
199 | 5 | John Törnblom | tvheadend is now available in portage so you can just install it like you usually do with other applications: |
200 | <pre> |
||
201 | $ emerge -av media-tv/tvheadend |
||
202 | </pre> |
||
203 | 1 | Adam Sutton | |
204 | 8 | Adam Sutton | h2. ArchLinux |
205 | |||
206 | If you'd like to build the latest git master for Arch, then you can issue the following commands: |
||
207 | |||
208 | <pre> |
||
209 | $ yaourt -S tvheadend-git |
||
210 | $ systemctl enable tvheadend |
||
211 | $ systemctl start tvheadend |
||
212 | </pre> |
||
213 | |||
214 | 9 | Adam Sutton | To install XBMC-PVR + Tvheadend: |
215 | |||
216 | <pre> |
||
217 | $ yaourt -S xbmc-pvr-addons-git xbmc-git tvheadend-git |
||
218 | </pre> |
||
219 | |||
220 | 1 | Adam Sutton | h2. Package Maintainers |
221 | |||
222 | If you wish to become a package maintainer for your favourite distribution, please contact a member of the development [[Team|team]]. |