Packaging » History » Version 10
Bob Lightfoot, 2015-03-18 22:38
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 | create a user to do the building as |
||
54 | <pre> |
||
55 | $sudo useradd mock |
||
56 | $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 | save the spec file for use later |
||
107 | <pre> |
||
108 | $vi tvheadend-new |
||
109 | </pre> |
||
110 | |||
111 | switch to the git tvheadened master and export the archive file called for in the new spec to the ~/tvheadend folder |
||
112 | <pre> |
||
113 | $cd ~/git/tvheadend |
||
114 | $git archive 96898a66e96927e4ace9a637ea923fd9f514dd1d --format=tar --prefix=tvheadend/ | gzip > ../tvheadend-4.0.03182015.tar.gz |
||
115 | $mv ../tvheadend-4.0.03182015.tar.gz ~/tvheadend |
||
116 | </pre> |
||
117 | |||
118 | mock setup |
||
119 | {for Fedora you'll need to use the rpmfusion environment} |
||
120 | {for centos you'll need to use nuxro's repos as an environment} |
||
121 | the /etc/mock/nux-7-x86_64.cfg can be created by adding following to the epel7.cfg and renaming as saved |
||
122 | |||
123 | <pre> |
||
124 | [nux-dextop] |
||
125 | name=Nux.Ro RPMs for general desktop use |
||
126 | baseurl=http://li.nux.ro/download/nux/dextop/el7/$basearch/ http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/$basearch/ |
||
127 | enabled=1 |
||
128 | gpgcheck=1 |
||
129 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro |
||
130 | protect=0 |
||
131 | |||
132 | [nux-dextop-testing] |
||
133 | name=Nux.Ro RPMs for general desktop use - testing |
||
134 | baseurl=http://li.nux.ro/download/nux/dextop-testing/el7/$basearch/ |
||
135 | enabled=0 |
||
136 | gpgcheck=1 |
||
137 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro |
||
138 | protect=0 |
||
139 | </pre> |
||
140 | |||
141 | clean the mock build environment |
||
142 | <pre> |
||
143 | $mock --init -r nux-7-x86_64 |
||
144 | </pre> |
||
145 | |||
146 | now build the previous version in the clean environment |
||
147 | <pre> |
||
148 | $mock -r nux-7-x86_64 --rebuild tvheadend-4.0.01012015-1.src.rpm |
||
149 | </pre> |
||
150 | |||
151 | copy in the new source tar and spec files |
||
152 | <pre> |
||
153 | $mock -r nux-7-x86_64 --no-clean --copyin tvheadend-4.0.03182015.tar.gz builddir/build/SOURCES/ |
||
154 | $mock -r nux-7-x86_64 --no-clean --copyin tvheadend-4.0.03182015-1.spec builddir/build/SPECS/tvheadend.spec |
||
155 | </pre> |
||
156 | |||
157 | shell in and confirm new source and spec are present and then build new src.rpm |
||
158 | <pre> |
||
159 | $mock -r nux-7-x86_64 --no-clean --shell |
||
160 | <mock>$ls -lah builddir/build/SOURCES |
||
161 | <mock>$ls -lah builddir/build/SPECS |
||
162 | <mock>$rpmbuild -bs builddir/build/SPECS/tvheadend.spec |
||
163 | <mock>$exit |
||
164 | </pre> |
||
165 | |||
166 | copy out the new src.rpm |
||
167 | <pre> |
||
168 | $mock -r nux-7-x86_64 --no-clean --copyout builddir/build/SRPMS/tvheadend-4.0.03182015-1.src.rpm ./ |
||
169 | </pre> |
||
170 | |||
171 | build the new version from the source rpm |
||
172 | <pre> |
||
173 | $mock -r nux-7-x86_64 --rebuild tvheadend-4.0.03182015-1.src.rpm |
||
174 | </pre> |
||
175 | |||
176 | move the results to your working folder |
||
177 | <pre> |
||
178 | $cp /var/lib/mock/nux-7-x86_64/result/*.rpm ./ |
||
179 | </pre> |
||
180 | |||
181 | h4. Install the RPM |
||
182 | |||
183 | <pre> |
||
184 | $sudo yum install /home/mock/tvheadend/tvheadend-4.0.03182015-1.x86_64.rpm |
||
185 | </pre> |
||
186 | |||
187 | |||
188 | |||
189 | 1 | Adam Sutton | |
190 | h2. Gentoo |
||
191 | |||
192 | 5 | John Törnblom | tvheadend is now available in portage so you can just install it like you usually do with other applications: |
193 | <pre> |
||
194 | $ emerge -av media-tv/tvheadend |
||
195 | </pre> |
||
196 | 1 | Adam Sutton | |
197 | 8 | Adam Sutton | h2. ArchLinux |
198 | |||
199 | If you'd like to build the latest git master for Arch, then you can issue the following commands: |
||
200 | |||
201 | <pre> |
||
202 | $ yaourt -S tvheadend-git |
||
203 | $ systemctl enable tvheadend |
||
204 | $ systemctl start tvheadend |
||
205 | </pre> |
||
206 | |||
207 | 9 | Adam Sutton | To install XBMC-PVR + Tvheadend: |
208 | |||
209 | <pre> |
||
210 | $ yaourt -S xbmc-pvr-addons-git xbmc-git tvheadend-git |
||
211 | </pre> |
||
212 | |||
213 | 1 | Adam Sutton | h2. Package Maintainers |
214 | |||
215 | If you wish to become a package maintainer for your favourite distribution, please contact a member of the development [[Team|team]]. |