Linux HOWTOs

About | Home | Search

HOWTO: mythtv-svn
Description: Homebrew PVR (like TiVo, Freevo, etc.) project
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# MythTV 0.20 from Subversion
# ===========================
# This version of the howto installs MythTV 0.20 from Subversion, the copy
# of 0.20 in the Subversion repository includes fixes that the 0.20 tarball
# doesn't.
# Here are the release notes for this version, which will probably become version 0.20.1

# Here are some links that may be helpful with installing and using MythTV:
# MythTV Home Page
# MythTV Wiki (FAQ, HOWTOs, ...)
# MythTV Users mailing list archive
# MythTV Forum
# MythTV Trac
# KnoppMyth - A Knoppix + MythTV CD
# MythDora - A Fedora Core + MythTV CD

# If you ever want to uninstall MythTV, or just clean up files from an
# older version before installing a new one, skip down to the bottom for
# instructions.

# Prerequisites:
# Subversion
# libmp3lame
# xmltv (if the backend and frontend are different machines,
#  it's only required on the backend)
# MySQL (ditto)
# Configured DataDirect service
# lirc (for remote control support)
# ivtv (if that's the kind of card that you have)
# DVB support in your kernel
# aRts
# Jack
# XFree86 or
# DirectFB
# Qt

# If you run Slackware, make sure you have the kernel-headers module
# installed that came with Slackware (2.4.x) and not the one from testing
# (2.6.x) or it will fail to build because of the 2.6 version of joystick.h

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "mythtv-*" -exec rm -r {} \;
test -d ./mythtv && ( cd mythtv ; svn up )
test ! -d ./mythtv &&
 svn co
cd mythtv
test $UID = 0 && chown -R root:root .

# Become root to install it

# Read ./UPGRADING to make sure you don't have to do anything extra if
# you're upgrading from an older version.

# If this is an upgrade for you, back up your existing MySQL database.
# -u is your MySQL username, -p is your password, if your database is not
# named "mythconverg" replace that with whatever it is.  If your MySQL
# server is on a different host, add -h (before the db name).
test ! -d ~/backup && mkdir -p -m 0700 ~/backup
mysqldump -u mythtv -pmythtv mythconverg -c > ~/backup/mythtv.sql

# Configure MySQL:
# This is only be necessary if this is a new installation.  Database updates
# will be handled automatically when you upgrade.  Leave off the -p if you
# don't have a MySQL root password set (!!).  If your MySQL server is a
# remote machine, scp mc.sql to it and run it there.
( cd database ; mysql -p < mc.sql )

# Stop mythbackend if it's running:
test -x /etc/rc.d/rc.mythbackend && /etc/rc.d/rc.mythbackend stop
sleep 2
killall mythbackend

# Remove files from old versions:
test -d /usr/local/include/mythtv && rm -r /usr/local/include/mythtv
test -d /usr/local/lib/mythtv && rm -r /usr/local/lib/mythtv
test -d /usr/local/share/mythtv && rm -r /usr/local/share/mythtv
( cd /usr/local/bin ; rm -f mythbackend mythbrowser mythcommflag mythepg \
 mythfilldatabase mythfrontend mythjobqueue mythlcdserver mythprogfind \
 mythreplex mythshutdown mythtranscode mythtv mythtv-setup mythtvosd \
 mythwelcome )
( cd /usr/local/lib ; rm -f libmyth-* libmythavcodec-* libmythavformat-* \
 libmythavutil-* libmythdvdnav-* libmythfreemheg-* libmythlivemedia-* \
 libmythmpeg2-* libmythsamplerate-* libmythsoundtouch-* libmythtv-* \
 libmythui-* libmythupnp-* )

# Install the new version:
make install

# You can find a sample init script or two in contrib, or try mine.  Add
# something to rc.local to start "/etc/rc.d/rc.mythbackend start" on boot-up
# and "/etc/rc.d/rc.mythbackend stop" to rc.0/rc.6 to stop it on
# shut-down/reboot.
cd /etc/rc.d
test -f rc.mythbackend &&
 ( mv -f rc.mythbackend rc.mythbackend.old
   chmod 600 rc.mythbackend.old )
wget -nc
chmod 700 rc.mythbackend

# Set up logrotate to rotate mythbackend's logfile:
cat << EOF > /etc/logrotate.d/mythbackend
/var/log/mythbackend.log {
  rotate 6

# Become yourself again

mkdir -p -m 0700 installed
rm -f installed/mythtv-*.tar.*
echo "MythTV was installed from Subversion into ~/src/mythtv" \
 > ~/installed/mythtv.README
chmod 600 ~/installed/mythtv.README

# If this is an upgrade for you, after you have the themes and plugins
# installed, you'll want to stop mythbackend and run mythtv-setup before
# trying to use it.  

# All of the other procedures for installing are covered here:

# Themes
# ======
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "myththemes-*" -exec rm -r {} \;
test -d ./myththemes && ( cd myththemes ; svn up )
test ! -d ./myththemes &&
 svn co
cd myththemes
test $UID = 0 && chown -R root:root .
su -c "make install"
mkdir -p -m 0700 installed
rm -f installed/myththemes-*.tar.*
echo "MythTV themes were installed from Subversion into ~/src/myththemes" \
 > ~/installed/myththemes.README
chmod 600 ~/installed/myththemes.README

# Plugins
# =======
# Prerequisites (beyond those listed above):
# MythBrowser:
# MythDVD:
# libdvdread (this down to transcode are required for transcoding)
# nasm
# mjpegtools
# xvid
# liba52
# libfame
# transcode
# libdvdcss (to read encrypted DVDs)
# mplayer, ogle, and/or xine (to play DVDs), xine for VCDs
# MythGallery:
# libtiff
# libexif
# MythGame:
# zlib
# MythMusic:
# mad
# vorbis
# flac
# libcdaudio
# cdparanoia
# fftw (optional)
# sdl (optional)
# faad (optional) - With 2.x, copy common/mp4ff/mp4ff_int_types.h
#  and common/mp4ff/mp4ff.h to /usr/local/include/ and
#  common/mp4ff/libmp4ff.a to /usr/local/lib/
# MythPhone:
# festival (optional)

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "mythplugins-*" -exec rm -r {} \;
test -d ./mythplugins && ( cd mythplugins ; svn up )
test ! -d ./mythplugins &&
 svn co
cd mythplugins
test $UID = 0 && chown -R root:root .

# My KDE is installed under /opt/kde, the MythTV source assumes that it's
# /opt/kde3.  Here I fix the path in a few places.  If yours is installed
# /under /opt/kde3, skip this part.  If you're not going to install
# MythBrowser, skip this part.
grep -q /opt/kde3 configure &&
 ( cat configure | sed 's%/opt/kde3%/opt/kde%' >
   test -s &&
    ( mv -f configure configure.orig
      mv -f configure
      chmod 700 configure
      chmod 600 configure.orig ) )
grep -q /opt/kde3 mythbrowser/mythbrowser/ &&
 ( cd mythbrowser/mythbrowser
   cat | sed 's%/opt/kde3%/opt/kde%' >
   test -s &&
    ( mv -f
      mv -f ) )

# I gave up on getting Festival to build in to it.  I think the configure
# script is totally missing the SPEECHTOOLSDIR part, it doesn't honor
# FESTIVALDIR or SPEECHTOOLSDIR for finding the libraries, ...  for me, not
# worth all of the changes that I'd have to make.  I tried it with 0.20,
# didn't even bother with the version from Subversion.

# If you want to build and install all plugins in one shot, after making
# sure you've got all of the prerequisites installed, configure it with
# --enable-all.  Otherwise see './configure --help' to see how to enable
# certain plugins.  Also check out myth*/README

# If make fails for you (it did for me) mentioning AlbumMap, open up
# mythmusic/mythmusic/playlist.cpp and add this line:
# #include <map>
# then re-run make again.

# FYI, I did build and install all of them, but ended up disabling mythphone
# by renaming to in
# /usr/local/lib/mythtv/plugins.  It tries to make a SIP connection on
# startup, slowing it down a little...

./configure --enable-all
su -c "make install"
mkdir -p -m 0700 installed
rm -f installed/mythplugins-*.tar.*
echo "MythTV plugins were installed from Subversion into \
~/src/mythplugins" > ~/installed/mythplugins.README
chmod 600 ~/installed/mythplugins.README

# (Re)start mythbackend (if this is an upgrade and you're done):
su -c "/etc/rc.d/rc.mythbackend start"

# Once it's running and all is well, you can see it's status here (unless
# you change the default port):
# http://localhost:6544/
# (if it's not running on localhost, replace that with where it is running)

# If you ever want to uninstall mythtv, this should do it:
test -d src/mythtv && ( cd src/mythtv ; make uninstall )
test -d src/mythtv-* && ( cd src/mythtv-* ; make uninstall )
test -d src/myththemes && ( cd src/myththemes ; make uninstall )
test -d src/myththemes-* && ( cd src/myththemes-* ; make uninstall )
test -d src/mythplugins && ( cd src/mythplugins ; make uninstall )
test -d src/mythplugins-* && ( cd src/mythplugins-* ; make uninstall )
rm -f /etc/logrotate.d/mythbackend
( cd /usr/local/bin ; rm -f mythbackend mythcommflag mythfilldatabase \
 mythfrontend mythepg mythjobqueue mythprogfind mythtranscode mythtv \
 mythtv-setup mythtvosd )
( cd /usr/local/lib ; rm -f libmyth-* libmythtv-* libmythavcodec-* \
 libmythavformat-* libmythmpeg2-* libmythsamplerate-* libmythsoundtouch-* )
test -d /usr/local/lib/mythtv && rm -r /usr/local/lib/mythtv
test -d /usr/local/share/mythtv && rm -r /usr/local/share/mythtv
test -d /usr/local/include/mythtv && rm -r /usr/local/include/mythtv
test ~/src/mythtv && rm -r ~/src/mythtv
test ~/src/myththemes && rm -r ~/src/myththemes
test ~/src/mythplugins && rm -r ~/src/mythplugins
find ~/src -maxdepth 1 -type d -name "mythtv-*" -exec rm -r {} \;
find ~/src -maxdepth 1 -type d -name "myththemes-*" -exec rm -r {} \;
find ~/src -maxdepth 1 -type d -name "mythplugins-*" -exec rm -r {} \;
( cd ~/installed ; rm -f mythtv-*.tar.* myththemes-*.tar.* \
 mythplugins-*.tar.* mythtv.README myththemes.README mythplugins.README )
test -d ~/.mythtv &&
 ( mkdir -p -m 0700 ~/backup/home-${USER}-dot-mythtv
   cp -a ~/.mythtv/* ~/backup/home-${USER}-dot-mythtv/
   rm -r ~/.mythtv )

# If you see anything else left over in /usr/local/bin, /usr/local/lib,
# /usr/local/share, or /usr/local/include that has myth in it, it's probably
# part of MythTV.  After confirming that, remove it too.

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>