Difference between revisions of "Installing MythTV SVN on Fedora"

From MythTV Official Wiki
Jump to: navigation, search
m (Install packages)
m (Protected "Installing MythTV SVN on Fedora": Historical archive: no reason to edit, svn is no longer in use ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(76 intermediate revisions by 17 users not shown)
Line 1: Line 1:
 +
{{Outdated}}
 +
 +
{{Note box|See [[mythtv-rpmbuild.spec]], instead.}}
 +
 
Credits
 
Credits
 
* original WIKI by [[User:Richard Dale|Richard Dale]] Feb 2006
 
* original WIKI by [[User:Richard Dale|Richard Dale]] Feb 2006
Line 7: Line 11:
 
== Overview ==
 
== 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 guide is to help users of Fedora compile MythTV using the subversion (SVN) source code, which allows them to take advantage of the latest (bleeding edge) patches to MythTV.  It was originally developed with MythTV 0.19.1 and Fedora Core 4 in mind.  It is more or less valid for all versions since then up to and including Fedora 9.  Continued additions are welcome by users of future versions of Fedora.  This document assumes you already have a working Fedora installation.
 +
 
 +
Commands shown in this guide use the standard notation for indicating which can be run as the normal user and which must be run as root: commands preceded by "#" are to be run as root, whereas those preceded by "$" are to be run as the normal user.
  
This overview assumes you already have MythTV running via the guide at http://wilsonet.com/mythtv/
+
== Install Prerequisites ==
  
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).
+
=== Remove Old Versions ===
  
This guide was also built with the help of another wiki page [[Upgrading To SVN]]
+
If you are upgrading to MythTV SVN from an rpm installation from [[ATrpms]], you must first remove all of the MythTV rpms that were installed.
  
== Install prerequisites ==
+
# yum remove \*myth\*
  
 
=== Repositories ===
 
=== Repositories ===
  
You will need the atrpms and freshrpms repositories to be installedSee http://wilsonet.com/mythtv/fcmyth.php#xtrarepos for details on how to do this.
+
In order to be able to easily install all of the dependencies needed for MythTV, you will need to have the livna repository configured and enabled.  If you want to have other repositories enabled as well, such as ATrpms or freshrpms, you may, but beware that enabling more than one third-party repositories can cause problems that are very difficult to clear upThe best way to safely configure many common third-party repositories is to use the rpm provided by [http://www.fedorafaq.org/#installsoftware fedorafaq] and install the ''yum-priorities'' plugin:
<pre>
+
 
  # cd /etc/yum.repos.d/
+
# yum install yum-priorities
  # wget http://wilsonet.com/mythtv/atrpms.repo
+
  # echo 'check_obsoletes = 1' >> /etc/yum/pluginconf.d/priorities.conf
  # wget http://wilsonet.com/mythtv/freshrpms.repo
+
  # rpm -Uvh http://www.fedorafaq.org/f9/yum http://rpm.livna.org/livna-release-9.rpm
</pre>
+
 
 +
This will install the configuration files to many popular repositories. The ''yum-priorities'' plugin should prevent conflicting packages from being installed at the same time.  If you don't trust it, the safest thing to do is to disable all of the repositories except fedora, extras, adobe-linux, and livna by going into each of the other configuration files in /etc/yum.repos.d/ and setting "enabled=0".
 +
{{Note box | As of 04:48, 26 May 2008 (UTC), fedorafaq still has not released a yum configuration rpm for F9.  You can still continue using this guide using only the livna repository without any problems.}}
 +
 
 +
 
 +
{{Tip box | BEST PRACTICE is to only enable one repo at a time, and NEVER run 'yum update' or 'yum upgrade' without naming a specific package to be updated. (The exception of course, is the one-time, right-after-install 'yum update' when you have NO other repos enabled.) }}
 +
 
 +
=== Video Drivers ===
 +
 
 +
Many systems with NVIDIA or ATI graphics cards will require proprietary video drivers to provide smooth playback.  Installing the drivers is simple if you have the livna repository enabled.  For NVIDIA cards:
 +
# yum install kmod-nvidia
 +
 
 +
Or if you have an ATI card:
 +
# yum install kmod-fglrx
 +
{{Note box|The current release of Fedora 9 ships with X Server 1.4.99 which requires NVIDIA driver 173.14 or later.}}
  
 +
<!-- I've always been unsure of the benefits of making a separate mythtv user
 +
I'm commenting this out for now.
 
=== Setup a user called mythtv, and login to it ===
 
=== Setup a user called mythtv, and login to it ===
  
Line 31: Line 53:
 
  # adduser mythtv
 
  # adduser mythtv
 
  # passwd mythtv
 
  # passwd mythtv
 
+
-->
=== Remove packages ===
 
 
 
We need to remove the MythTV packages installed when we followed the [http://wilsonet.com/mythtv/fcmyth.php|Fedora 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 ===
 
=== 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.
+
There are a number of development libraries and packages required to compile MythTV.  The following commands should obtain them all:
  # export http_proxy=http://your_proxy:8080 (:8080 or whatever your proxy port happens to be)
+
# yum install gcc-c++ freetype-devel lame-devel qt-devel mysql-server mysql-devel lirc lirc-devel
 +
  # yum install subversion mesa-libGLU-devel libXv-devel libXxf86vm-devel libdca-devel make
 +
  # yum install libXmu-devel qt-MySQL libXvMC-devel kdelibs-devel arts-devel perl-ExtUtils-MakeMaker
 +
(For Fedora 8 I found I wanted the package <tt>qt4-mysql</tt> rather than <tt>qt-MySQL</tt> (or in addition to it?))
  
  
There are a number of development libraries and packages required to compile MythTV.  The following commands should obtain them all.
+
Run the following commands to get most of the dependencies for MythTV's plugins:
  # yum install gcc-c++ freetype-devel lame-devel qt-devel mysql-devel lirc-lib-devel subversion
+
  # yum install fftw2 fftw2-devel libid3tag libid3tag-devel libmad-devel flac-devel libdvdcss-devel
  yum install mesa-libGLU-devel libXv-devel libXxf86vm-devel  
+
  # yum install libtiff-devel libcdaudio-devel SDL-devel cdparanoia-devel libexif-devel fftw3 fftw3-devel
  yum install libXmu-devel qt-MySQL libXvMC-devel kdelibs-devel
+
  # yum install libvorbis-devel faac faac-devel faad2 faad2-devel taglib taglib-devel libvisual-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
  
Run the following commands to get most of the myth plugin dependencies
+
After installing the driver rpms and all of the dependent packages, you will have to reboot so that the kernel modules and paths load correctly.  In fact, it appears you may need to reboot twice to get the kernel modules fully installed.
# yum install fftw2 fftw2-devel libid3tag libid3tag-devel libmad-devel flac-devel
 
  yum install libtiff-devel libcdaudio-devel SDL-devel cdparanoia-devel libexif-devel fftw3 fftw3-devel
 
  yum install 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:
+
=== Troubleshooting ===
# 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:
+
* 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.
   grep has_library configure
+
<pre>
This will output the test code in each configure file for the required libraries for all dependencies.
+
# export http_proxy=http://your_proxy:8080 (or whatever your proxy port happens to be)
 +
</pre>
 +
* The list of packages to install may not be complete as the requirements will change as new plugins are added. To check on the dependencies, after you have downloaded the source 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:
+
* If you get the following error message during the MythPlugins dependency installation:
 
  Error: Missing Dependency: libid3tag = 0.15.0b is needed by package libid3tag-devel
 
  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:
+
: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
 
  # yum remove libid3tag
then run the above yum install and it should resolve the dependencies correctly.
+
: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 ==
  
=== Install MythTV source code ===
+
<!--'''Now login as the mythtv user you created above.''' -->
  
'''Now login as the mythtv user you created above.'''
+
If you haven't done so already, it may be a good idea to change the ownership on /usr/local so your main user can download source here:
 +
# chown `whoami`.`whoami` /usr/local
  
Here we use subversion to obtain the latest source code,
+
Here we use subversion to obtain the latest source code:
<pre>
+
 
  $ mkdir mythtv_build
+
$ cd /usr/local
  $ cd mythtv_build
+
  $ svn co http://svn.mythtv.org/svn/trunk mythtv
 +
{{Note box|If you prefer to install the 0.21 fixes branch instead of trunk, point svn to http://svn.mythtv.org/svn/branches/release-0-21-fixes instead.}}
 +
 
 +
or, if you prefer to setup the primary components of MythTV separately:
 +
 
 +
  $ cd /usr/local
 
  $ svn co http://svn.mythtv.org/svn/trunk/mythtv
 
  $ 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/mythplugins
 
  $ svn co http://svn.mythtv.org/svn/trunk/myththemes
 
  $ svn co http://svn.mythtv.org/svn/trunk/myththemes
</pre>
 
  
or, if you prefer to grab everything at once, you could do the following:
+
The former method gives you the advantage of being able to cd to the mythtv directory and running svn update, which will update all of the subdirectories at once. It also will pull in more components including extra themes. The rest of this guide will assume that this method has been used.
<pre>
+
 
  $ mkdir mythtv_build
 
  $ svn co http://svn.mythtv.org/svn/trunk mythtv_build
 
</pre>
 
  
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 MythTV ===
  
== Compile the source code ==
+
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.
  
=== Compile MythTV ===
+
$ cd /usr/local/mythtv/mythtv
 +
$ ./configure --prefix=/usr/local
  
If your compile fails check for a symlink to /usr/lib/qt-3.x
+
'''Note:''' x86_64 users will have to add ''--libdir-name=lib64''
# ln -s /usr/lib/qt3 /usr/lib/qt-3.x
 
  
==== Configure the destination and configure the package ====
+
The recommended way to enable processor optimizations is with the flag --enable-proc-opt.
  
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.
+
Though not recommended the following flags will enable custom processor optimizations for various versions of GCC:
 +
* For GCC 4.1:
 +
**''--arch=prescott'' for Intel Core Solo/Duo
 +
**''--arch=nocona'' for Core 2 Solo/Duo
 +
*For GCC 4.2:
 +
**''--arch=prescott --mtune=generic'' for Core Solo/Duo
 +
**''--arch=nocona --mtune=generic'' for Core 2 Solo/Duo
 +
*GCC trunk adds support for the SSSE3 instruction set:
 +
**''--arch=core2''
  
$ cd /home/mythtv/mythtv_build/mythtv
+
'''Note:''' For GCC 4.2, try ''--arch=native'', which will autodetect the host processor(s) and set ''--march'' and ''--mtune'' accordingly.
$ ./configure --prefix=/usr/local
 
  
'''Note:''' there are a lot of additional command line options for the ''configure'' phaseHere's the full command line I used:
+
There are a lot of additional command line options for the ''configure'' scriptA useful command line might be:
  $ ./configure --prefix=/usr/local --enable-xvmc --arch=i686 --enable-proc-opt --enable-dvb  
+
  $ ./configure --prefix=/usr/local --enable-xvmc --arch=native --enable-dvb  
  
For GCC 4.1:
+
Use
use -arch=prescott for Intel Core Solo/Duo
+
$./configure --help
-arch=nocona for Core 2 Solo/Duo
+
to view all options on this command.  A more complete command line script is given below in [[Installing MythTV SVN on Fedora#Automating the Entire Process: Download, Compile, and Install|Automating the Entire Process]].
  
For GCC 4.2:
+
To continue with the compilation, run:
a Core Solo/Duo should use -arch=prescott -mtune=generic
+
$ make
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.
+
Now install mythtv (you should be logged in as root to do this):
 +
# make install
  
A more complete command line script is given below in 'Automating the Entire Process'.
+
Before continuing be sure that the directory contaning the installed libraries in known by ld.so:
 +
# echo "/usr/local/lib" >> /etc/ld.so.conf
 +
# /sbin/ldconfig
 +
{{Note box|x86_64 users should echo "/usr/local/lib64" instead.}}
  
To check out all of the configure options use ''./configure --help''
+
=== Compile MythPlugins ===
  
  $ qmake PREFIX=/usr/local mythtv.pro
+
  $ cd ../mythplugins
  
==== Start the MythTV compile ====
+
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
 
  $ make
 
  $ 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.
+
'''Note:''' x84_64 users will have to pass ''--libdir-name=lib64'' as well.
  
Now install mythtv (you should still be logged in as root to do this):
+
Then install the plugins as root:
# su
 
 
  # make install
 
  # make install
  
==== Auto-starting Mythbackend ====
+
=== Install MythThemes ===
  
Now we'll ensure that the mythbackend will start automatically when the PC reboots:
+
The stock MythThemes can be installed by:
# 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 ../myththemes
 +
$ ./configure --prefix=/usr/local
 +
$ make
  
  $ cd ../mythplugins
+
Then install the themes as root:
 +
  # make install
  
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:
+
Similarly, the extended themes are installed by:
  
 +
$ cd ../themes
 
  $ ./configure --prefix=/usr/local
 
  $ ./configure --prefix=/usr/local
$ qmake mythplugins.pro
 
 
  $ make
 
  $ make
  
If you receive an error message of something like ''-lrfftw not found'' during the compile, you may need to do the following
+
Then, as root:
$ su
+
# make install
 +
 
 +
=== Troubleshooting ===
 +
 
 +
* 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.  Alternatively, check for a symlink to /usr/lib/qt-3.x
 +
# ln -s /usr/lib/qt3 /usr/lib/qt-3.x
 +
 
 +
:The location on newer installs may be /usr/lib/qt-3.3
 +
 
 +
# ln -s /usr/lib/qt-3.3 /usr/lib/qt-3.x
 +
 
 +
* If you receive an error message of something like ''-lrfftw not found'' during the MythPlugins compile, you may need to do the following:
 +
 
 
  # cd /usr/lib
 
  # cd /usr/lib
 
  # ln -s librfftw.so.2.0.7 librfftw.so
 
  # ln -s librfftw.so.2.0.7 librfftw.so
 
  # ln -s libfftw.so.2.0.7 libfftw.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:
+
== Post-Install Configuration ==
  $ su
+
 
  # make install
+
=== Initialize Database ===
 +
 
 +
To start the MySQL server for this session and at every boot, issue the following commands:
 +
 
 +
# /sbin/service mysqld start
 +
# /sbin/chkconfig --level 345 mysqld on
 +
 
 +
If this is the first time MySQL has been started, you should run the MySQL secure installation script to disable anonymous usage and to set the root password.
 +
 
 +
$ mysql_secure_installation
 +
 
 +
Finally, run MythTV's MySQL setup script to initialize the mythconverg database:
 +
 
 +
  $ mysql -u root -p < /usr/local/mythtv/mythtv/database/mc.sql
 +
 
 +
=== Setup MythWeb===
 +
Install packages needed by MythWeb
 +
  # yum install httpd php php-mysql
  
==== Install of MythThemes====
+
The MythWeb files must be copied to Apache's http directory:
 +
# cd /usr/local/mythtv/mythplugins/mythweb
 +
# cp -r * /var/www/html
 +
Next move the configuration file to the Apache configuration directory:
  
Basic steps are
+
#  mv /var/www/html/mythweb.conf.apache /etc/httpd/conf.d/mythweb.conf
  
# cd myththemes
+
You'll then need to make sure your web server can write to the 'data' directory in MythWeb
# ./configure --prefix=/usr/local
 
# make
 
# make install
 
  
==== Install of Mythweb====
+
# chgrp -R apache /var/www/html/data
 +
# chmod g+rw /var/www/html/data
 +
{{Note box|If you have SELinux enabled, you'll need to run:}}
  
  # cp -r mythplugins/mythwev/*.* /var/www/html/
+
  # /usr/sbin/setsebool -P httpd_can_network_connect=1
 +
# chcon -R -t httpd_sys_content_t '/var/www/html/data'
  
You may need to edit the configuration file, especially if above you changed main directory or your myth user is not mythtv
+
Finally start the httpd daemon for this session configure Apache to start at every boot:
# vi /var/www/html/mythweb.conf.apache
 
  
Next you will need to copy the configuration file to the httpd
+
# /sbin/service httpd restart
  # cp /var/www/html/mythweb.conf.apache /etc/httpd/conf.d/mythweb.conf
+
  # /sbin/chkconfig --level 345 httpd on
  
Finally restart the httpd
+
If the backend is running you should be now able to access MythWeb.
# /etc/init.d/httpd restart
 
  
Now if the backend is running you should be able to access mythweb
+
=== Auto-start Mythbackend ===
  
==== Configuration ====
+
Now we'll ensure that the mythbackend will start automatically when the PC reboots:
 +
# cd /usr/local/mythtv/mythtv/Linux/contrib/init_scripts
 +
# cp fedora.init.mythbackend /etc/rc.d/init.d/mythbackend
 +
# cp fedora.sysconfig.mythbackend /etc/sysconfig/mythbackend
 +
# /sbin/chkconfig --level 345 mythbackend on
 +
{{Note box|Make sure your MythTV log directory exists (/var/log/mythtv).}}
 +
 
 +
=== MythTV Configuration ===
  
 
You are now ready to configure your MythTV system
 
You are now ready to configure your MythTV system
  $ su -
+
  $ mythtv-setup
# mythtv-setup
+
 
 +
Then, as root:
 
  # service mythbackend start
 
  # service mythbackend start
  
== Applying SVN upgrades ==
+
== Maintaining an SVN Installation ==
  
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. 
+
=== Updating the Source Code ===
  
=== What has changed since I last compiled MythTV? ===
+
One of the advantages of running SVN is that you can quickly and easily download the latest revision of MythTV.  There are usually 5 or more updates a day to the MythTV source code.  To update your your copy of MythTV go to the directory that holds the SVN code and run
  
You should subscribe to the mythtv-commits mailing list. Subscribe to the [http://www.mythtv.org/mailman/listinfo/mythtv-commits/ list] or browse a [http://www.gossamer-threads.com/lists/mythtv/commits/ web interface].
+
  $ svn update
  
== After install of SVN I get an error message of shared library xxx.so not found ==
+
Then continue compiling the code with
 +
$ ./configure ...
 +
$ make
 +
and
 +
# make install
  
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:
+
If you plan to update SVN regularly, you should subscribe to the mythtv-commits mailing list to stay abreast to all of the latest changes in MythTVSubscribe to the [http://www.mythtv.org/mailman/listinfo/mythtv-commits/ list] or browse a [http://www.gossamer-threads.com/lists/mythtv/commits/ web interface].
/sbin/ldconfig
 
before starting the mythbackend, this cleared the problem.
 
  
=== make clean / make distclean ===
+
=== make clean vs. 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''.
 
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:
 
Here's a couple of scripts I use to make life easier:
--- doconfig.sh ---
+
--- doconfig.sh ---
 
  cd mythtv
 
  cd mythtv
 
  make distclean
 
  make distclean
 
  ./configure --prefix=/usr/local --enable-xvmc --arch=i686 --enable-proc-opt --enable-dvb
 
  ./configure --prefix=/usr/local --enable-xvmc --arch=i686 --enable-proc-opt --enable-dvb
qmake PREFIX=/usr/local mythtv.pro
 
 
  cd ../mythplugins
 
  cd ../mythplugins
 
  make distclean
 
  make distclean
 
  ./configure
 
  ./configure
qmake mythplugins.pro
 
  
--- domake.sh ---
+
--- domake.sh ---
 
  cd mythtv
 
  cd mythtv
 
  make -j 2
 
  make -j 2
Line 232: Line 299:
 
  make -j 2
 
  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.  
+
'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 ===
  
==== 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). See also the Dependencies page which downloads and install the required libraries for myth and most of the plugins.  I use the following scripts to automate the entire process. I have a PVR500 tuner, an HD3000 tuner and an [[Silicondust_HDHomeRun|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).
 
 
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 [[Silicondust_HDHomeRun|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.  
 
The entire process is done calling two scripts 'call-svn.sh' and 'all-build.sh' and using three 'config.sh' files for the configurations.  
Line 243: Line 309:
 
Get a complete svn code set:
 
Get a complete svn code set:
  
*******************************************
+
--- call-svn.sh ---
----- call-svn.sh -----
 
 
  Clears old svn code base and downloads complete new set.
 
  Clears old svn code base and downloads complete new set.
 
  cd /backup/usb
 
  cd /backup/usb
Line 253: Line 318:
 
  svn co http://svn.mythtv.org/svn/trunk/myththemes
 
  svn co http://svn.mythtv.org/svn/trunk/myththemes
 
  svn co http://svn.mythtv.org/svn/trunk/mythplugins
 
  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.
 
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 box|mythbackend should '''not''' be running if the script will do 'make install'. Remember to 'service mythbackend stop'.}}
  
NOTE: mythbackend should NOT be running if the script will do 'make install'. Remember to 'service mythbackend stop'.
+
To build everything in one script, run as root:
 
 
To build everything in one script.
 
  
*******************************************
+
--- all-build.sh ---
#  ----- all-build.sh   # RUN AS ROOT 
 
 
  cd /backup/usb
 
  cd /backup/usb
 
  echo "Commence build" > /backup/usb/log.out
 
  echo "Commence build" > /backup/usb/log.out
 
  date >> /backup/usb/log.out
 
  date >> /backup/usb/log.out
 
  #  Clean out old config scripts and replace with good ones, equals 'make distclean'
 
  #  Clean out old config scripts and replace with good ones, equals 'make distclean'
rm -f /backup/usb/myththemes/configt.sh
+
    rm -f /backup/usb/myththemes/configt.sh
rm -f /backup/usb/mythplugins/configp.sh
+
    rm -f /backup/usb/mythplugins/configp.sh
rm -f /backup/usb/mythtv/config.sh
+
    rm -f /backup/usb/mythtv/config.sh
  cp /usr/local/sbin/configt.sh /backup/usb/myththemes
+
  # Copy scripts
cp /usr/local/sbin/configp.sh /backup/usb/mythplugins
+
    cp /usr/local/sbin/configt.sh /backup/usb/myththemes
cp /usr/local/sbin/config.sh /backup/usb/mythtv
+
    cp /usr/local/sbin/configp.sh /backup/usb/mythplugins
echo "End cleanup and copy of configuration" >> /backup/usb/log.out
+
    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
 
  date >> /backup/usb/log.out
 
  # Commence actual build process
 
  # Commence actual build process
echo "Commence Mythtv build" >> /backup/usb/log.out
+
    echo "Commence Mythtv build" >> /backup/usb/log.out
cd /backup/usb/mythtv
+
    cd /backup/usb/mythtv
make clean  # not actually needed for a new download
+
    make clean  # not actually needed for a new download
  ./config.sh  # run configure
+
  # Work starts here: this can take some time to run
qmake mythtv.pro
+
    ./config.sh  # run configure
make && make install
+
    make && make install
echo "End mythtv make" >> /backup/usb/log.out
+
    echo "End mythtv make" >> /backup/usb/log.out
date >> /backup/usb/log.out
+
    date >> /backup/usb/log.out
echo "Commence myththeme build"
+
  # Build themes
cd /backup/usb/myththemes
+
    echo "Commence myththeme build"
make clean
+
    cd /backup/usb/myththemes
./configt.sh  # run configure
+
    make clean
qmake myththemes.pro
+
    ./configt.sh  # run configure
make && make install
+
    make && make install
echo "End myththemes" >> /backup/usb/log.out
+
    echo "End myththemes" >> /backup/usb/log.out
date >> /backup/usb/log.out
+
    date >> /backup/usb/log.out
  echo "Commence mythplugin build" >> /backup/usb/log.out
+
  # Build plugins: this can take some time to run
cd /backup/usb/mythplugins
+
    echo "Commence mythplugin build" >> /backup/usb/log.out
make clean
+
    cd /backup/usb/mythplugins
./configp.sh  #run configure
+
    make clean
qmake mythplugins.pro
+
    ./configp.sh  #run configure
make && make install
+
    make && make install
echo "End mythplugins" >> /backup/usb/log.out
+
    echo "End mythplugins" >> /backup/usb/log.out
date >> /backup/usb/log.out
+
    date >> /backup/usb/log.out
cd /backup/usb
+
  # And you are done
cat log.out
+
  cd /backup/usb
# *******************************************
+
  cat log.out
 +
 
 +
 
 +
 
 +
These are the configure script files;
  
  
These are my configure files;
+
--- config.sh ---
**************************************
 
# ---- config.sh
 
 
  # configure for mythtv
 
  # configure for mythtv
 
  # For Via Nehemiah cpu and unichrome-pro (xvmc capable) video chipset  
 
  # For Via Nehemiah cpu and unichrome-pro (xvmc capable) video chipset  
Line 332: Line 396:
 
  --disable-dbox2      \
 
  --disable-dbox2      \
 
  --disable-iptv        \
 
  --disable-iptv        \
# **************************************
 
  
  **************************************
+
<pre>
  #  ---- configp.sh
+
--- config-sh ---
 +
# for Nvidia (added December 4, 2008)
 +
  # config shell script for mythtv configure
 +
  # For NVidia chipset and driver w/wo vdpau
 +
 
 +
./configure --prefix=/usr/local  \
 +
--compile-type=release \
 +
--enable-proc-opt      \
 +
--qmake=/usr/lib/qt4/bin/qmake-qt4 \
 +
--disable-directfb    \
 +
--enable-lirc        \
 +
--enable-v4l          \
 +
--enable-ivtv        \
 +
--disable-joystick-menu \
 +
--disable-firewire    \
 +
--disable-dbox2      \
 +
--enable-hdhomerun    \
 +
--enable-dvb          \
 +
--dvb-path=/usr/include \
 +
--enable-x11          \
 +
--enable-xrandr      \
 +
--enable-xv          \
 +
--enable-xvmc        \
 +
--xvmc-lib=/usr/lib/libXvMCNVIDIA \
 +
--disable-xvmcw      \
 +
--enable-xvmc-vld    \
 +
--disable-xvmc-pro    \
 +
--enable-xvmc-opengl  \
 +
--enable-opengl-vsync \
 +
  --disable-vdpau      \
 +
--with-bindings=perl,python
 +
 
 +
# xvmc-lib is needed or configure looks for xvmcw
 +
# /etc/X11/XvMCConfig must not point to libXvMCW
 +
# xvmc-lib line must preceed the 'opengl' references
 +
# obviously --enable-vdpau only with the correct driver and hardware
 +
</pre>
 +
 
 +
<pre>
 +
--- configp.sh ---
 
  # configure for mythplugins
 
  # configure for mythplugins
  ./configure             \
+
  ./configure             \
 
  --prefix=/usr/local    \
 
  --prefix=/usr/local    \
 
  --enable-opengl        \
 
  --enable-opengl        \
Line 363: Line 465:
 
  --enable-mythweather    \
 
  --enable-mythweather    \
 
  --disable-mythzoneminder
 
  --disable-mythzoneminder
# **************************************
 
  
# **************************************
+
</pre>
#  --- configt.sh
 
# configure for mythplugins
 
./configure  --prefix=/usr/local
 
**************************************
 
  
=== Updating your source code ===
+
=== Troubleshooting ===  
 +
* After an update 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, there was an issue with libfreemheg.so.19 not found when trying to start mythbackend.  Running:
 +
# /sbin/ldconfig
 +
:will ensure the new library is linked up.
  
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.
 
  
[[Category:HOWTO]]
+
[[Category:Fedora]]
 +
[[Category:Distribution_Specific_Install_Guides]]

Latest revision as of 17:01, 18 January 2011

Time.png Outdated: The information on this page may no longer be relevant to the current release of MythTV, 34.0. Please consider helping to update it. This page was last modified on 2011-01-18.


Important.png Note: See mythtv-rpmbuild.spec, instead.

Credits


Overview

This guide is to help users of Fedora compile MythTV using the subversion (SVN) source code, which allows them to take advantage of the latest (bleeding edge) patches to MythTV. It was originally developed with MythTV 0.19.1 and Fedora Core 4 in mind. It is more or less valid for all versions since then up to and including Fedora 9. Continued additions are welcome by users of future versions of Fedora. This document assumes you already have a working Fedora installation.

Commands shown in this guide use the standard notation for indicating which can be run as the normal user and which must be run as root: commands preceded by "#" are to be run as root, whereas those preceded by "$" are to be run as the normal user.

Install Prerequisites

Remove Old Versions

If you are upgrading to MythTV SVN from an rpm installation from ATrpms, you must first remove all of the MythTV rpms that were installed.

# yum remove \*myth\*

Repositories

In order to be able to easily install all of the dependencies needed for MythTV, you will need to have the livna repository configured and enabled. If you want to have other repositories enabled as well, such as ATrpms or freshrpms, you may, but beware that enabling more than one third-party repositories can cause problems that are very difficult to clear up. The best way to safely configure many common third-party repositories is to use the rpm provided by fedorafaq and install the yum-priorities plugin:

# yum install yum-priorities
# echo 'check_obsoletes = 1' >> /etc/yum/pluginconf.d/priorities.conf
# rpm -Uvh http://www.fedorafaq.org/f9/yum http://rpm.livna.org/livna-release-9.rpm

This will install the configuration files to many popular repositories. The yum-priorities plugin should prevent conflicting packages from being installed at the same time. If you don't trust it, the safest thing to do is to disable all of the repositories except fedora, extras, adobe-linux, and livna by going into each of the other configuration files in /etc/yum.repos.d/ and setting "enabled=0".

Important.png Note: As of 04:48, 26 May 2008 (UTC), fedorafaq still has not released a yum configuration rpm for F9. You can still continue using this guide using only the livna repository without any problems.


Information.png Tip: BEST PRACTICE is to only enable one repo at a time, and NEVER run 'yum update' or 'yum upgrade' without naming a specific package to be updated. (The exception of course, is the one-time, right-after-install 'yum update' when you have NO other repos enabled.)

Video Drivers

Many systems with NVIDIA or ATI graphics cards will require proprietary video drivers to provide smooth playback. Installing the drivers is simple if you have the livna repository enabled. For NVIDIA cards:

# yum install kmod-nvidia

Or if you have an ATI card:

# yum install kmod-fglrx

Important.png Note: The current release of Fedora 9 ships with X Server 1.4.99 which requires NVIDIA driver 173.14 or later.


Install packages

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-server mysql-devel lirc lirc-devel
# yum install subversion mesa-libGLU-devel libXv-devel libXxf86vm-devel libdca-devel make
# yum install libXmu-devel qt-MySQL libXvMC-devel kdelibs-devel arts-devel perl-ExtUtils-MakeMaker

(For Fedora 8 I found I wanted the package qt4-mysql rather than qt-MySQL (or in addition to it?))


Run the following commands to get most of the dependencies for MythTV's plugins:

# yum install fftw2 fftw2-devel libid3tag libid3tag-devel libmad-devel flac-devel libdvdcss-devel
# yum install libtiff-devel libcdaudio-devel SDL-devel cdparanoia-devel libexif-devel fftw3 fftw3-devel
# yum install libvorbis-devel faac faac-devel faad2 faad2-devel taglib taglib-devel libvisual-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

After installing the driver rpms and all of the dependent packages, you will have to reboot so that the kernel modules and paths load correctly. In fact, it appears you may need to reboot twice to get the kernel modules fully installed.

Troubleshooting

  • 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 (or whatever your proxy port happens to be)
  • The list of packages to install may not be complete as the requirements will change as new plugins are added. To check on the dependencies, after you have downloaded the source 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 MythPlugins dependency installation:
Error: Missing Dependency: libid3tag = 0.15.0b is needed by package libid3tag-devel
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.

Install MythTV Source Code

If you haven't done so already, it may be a good idea to change the ownership on /usr/local so your main user can download source here:

# chown `whoami`.`whoami` /usr/local

Here we use subversion to obtain the latest source code:

$ cd /usr/local
$ svn co http://svn.mythtv.org/svn/trunk mythtv

Important.png Note: If you prefer to install the 0.21 fixes branch instead of trunk, point svn to http://svn.mythtv.org/svn/branches/release-0-21-fixes instead.

or, if you prefer to setup the primary components of MythTV separately:

$ cd /usr/local
$ 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

The former method gives you the advantage of being able to cd to the mythtv directory and running svn update, which will update all of the subdirectories at once. It also will pull in more components including extra themes. The rest of this guide will assume that this method has been used.


Compile MythTV

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.

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

Note: x86_64 users will have to add --libdir-name=lib64

The recommended way to enable processor optimizations is with the flag --enable-proc-opt.

Though not recommended the following flags will enable custom processor optimizations for various versions of GCC:

  • For GCC 4.1:
    • --arch=prescott for Intel Core Solo/Duo
    • --arch=nocona for Core 2 Solo/Duo
  • For GCC 4.2:
    • --arch=prescott --mtune=generic for Core Solo/Duo
    • --arch=nocona --mtune=generic for Core 2 Solo/Duo
  • GCC trunk adds support for the SSSE3 instruction set:
    • --arch=core2

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

There are a lot of additional command line options for the configure script. A useful command line might be:

$ ./configure --prefix=/usr/local --enable-xvmc --arch=native --enable-dvb 

Use

$./configure --help 

to view all options on this command. A more complete command line script is given below in Automating the Entire Process.

To continue with the compilation, run:

$ make

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

# make install

Before continuing be sure that the directory contaning the installed libraries in known by ld.so:

# echo "/usr/local/lib" >> /etc/ld.so.conf
# /sbin/ldconfig

Important.png Note: x86_64 users should echo "/usr/local/lib64" instead.

Compile MythPlugins

$ 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
$ make

Note: x84_64 users will have to pass --libdir-name=lib64 as well.

Then install the plugins as root:

# make install

Install MythThemes

The stock MythThemes can be installed by:

$ cd ../myththemes
$ ./configure --prefix=/usr/local
$ make

Then install the themes as root:

# make install

Similarly, the extended themes are installed by:

$ cd ../themes
$ ./configure --prefix=/usr/local
$ make

Then, as root:

# make install

Troubleshooting

  • 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. Alternatively, check for a symlink to /usr/lib/qt-3.x
# ln -s /usr/lib/qt3 /usr/lib/qt-3.x
The location on newer installs may be /usr/lib/qt-3.3
# ln -s /usr/lib/qt-3.3 /usr/lib/qt-3.x
  • If you receive an error message of something like -lrfftw not found during the MythPlugins compile, you may need to do the following:
# cd /usr/lib
# ln -s librfftw.so.2.0.7 librfftw.so
# ln -s libfftw.so.2.0.7 libfftw.so

Post-Install Configuration

Initialize Database

To start the MySQL server for this session and at every boot, issue the following commands:

# /sbin/service mysqld start
# /sbin/chkconfig --level 345 mysqld on

If this is the first time MySQL has been started, you should run the MySQL secure installation script to disable anonymous usage and to set the root password.

$ mysql_secure_installation

Finally, run MythTV's MySQL setup script to initialize the mythconverg database:

$ mysql -u root -p < /usr/local/mythtv/mythtv/database/mc.sql

Setup MythWeb

Install packages needed by MythWeb

# yum install httpd php php-mysql

The MythWeb files must be copied to Apache's http directory:

# cd /usr/local/mythtv/mythplugins/mythweb
# cp -r * /var/www/html 

Next move the configuration file to the Apache configuration directory:

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

You'll then need to make sure your web server can write to the 'data' directory in MythWeb

# chgrp -R apache /var/www/html/data
# chmod g+rw /var/www/html/data

Important.png Note: If you have SELinux enabled, you'll need to run:

# /usr/sbin/setsebool -P httpd_can_network_connect=1
# chcon -R -t httpd_sys_content_t '/var/www/html/data'

Finally start the httpd daemon for this session configure Apache to start at every boot:

# /sbin/service httpd restart
# /sbin/chkconfig --level 345 httpd on

If the backend is running you should be now able to access MythWeb.

Auto-start Mythbackend

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

# cd /usr/local/mythtv/mythtv/Linux/contrib/init_scripts
# cp fedora.init.mythbackend /etc/rc.d/init.d/mythbackend
# cp fedora.sysconfig.mythbackend /etc/sysconfig/mythbackend
# /sbin/chkconfig --level 345 mythbackend on

Important.png Note: Make sure your MythTV log directory exists (/var/log/mythtv).

MythTV Configuration

You are now ready to configure your MythTV system

$ mythtv-setup

Then, as root:

# service mythbackend start

Maintaining an SVN Installation

Updating the Source Code

One of the advantages of running SVN is that you can quickly and easily download the latest revision of MythTV. There are usually 5 or more updates a day to the MythTV source code. To update your your copy of MythTV go to the directory that holds the SVN code and run

$ svn update

Then continue compiling the code with

$ ./configure ...
$ make

and

# make install

If you plan to update SVN regularly, you should subscribe to the mythtv-commits mailing list to stay abreast to all of the latest changes in MythTV. Subscribe to the list or browse a web interface.

make clean vs. 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
cd ../mythplugins
make distclean
./configure

--- 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). See also the Dependencies page which downloads and install the required libraries for myth and most of the plugins. 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.

Important.png Note: mythbackend should not be running if the script will do 'make install'. Remember to 'service mythbackend stop'.

To build everything in one script, run as root:

--- all-build.sh ---

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
# Copy scripts
   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
# Work starts here: this can take some time to run
   ./config.sh  # run configure
   make && make install
   echo "End mythtv make" >> /backup/usb/log.out
   date >> /backup/usb/log.out
 # Build themes
   echo "Commence myththeme build"
   cd /backup/usb/myththemes
   make clean
   ./configt.sh  # run configure
   make && make install
   echo "End myththemes" >> /backup/usb/log.out
   date >> /backup/usb/log.out
# Build plugins: this can take some time to run 
   echo "Commence mythplugin build" >> /backup/usb/log.out
   cd /backup/usb/mythplugins
   make clean
   ./configp.sh  #run configure
   make && make install
   echo "End mythplugins" >> /backup/usb/log.out
   date >> /backup/usb/log.out
 # And you are done 
  cd /backup/usb
  cat log.out


These are the configure script 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        \
 --- config-sh --- 
 # for Nvidia (added December 4, 2008)
 # config shell script for mythtv configure
 # For NVidia chipset and driver w/wo vdpau

 ./configure --prefix=/usr/local   \
 --compile-type=release \
 --enable-proc-opt      \
 --qmake=/usr/lib/qt4/bin/qmake-qt4 \
 --disable-directfb    \
 --enable-lirc         \
 --enable-v4l          \
 --enable-ivtv         \
 --disable-joystick-menu \
 --disable-firewire    \
 --disable-dbox2       \
 --enable-hdhomerun    \
 --enable-dvb          \
 --dvb-path=/usr/include \
 --enable-x11          \
 --enable-xrandr       \
 --enable-xv           \
 --enable-xvmc         \
 --xvmc-lib=/usr/lib/libXvMCNVIDIA \
 --disable-xvmcw       \
 --enable-xvmc-vld     \
 --disable-xvmc-pro    \
 --enable-xvmc-opengl  \
 --enable-opengl-vsync \
 --disable-vdpau       \
 --with-bindings=perl,python

# xvmc-lib is needed or configure looks for xvmcw
# /etc/X11/XvMCConfig must not point to libXvMCW
# xvmc-lib line must preceed the 'opengl' references
# obviously --enable-vdpau only with the correct driver and hardware
--- 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

Troubleshooting

  • After an update 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, there was an issue with libfreemheg.so.19 not found when trying to start mythbackend. Running:
# /sbin/ldconfig
will ensure the new library is linked up.