Dockerfile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. FROM lsiobase/alpine
  2. MAINTAINER saarg
  3. # package version
  4. ARG ARGTABLE_VER="2.13"
  5. ARG UNICODE_VER="2.09"
  6. ARG XMLTV_VER="0.5.67"
  7. # Environment settings
  8. ENV HOME="/config"
  9. # copy patches
  10. COPY patches/ /tmp/patches/
  11. # install build packages
  12. RUN \
  13. apk add --no-cache --virtual=build-dependencies \
  14. autoconf \
  15. automake \
  16. cmake \
  17. coreutils \
  18. ffmpeg-dev \
  19. file \
  20. findutils \
  21. g++ \
  22. gcc \
  23. gettext-dev \
  24. git \
  25. libhdhomerun-dev \
  26. libtool \
  27. libxml2-dev \
  28. make \
  29. mercurial \
  30. openssl-dev \
  31. patch \
  32. perl-dev \
  33. pkgconf \
  34. sdl-dev \
  35. uriparser-dev \
  36. wget \
  37. zlib-dev && \
  38. # add runtime dependencies required in build stage
  39. apk add --no-cache \
  40. bsd-compat-headers \
  41. bzip2 \
  42. curl \
  43. gzip \
  44. libcrypto1.0 \
  45. libcurl \
  46. libssl1.0 \
  47. linux-headers \
  48. openssl \
  49. perl \
  50. perl-archive-zip \
  51. perl-boolean \
  52. perl-capture-tiny \
  53. perl-cgi \
  54. perl-compress-raw-zlib \
  55. perl-date-manip \
  56. perl-datetime \
  57. perl-file-slurp \
  58. perl-html-parser \
  59. perl-html-tree \
  60. perl-http-cookies \
  61. perl-io \
  62. perl-io-compress \
  63. perl-io-html \
  64. perl-io-stringy \
  65. perl-json \
  66. perl-libwww \
  67. perl-module-build \
  68. perl-module-pluggable \
  69. perl-net-ssleay \
  70. perl-parse-recdescent \
  71. perl-path-class \
  72. perl-term-readkey \
  73. perl-test-exception \
  74. perl-test-requires \
  75. perl-xml-parser \
  76. perl-xml-sax \
  77. python \
  78. tar \
  79. uriparser \
  80. wget \
  81. zlib && \
  82. # build libiconv
  83. mkdir -p \
  84. /tmp/iconv-src && \
  85. curl -o \
  86. /tmp/iconv.tar.gz -L \
  87. http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz && \
  88. tar xf /tmp/iconv.tar.gz -C \
  89. /tmp/iconv-src --strip-components=1 && \
  90. cd /tmp/iconv-src && \
  91. ./configure \
  92. --prefix=/usr/local && \
  93. patch -p1 -i \
  94. /tmp/patches/libiconv-1-fixes.patch && \
  95. make && \
  96. make install && \
  97. libtool --finish /usr/local/lib && \
  98. # install perl modules
  99. curl -L http://cpanmin.us | perl - App::cpanminus && \
  100. cpanm HTML::TableExtract && \
  101. cpanm HTTP::Cache::Transparent && \
  102. cpanm inc && \
  103. cpanm IO::Scalar && \
  104. cpanm IO::Socket::SSL && \
  105. cpanm Lingua::EN::Numbers::Ordinate && \
  106. cpanm Lingua::Preferred && \
  107. cpanm PerlIO::gzip && \
  108. cpanm SOAP::Lite && \
  109. cpanm Term::ProgressBar && \
  110. cpanm Unicode::UTF8simple && \
  111. cpanm version && \
  112. cpanm WWW::Mechanize && \
  113. cpanm XML::LibXML && \
  114. cpanm XML::TreePP && \
  115. cpanm XML::Twig && \
  116. cpanm XML::Writer && \
  117. # patch and build perl-unicode-string
  118. mkdir -p \
  119. /tmp/unicode && \
  120. curl -o \
  121. /tmp/unicode-src.tar.gz -L \
  122. "http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Unicode-String-${UNICODE_VER}.tar.gz" && \
  123. tar xzf /tmp/unicode-src.tar.gz -C \
  124. /tmp/unicode --strip-components=1 && \
  125. cd /tmp/unicode/lib/Unicode && \
  126. patch -i /tmp/patches/perl-unicode.patch && \
  127. cd /tmp/unicode && \
  128. perl Makefile.PL && \
  129. make && \
  130. make test && \
  131. make install && \
  132. # build dvb-apps
  133. hg clone http://linuxtv.org/hg/dvb-apps /tmp/dvb-apps && \
  134. cd /tmp/dvb-apps && \
  135. make && \
  136. make install && \
  137. # build tvheadend
  138. git clone https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
  139. cd /tmp/tvheadend && \
  140. ./configure \
  141. --disable-ffmpeg_static \
  142. --disable-hdhomerun_static \
  143. --disable-libfdkaac_static \
  144. --disable-libmfx_static \
  145. --disable-libtheora_static \
  146. --disable-libvorbis_static \
  147. --disable-libvpx_static \
  148. --disable-libx264_static \
  149. --disable-libx265_static \
  150. --enable-hdhomerun_client \
  151. --enable-libav \
  152. --infodir=/usr/share/info \
  153. --localstatedir=/var \
  154. --mandir=/usr/share/man \
  155. --prefix=/usr \
  156. --sysconfdir=/config && \
  157. make && \
  158. make install && \
  159. # build XMLTV
  160. curl -o /tmp/xmtltv-src.tar.bz2 -L \
  161. "http://kent.dl.sourceforge.net/project/xmltv/xmltv/${XMLTV_VER}/xmltv-${XMLTV_VER}.tar.bz2" && \
  162. tar xf /tmp/xmtltv-src.tar.bz2 -C \
  163. /tmp --strip-components=1 && \
  164. cd "/tmp/xmltv-${XMLTV_VER}" && \
  165. /bin/echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
  166. make && \
  167. make test && \
  168. make install && \
  169. # build argtable2
  170. ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
  171. mkdir -p \
  172. /tmp/argtable && \
  173. curl -o \
  174. /tmp/argtable-src.tar.gz -L \
  175. "https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" && \
  176. tar xf /tmp/argtable-src.tar.gz -C \
  177. /tmp/argtable --strip-components=1 && \
  178. cd /tmp/argtable && \
  179. ./configure \
  180. --prefix=/usr && \
  181. make && \
  182. make check && \
  183. make install && \
  184. # build comskip
  185. git clone git://github.com/erikkaashoek/Comskip /tmp/comskip && \
  186. cd /tmp/comskip && \
  187. ./autogen.sh && \
  188. ./configure \
  189. --bindir=/usr/bin \
  190. --sysconfdir=/config/comskip && \
  191. make && \
  192. make install && \
  193. # install runtime packages
  194. apk add --no-cache \
  195. ffmpeg \
  196. ffmpeg-libs \
  197. libhdhomerun-libs && \
  198. # cleanup
  199. apk del --purge \
  200. build-dependencies && \
  201. rm -rf \
  202. /config/.cpanm \
  203. /tmp/*
  204. # copy local files
  205. COPY root/ /
  206. # ports and volumes
  207. EXPOSE 9981 9982
  208. VOLUME /config /recordings