Guest User

MythTV PKGBUILD

a guest
Dec 27th, 2010
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.12 KB | None | 0 0
  1. # Maintainer: Jannik Sost <jannik.sost at gmail.com>
  2. # Contributor: Jonathan Conder <[email protected]>
  3. # Contributor: Giovanni Scafora <[email protected]>
  4. # Contributor: Juergen Hoetzel <[email protected]>
  5. # Contributor: <[email protected]>
  6. # Contributor: dorphell <[email protected]>
  7.  
  8. pkgname=('mythtv-0.24-fixes-git'
  9.          ###
  10.          # Un-comment (remove hash) in front of the next lines,
  11.          # to build mythplugins, too.
  12.          ###
  13.      #'mythplugins-0.24-fixes-git-mytharchive'
  14.          #'mythplugins-0.24-fixes-git-mythbrowser'
  15.          #'mythplugins-0.24-fixes-git-mythgallery'
  16.          #'mythplugins-0.24-fixes-git-mythgame'
  17.          #'mythplugins-0.24-fixes-git-mythmusic'
  18.          #'mythplugins-0.24-fixes-git-mythnetvision'
  19.          #'mythplugins-0.24-fixes-git-mythnews'
  20.          #'mythplugins-0.24-fixes-git-mythvideo'
  21.          #'mythplugins-0.24-fixes-git-mythweather'
  22.          #'mythplugins-0.24-fixes-git-mythzoneminder'
  23. )
  24. pkgver=20101221
  25. pkgrel=1
  26. pkgdesc="A Homebrew PVR project. Including MythPlugins (Edit PKGBUILD, please!)"
  27. arch=('i686' 'x86_64')
  28. url="http://www.mythtv.org/"
  29. license=('GPL')
  30. depends=('lame' 'libavc1394' 'libiec61883' 'libvdpau' 'libxinerama' 'libxvmc'
  31.          'lirc-utils' 'mesa' 'mysql-clients' 'mysql-python' 'perl-dbd-mysql'
  32.          'perl-libwww' 'perl-net-upnp' 'python-lxml' 'qt' 'wget')
  33. makedepends=('yasm' 'subversion')
  34. #If we only build MythTV, we don't need all those makedepends. So detect if we need them.
  35. for name in ${pkgname[@]} ; do
  36.   if [[ $name == mythplugins-0.24-fixes-git-* ]] ; then
  37.     makedepends=('yasm' 'git'
  38.         'cdrkit' 'dvdauthor' 'dvd+rw-tools' 'ffmpeg'
  39.         'python-imaging' 'libexif' 'perl-date-manip' 'zlib' 'cdparanoia'
  40.         'flac' 'libcdaudio' 'libvisual' 'libvorbis' 'sdl' 'taglib'
  41.         'python2-oauth' 'python-pycurl' 'mplayer' 'perl-date-manip'
  42.         'perl-libwww' 'perl-soap-lite' 'perl-xml-sax' 'perl-xml-simple'
  43.         'perl-xml-xpath' 'perl-image-size' 'perl-datetime-format-iso8601'
  44.         'subversion'
  45.         )
  46.     break
  47.   fi;
  48. done
  49. conflicts=('mythtv' 'mythtv-0.24-fixes-git')
  50. provides=('mythtv' 'mythtv-0.24-fixes-svn')
  51. optdepends=('xmltv: to download tv listings')
  52. options=('force')
  53. install='mythtv.install'
  54. source=('mythbackend.rc'
  55.     'mythbackend.conf'
  56.     'mtd.rc')
  57. md5sums=('feadcc9ad064d93d6dceab1efc0bd9ed'
  58.          'bb8e4033d82428d827570fae9ba15e6a'
  59.      '476c12ba074794ad7f4ae092bdf949d6')
  60.  
  61. _gitroot="git://github.com/MythTV/mythtv.git"
  62. _gitname=mythtv
  63.  
  64. build() {
  65.   cd "$srcdir"
  66.   msg "Connecting to GIT server...."
  67.  
  68.   if [ -d $_gitname ] ; then
  69.     cd $_gitname && git pull origin
  70.     msg "The local files are updated."
  71.   else
  72.     git clone -b "fixes/0.24" $_gitroot $_gitname
  73.   fi
  74.  
  75.   msg "GIT checkout done or server timeout"
  76.   msg "Starting make..."                                                                                                            
  77.                                                                                                                                        
  78.   rm -rf "$srcdir/$_gitname-build"
  79.   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  80.   cd "$srcdir/$_gitname-build/mythtv"
  81.  
  82.   find 'bindings/python' 'contrib' -type f | xargs sed -i 's@^#!.*python$@#!/usr/bin/python2@'
  83.  
  84.   ARCH="${CARCH/_/-}"
  85.   ./configure --prefix=/usr --cpu="$ARCH" \
  86.           --enable-mmx \
  87.           --enable-audio-oss \
  88.           --enable-audio-alsa \
  89.           --disable-audio-jack \
  90.           --disable-audio-pulse \
  91.           --disable-altivec \
  92.           --disable-distcc \
  93.           --disable-ccache \
  94.           --enable-vdpau \
  95.           --enable-dvb \
  96.           --dvb-path=/usr/include \
  97.           --enable-lirc \
  98.           --enable-joystick-menu \
  99.           --enable-v4l \
  100.           --enable-ivtv \
  101.           --enable-xvmc \
  102.           --enable-xvmcw \
  103.           --enable-xvmc-vld \
  104.           --enable-firewire \
  105.           --enable-opengl-vsync \
  106.           --enable-xrandr \
  107.           --enable-xv \
  108.           --enable-x11 \
  109.           --with-bindings=perl,python --python=python2
  110.   make
  111.  
  112.   #Build MythPlugins only if at least one plugins is selected
  113.   for name in ${pkgname[@]} ; do
  114.     if [[ $name == mythplugins-0.24-fixes-git-* ]] ; then
  115.       cd "$srcdir/$_gitname-build/mythplugins"
  116.       find . -name '*.py' -type f | xargs sed -i 's@^#!.*python$@#!/usr/bin/python2@'
  117.  
  118.       ./configure --prefix=/usr \
  119.               --enable-all \
  120.               --python=python2
  121.       qmake mythplugins.pro
  122.       make
  123.       break
  124.     fi;
  125.   done
  126. }
  127.  
  128. package_mythtv-0.24-fixes-git() {
  129.   backup=('etc/conf.d/mythbackend')
  130.   cd "$srcdir/$_gitname-build/mythtv"
  131.   make INSTALL_ROOT="$pkgdir" install
  132.  
  133.   install -D -m755 "$srcdir/mythbackend.rc" "$pkgdir/etc/rc.d/mythbackend"
  134.   install -D -m644 "$srcdir/mythbackend.conf" "$pkgdir/etc/conf.d/mythbackend"
  135.   install -D -m644 'database/mc.sql' "$pkgdir/usr/share/mythtv/mc.sql"
  136.  
  137.   mkdir -p "$pkgdir/usr/share/mythtv/contrib"
  138.   # This is not ideal, as it will include the .git directory when copying
  139.   # But you may remove /usr/share/mythtv/contrib/.git after the you installed this package
  140.   cp -R 'contrib/'* "$pkgdir/usr/share/mythtv"
  141. }
  142.  
  143. package_mythplugins-0.24-fixes-git-mytharchive() {
  144.   pkgdesc="Create DVDs or archive recorded shows in MythTV"
  145.   depends=("mythtv-0.24-fixes-git" 'cdrkit' 'dvdauthor' 'dvd+rw-tools' 'ffmpeg'
  146.            'python-imaging')
  147.   conflicts=('mythplugins-mytharchive' 'mythplugins-0.24-fixes-svn-mytharchive')
  148.   provides=('mythplugins-mytharchive')
  149.  
  150.   cd "$srcdir/$_gitname-build/mythplugins/mytharchive"
  151.   make INSTALL_ROOT="$pkgdir" install
  152. }
  153.  
  154. package_mythplugins-0.24-fixes-git-mythbrowser() {
  155.   pkgdesc="Mini web browser for MythTV"
  156.   depends=("mythtv-0.24-fixes-git")
  157.   conflicts=('mythplugins-mythbrowser' 'mythplugins-0.24-fixes-svn-mythbrowser')
  158.   provides=('mythplugins-mythbrowser')
  159.  
  160.   cd "$srcdir/$_gitname-build/mythplugins/mythbrowser"
  161.   make INSTALL_ROOT="$pkgdir" install
  162. }
  163.  
  164. package_mythplugins-0.24-fixes-git-mythgallery() {
  165.   pkgdesc="Image gallery plugin for MythTV"
  166.   depends=("mythtv-0.24-fixes-git" 'libexif')
  167.   conflicts=('mythplugins-mythgallery' 'mythplugins-0.24-fixes-svn-mythgallery')
  168.   provides=('mythplugins-mythgallery')
  169.  
  170.   cd "$srcdir/$_gitname-build/mythplugins/mythgallery"
  171.   make INSTALL_ROOT="$pkgdir" install
  172. }
  173.  
  174. package_mythplugins-0.24-fixes-git-mythgame() {
  175.   pkgdesc="Game emulator plugin for MythTV"
  176.   depends=("mythtv-0.24-fixes-git")
  177.   conflicts=('mythplugins-mythgame' 'mythplugins-0.24-fixes-svn-mythgame')
  178.   provides=('mythplugins-mythgame')
  179.  
  180.   cd "$srcdir/$_gitname-build/mythplugins/mythgame"
  181.   make INSTALL_ROOT="$pkgdir" install
  182. }
  183.  
  184. package_mythplugins-0.24-fixes-git-mythmusic() {
  185.   pkgdesc="Music playing plugin for MythTV"
  186.   depends=("mythtv-0.24-fixes-git" 'cdparanoia' 'flac' 'libcdaudio' 'libvisual'
  187.            'libvorbis' 'sdl' 'taglib')
  188.   conflicts=('mythplugins-mythmusic' 'mythplugins-0.24-fixes-svn-mythmusic')
  189.   provides=('mythplugins-mythmusic')
  190.  
  191.   cd "$srcdir/$_gitname-build/mythplugins/mythmusic"
  192.   make INSTALL_ROOT="$pkgdir" install
  193. }
  194.  
  195. package_mythplugins-0.24-fixes-git-mythnetvision() {
  196.   pkgdesc="MythNetvision plugin for MythTV"
  197.   depends=("mythtv-0.24-fixes-git" 'python2-oauth' 'python-pycurl')
  198.   conflicts=('mythplugins-mythnetvision' 'mythplugins-0.24-fixes-svn-mythnetvision')
  199.   provides=('mythplugins-mythnetvision')
  200.  
  201.   cd "$srcdir/$_gitname-build/mythplugins/mythnetvision"
  202.   make INSTALL_ROOT="$pkgdir" install
  203. }
  204.  
  205. package_mythplugins-0.24-fixes-git-mythnews() {
  206.   pkgdesc="News checking plugin for MythTV"
  207.   depends=("mythtv-0.24-fixes-git")
  208.   conflicts=('mythplugins-mythnews' 'mythplugins-0.24-fixes-svn-mythnews')
  209.   provides=('mythplugins-mythnews')
  210.  
  211.   cd "$srcdir/$_gitname-build/mythplugins/mythnews"
  212.   make INSTALL_ROOT="$pkgdir" install
  213. }
  214.  
  215. package_mythplugins-0.24-fixes-git-mythvideo() {
  216.   pkgdesc="Video playback and browsing plugin for MythTV"
  217.   depends=("mythtv-0.24-fixes-git" 'mplayer')
  218.   conflicts=('mythplugins-mythvideo' 'mythplugins-0.24-fixes-svn-mythvideo')
  219.   provides=('mythplugins-mythvideo')
  220.  
  221.   cd "$srcdir/$_gitname-build/mythplugins/mythvideo"
  222.   make INSTALL_ROOT="$pkgdir" install
  223.  
  224.   install -D -m755 "$srcdir/mtd.rc" "$pkgdir/etc/rc.d/mtd"
  225. }
  226.  
  227. package_mythplugins-0.24-fixes-git-mythweather() {
  228.   pkgdesc="Weather checking plugin for MythTV"
  229.   depends=("mythtv-0.24-fixes-git" 'perl-date-manip' 'perl-libwww' 'perl-soap-lite'
  230.            'perl-xml-sax' 'perl-xml-simple' 'perl-xml-xpath' 'perl-image-size'
  231.            'perl-datetime-format-iso8601')
  232.   conflicts=('mythplugins-mythweather' 'mythplugins-0.24-fixes-svn-mythweather')
  233.   provides=('mythplugins-mythweather')
  234.  
  235.   cd "$srcdir/$_gitname-build/mythplugins/mythweather"
  236.   make INSTALL_ROOT="$pkgdir" install
  237. }
  238.  
  239. package_mythplugins-0.24-fixes-git-mythzoneminder() {
  240.   pkgdesc="View CCTV footage from zoneminder in MythTV"
  241.   depends=("mythtv-0.24-fixes-git")
  242.   conflicts=('mythplugins-mythzoneminder' 'mythplugins-0.24-fixes-svn-mythzoneminder')
  243.   provides=('mythplugins-mythzoneminder')
  244.  
  245.   install='mythplugins-mythzoneminder.install'
  246.   cd "$srcdir/$_gitname-build/mythplugins/mythzoneminder"
  247.   make INSTALL_ROOT="$pkgdir" install
  248. }
  249. #pkgdesc again, for AUR parser
  250. pkgdesc="A Homebrew PVR project. Including MythPlugins (Edit PKGBUILD, please!)"
Advertisement
Add Comment
Please, Sign In to add comment