Installing MythTV SVN on Fedora

From MythTV Official Wiki
Revision as of 17:27, 14 March 2007 by RyeBrye (talk | contribs) (fixed formatting of my last change)

Jump to: navigation, search

Credits


Overview

This guide is to help users of Fedora Core to compile MythTV using the Subversion (SVN) source code, to take advantage of the latest (bleeding edge) patches to MythTV.

This overview assumes you already have MythTV running via the guide at http://wilsonet.com/mythtv/

This guide was developed with MythTV 0.19.1 and Fedora Core 4 in mind. Some of the steps are now being checked against Fedora Core 5 (mainly dependencies). Additions are welcome by users of other Fedora Core versions.(This works perfectly for Fedora Core 6 as well: RGN 28-01-07).

This guide was also built with the help of another wiki page Upgrading To SVN

Install prerequisites

Repositories

You will need the atrpms and freshrpms repositories to be installed. See http://wilsonet.com/mythtv/fcmyth.php#xtrarepos for details on how to do this.

 # cd /etc/yum.repos.d/
 # wget http://wilsonet.com/mythtv/atrpms.repo
 # wget http://wilsonet.com/mythtv/freshrpms.repo

Setup a user called mythtv, and login to it

If you have not done so already, create a separate user called mythtv

# adduser mythtv
# passwd mythtv

Remove packages

We need to remove the MythTV packages installed when we followed the MythTV HOWTO. However, this keeps all of the libraries that we need to compile MythTV later.

# rpm -qa | grep myth | xargs rpm -e

Install packages

If your connection requires you to use a proxy server you will need to export your http_proxy value before you can use yum. This will direct yum to use the proxy to connect to outside repositories.

# export http_proxy=http://your_proxy:8080 (:8080 or whatever your proxy port happens to be)


There are a number of development libraries and packages required to compile MythTV. The following commands should obtain them all.

# yum install gcc-c++ freetype-devel lame-devel qt-devel mysql-devel lirc-lib-devel subversion mesa-libGLU-devel libXv-devel libXxf86vm-devel 
  libXmu-devel qt-MySQL libXvMC-devel kdelibs-devel


Run the following to get most of the myth plugin dependencies

# yum install fftw2 fftw2-devel libid3tag libid3tag-devel libmad-devel flac-devel
libtiff-devel libcdaudio-devel SDL-devel cdparanoia-devel libexif-devel fftw3 fftw3-devel
libvorbis-devel faac faac-devel faad2 faad2-devel

If you are going to use firewire support, you need to install the following Firewire development packages:

# yum install  libavc1394 libavc1394-devel libiec61883 libiec61883-devel libraw1394 libraw1394-devel 

This list may not be complete as the requirements will change as new plugins are added. To check on the dependencies, after you have downloaded the code (see below) cd to the mythtv or mythplugins directory, and run:

  grep has_library configure

This will output the test code in each configure file for the required libraries for all dependencies.

If you get the following error message during the myth plugin dependencies installation:

Error: Missing Dependency: libid3tag = 0.15.0b is needed by package libid3tag-devel

this means that you have a library installed that is greater than the development library available (in this case libid3tag-devel is v0.15.0b but libid3tag 0.15.1-3.b is installed). To resolve this do:

# yum remove libid3tag

then run the above yum install and it should resolve the dependencies correctly.

After installing all dependencies, you will need to either run 'ldconfig' in a console, or logout and login again so that paths required to compile are updated for your session.

Install MythTV source code

Now login as the mythtv user you created above.

Here we use subversion to obtain the latest source code,

 $ mkdir mythtv_build
 $ cd mythtv_build
 $ svn co http://svn.mythtv.org/svn/trunk/mythtv
 $ svn co http://svn.mythtv.org/svn/trunk/mythplugins
 $ svn co http://svn.mythtv.org/svn/trunk/myththemes

or, if you prefer to grab everything at once, you could do the following:

 $ mkdir mythtv_build
 $ svn co http://svn.mythtv.org/svn/trunk mythtv_build

This gives you the advantage of being able to cd to the mythtv_build directory and running svn update, which will update all of the subdirectories at once.

Compile the source code

Compile MythTV

If your compile fails check for a symlink to /usr/lib/qt-3.x

# ln -s /usr/lib/qt3 /usr/lib/qt-3.x

Configure the destination and configure the package

The first step is to point MythTV to install at /usr/local instead of /usr just in case we already have various MythTV packages installed from using the MythTV Fedora HOWTO previously.

$ cd /home/mythtv/mythtv_build/mythtv
$ ./configure --prefix=/usr/local

Note: there are a lot of additional command line options for the configure phase. Here's the full command line I used:

$ ./configure --prefix=/usr/local --enable-xvmc --arch=i686 --enable-proc-opt --enable-dvb 

For GCC 4.1: use -arch=prescott for Intel Core Solo/Duo -arch=nocona for Core 2 Solo/Duo

For GCC 4.2: a Core Solo/Duo should use -arch=prescott -mtune=generic Core 2 Solo/Duo should be set to -arch=nocona -mtune=generic. (GCC trunk adds -arch=core2 and support for the SSSE3 instruction set, but that won't be out for quite a while yet.)

For GCC 4.2, try -arch=native, which will autodetect the host processor(s) and set -march and -mtune accordingly.

A more complete command line script is given below in 'Automating the Entire Process'.

To check out all of the configure options use ./configure --help

$ qmake PREFIX=/usr/local mythtv.pro

Start the MythTV compile

$ make
  • If you get errors regarding qt-mt missing and you have qt and qt-devel installed you must 'export QTDIR=/usr/lib/qt-3.3/' (For qt 3.3 that is) or 'export QTDIR=/usr/lib64/qt-3.3' for x86_64 version.

Now install mythtv (you should still be logged in as root to do this):

# su
# make install

Auto-starting Mythbackend

Now we'll ensure that the mythbackend will start automatically when the PC reboots:

# cd contrib
# cp etc.rc.d.init.d.mythbackend /etc/rc.d/init.d/mythbackend
# chmod a+x /etc/rc.d/init.d/mythbackend
# cp etc.sysconfig.mythbackend /etc/sysconfig/mythbackend
# /sbin/chkconfig --level 345 mythbackend on
# echo "/usr/local/lib" >> /etc/ld.so.conf
# /sbin/ldconfig
# exit

Start the MythPlugins compile

$ cd ../mythplugins

There is a long list of switches in the mythplugins configure file. Run ./configure --help, and determine what you wish to enable or disable. You may wish to save your command line in another file. The options change from time to time, so check whenever you update. As a minimum you need the following:

$ ./configure --prefix=/usr/local
$ qmake mythplugins.pro
$ make

If you receive an error message of something like -lrfftw not found during the compile, you may need to do the following

$ su
# cd /usr/lib
# ln -s librfftw.so.2.0.7 librfftw.so
# ln -s libfftw.so.2.0.7 libfftw.so
# exit

then just do a make as before

After the make has completed successfully you need to install the plugins:

$ su
# make install

Install of MythThemes

Basic steps are

# cd myththemes
# ./configure --prefix=/usr/local
# make
# make install

Install of Mythweb

# cp -r mythplugins/mythwev/*.* /var/www/html/

You may need to edit the configuration file, especially if above you changed main directory or your myth user is not mythtv

# vi /var/www/html/mythweb.conf.apache

Next you will need to copy the configuration file to the httpd

# cp /var/www/html/mythweb.conf.apache /etc/httpd/conf.d/mythweb.conf

Finally restart the httpd

# /etc/init.d/httpd restart

Now if the backend is running you should be able to access mythweb

Configuration

You are now ready to configure your MythTV system

$ su -
# mythtv-setup
# service mythbackend start

Applying SVN upgrades

One of the advantages of running SVN is that you can download the latest revision of MythTV. There are usually 5 or more updates a day to the MythTV source code.

What has changed since I last compiled MythTV?

You should subscribe to the mythtv-commits mailing list. Subscribe to the list or browse a web interface.

After install of SVN I get an error message of shared library xxx.so not found

Sometimes there will be a brand new library added to mythtv. On 26 March 2006, I had an issue with libfreemheg.so.19 not found when trying to start mythbackend. By running:

/sbin/ldconfig

before starting the mythbackend, this cleared the problem.

make clean / make distclean

Sometimes when there is an update, there will be a comment in there which says "make clean" or "make distclean". If you need to perform a make distclean, you will lose all of your previous ./configure parameters. It is recommended you keep your own compile parameters in a separate .sh file so you can easily rebuild if you need to perform a make distclean.

Here's a couple of scripts I use to make life easier:

--- doconfig.sh ---
cd mythtv
make distclean
./configure --prefix=/usr/local --enable-xvmc --arch=i686 --enable-proc-opt --enable-dvb
qmake PREFIX=/usr/local mythtv.pro
cd ../mythplugins
make distclean
./configure
qmake mythplugins.pro
--- domake.sh ---
cd mythtv
make -j 2
cd ../mythplugins
make -j 2

'make clean' is only needed if you are re-'making' code which you have 'made' before. It cleans out any already-compiled '.o' files. It does not affect the configuration. 'make distclean' removes the configuration. If you upgrade often, then you do not need to do a 'distclean' often.


Automating the Entire Process: Download, Compile and Install

I have mentioned these on the list and received requests for copies so I am posting them here. (R. Geoffrey Newbury). I use the following scripts to automate the entire process. I have a PVR500 tuner, an HD3000 tuner and an HDHomeRun on order. I use lirc and my BE/FE is a Via Sp13000 motherboard, thus the particular config choices for xvmc etc. (The download is done to the 'usb' folder and copied to a usb key for transfer from the office to my home for use on the mythbox, thus the folder names. My 'high-speed' times out on downloading svn).

The entire process is done calling two scripts 'call-svn.sh' and 'all-build.sh' and using three 'config.sh' files for the configurations.

Get a complete svn code set:

*******************************************
----- call-svn.sh -----
Clears old svn code base and downloads complete new set.
cd /backup/usb
rm -rf myththemes
rm -rf mythplugins
rm -rf mythtv
svn co http://svn.mythtv.org/svn/trunk/mythtv
svn co http://svn.mythtv.org/svn/trunk/myththemes
svn co http://svn.mythtv.org/svn/trunk/mythplugins
*******************************************


The 'all-build' script calls the config scripts to configure the three myth subsystems and builds them all. All of my configure scripts are saved in /usr/local/sbin. For curiosity, I write the date/time to a log file and display it at the end of the run. Running 'all-build' as root will configure, make and make install a complete Mythtv setup without further interaction. Since the build process takes about an hour and a half, this is often the last thing I start before going to bed! If I am recording something at bedtime, I comment out the 'make install' calls, and do those by hand in the morning.

NOTE: mythbackend should NOT be running if the script will do 'make install'. Remember to 'service mythbackend stop'.

To build everything in one script.

*******************************************
#  ----- all-build.sh   # RUN AS ROOT  
cd /backup/usb
echo "Commence build" > /backup/usb/log.out
date >> /backup/usb/log.out
#  Clean out old config scripts and replace with good ones, equals 'make distclean'
rm -f /backup/usb/myththemes/configt.sh
rm -f /backup/usb/mythplugins/configp.sh
rm -f /backup/usb/mythtv/config.sh
cp /usr/local/sbin/configt.sh /backup/usb/myththemes
cp /usr/local/sbin/configp.sh /backup/usb/mythplugins
cp /usr/local/sbin/config.sh /backup/usb/mythtv
echo "End cleanup and copy of configuration" >> /backup/usb/log.out
date >> /backup/usb/log.out
# Commence actual build process
echo "Commence Mythtv build" >> /backup/usb/log.out
cd /backup/usb/mythtv
make clean   # not actually needed for a new download
./config.sh  # run configure
qmake mythtv.pro
make && make install
echo "End mythtv make" >> /backup/usb/log.out
date >> /backup/usb/log.out
echo "Commence myththeme build"
cd /backup/usb/myththemes
make clean
./configt.sh  # run configure
qmake myththemes.pro
make && make install
echo "End myththemes" >> /backup/usb/log.out
date >> /backup/usb/log.out
echo "Commence mythplugin build" >> /backup/usb/log.out
cd /backup/usb/mythplugins
make clean
./configp.sh  #run configure
qmake mythplugins.pro
make && make install
echo "End mythplugins" >> /backup/usb/log.out
date >> /backup/usb/log.out
cd /backup/usb
cat log.out
# *******************************************


These are my configure files;

**************************************
# ---- config.sh
# configure for mythtv
# For Via Nehemiah cpu and unichrome-pro (xvmc capable) video chipset 
./configure --prefix=/usr/local   \
--arch=i686           \
--enable-proc-opt     \
--enable-audio-alsa   \
--disable-audio-arts  \
--disable-audio-jack  \
--disable-directfb    \
--enable-lirc         \
--enable-v4l          \
--enable-ivtv         \
--disable-firewire    \
--enable-dvb          \
--dvb-path=/usr/include \
--enable-xvmc         \
--enable-hdhomerun    \
--enable-xvmc-vld     \
--enable-xvmc-pro     \
--enable-xvmc-opengl  \
--enable-opengl-vsync \
--disable-dbox2       \
--disable-iptv        \
# **************************************
**************************************
#  ---- configp.sh
# configure for mythplugins
./configure              \
--prefix=/usr/local     \
--enable-opengl         \
--enable-transcode      \
--enable-vcd            \
--enable-mytharchive    \
--enable-create-dvd     \
--enable-create-archive \
--disable-mythbrowser   \
--enable-mythcontrols   \
--enable-mythdvd        \
--disable-mythflix      \
--enable-mythgallery    \
--enable-exif           \
--enable-new-exif       \
--disable-mythgame      \
--enable-mythmusic      \
--enable-fftw           \
--enable-sdl            \
--enable-aac            \
--disable-mythnews      \
--disable-mythphone     \
--disable-festival      \
--enable-mythvideo      \
--enable-mythweather    \
--disable-mythzoneminder
# **************************************
# **************************************
#  --- configt.sh
# configure for mythplugins
./configure  --prefix=/usr/local
**************************************

Updating your source code

Use the same svn commands as shown above to checkout the source trees, but use 'svn update...' instead of 'svn checkout..'. You can use 'svn up' and svn co' instead. SVN is smart enough to download only the files that have been updated.