Difference between revisions of "Mythtv-rpmbuild.spec"

From MythTV Official Wiki
Jump to: navigation, search
Line 1: Line 1:
 
This spec is for building MythTV RPM packages from a subversion checkout.
 
This spec is for building MythTV RPM packages from a subversion checkout.
 +
It should be used along with the build_myth.sh shell script included
 +
at the bottom of this page.
 +
 +
This will presumably work with any version of fedora from version 5
 +
onward, and expects that you are pulling your packages from livna/rpmfusion.
 +
If you use atrpms, you will probably need to rename a couple of the dependencies
 +
to compensate for their different naming scheme.
  
It works with both modular (FC5 and later) and non-modular versions of X.
 
 
Please read the documentation at the top of the file before using it.
 
Please read the documentation at the top of the file before using it.
 
Packages built from this spec for recent versions of fedora and centos are available from http://rpms.netmindz.net (Currently building from the 0.21.0 fixes branch for Fedora 8 & 9 and Centos 5
 
  
 
<pre>
 
<pre>
Line 11: Line 15:
 
#
 
#
 
# by:  Chris Petersen <rpm@forevermore.net>
 
# by:  Chris Petersen <rpm@forevermore.net>
 +
#      Jarod Wilson <jarod@wilsonet.com>
 
#
 
#
 
#  Modified/Extended from the great (non-svn based) work of:
 
#  Modified/Extended from the great (non-svn based) work of:
 +
#    Axel Thimm <Axel.Thimm@ATrpms.net>
 
#    David Bussenschutt <buzz@oska.com>
 
#    David Bussenschutt <buzz@oska.com>
#    Axel Thimm <Axel.Thimm@ATrpms.net>
 
 
#    and others; see changelog at bottom for details.
 
#    and others; see changelog at bottom for details.
 
#
 
#
Line 23: Line 28:
 
# Note:
 
# Note:
 
#
 
#
#    This spec relies upon several files included in the ATRPMS mythtv
+
#    This spec relies upon several files included in the RPMFusion mythtv
 
#    src.rpm file.  Please install it into your build tree before trying to
 
#    src.rpm file.  Please install it into your build tree before trying to
#    build anything with this spec.  It also has two different sets of build
+
#    build anything with this spec.
#    requirements for nvidia xvmc -- you'll have to pick and choose depending
 
#    on whether you use atrpms or livna to install your nvidia drivers.
 
 
#
 
#
 
# Explanation of options:
 
# Explanation of options:
#
 
# --with(out) modular_x    Override the default detection code for modular X.org
 
 
#
 
#
 
# --with proc_opt          Enable MythTV's optimized processor detection code
 
# --with proc_opt          Enable MythTV's optimized processor detection code
 
#                              and override RPM's defaults.
 
#                              and override RPM's defaults.
 +
# --with debug              Enable debug mode
 
#
 
#
 
# The following options are disabled by default.  Use these options to enable:
 
# The following options are disabled by default.  Use these options to enable:
 
#
 
#
# --with arts              Enable arts support
 
# --with jack              Enable jack support
 
# --with xvmcvld            Enable XVMC VLD (epia) support.  If you enable this,
 
#                              don't forget --without xvmcnvidia.
 
 
# --with directfb          Enable directfb support
 
# --with directfb          Enable directfb support
# --with dts                Enable dts support
 
 
#
 
#
 
# The following options are enabled by default.  Use these options to disable:
 
# The following options are enabled by default.  Use these options to disable:
 
#
 
#
# --without lirc            Disable lirc support
 
# --without firewire        Disable firewire support
 
# --without dvb            Disable dvb support
 
# --without alsa            Disable alsa support
 
# --without oss            Disable oss support
 
# --without xrandr          Disable xradr support
 
 
# --without xvmcnvidia      Disable NVidia XvMC support
 
# --without xvmcnvidia      Disable NVidia XvMC support
# --without opengl_vsync    Disable OpenGL video sync enhancements
 
 
# --without perl            Disable building of the perl bindings
 
# --without perl            Disable building of the perl bindings
 +
# --without python          Disable building of the python bindings
 +
#
 +
# # All plugins get built by default, but you can disable them as you wish:
 +
#
 +
# --without mytharchive
 +
# --without mythbrowser
 +
# --without mythcontrols
 +
# --without mythflix
 +
# --without mythgallery
 +
# --without mythgame
 +
# --without mythmovies
 +
# --without mythmusic
 +
# --without mythnews
 +
# --without mythphone
 +
# --without mythvideo
 +
# --without mythweather
 +
# --without mythzoneminder
 +
# --without mythweb
 +
#
 +
# The following options are disabled by default.  Use these options to enable:
 +
#
 +
# --with festival          Enable festival/festvox support in MythPhone
 
#
 
#
 
# Edit the following path to point to where you keep your SVN checkout.  Among
 
# others, it will contain both the mythtv/ and mythplugins/ subdirectories.
 
%define _svn_root '/usr/src/mythtv-svn/'
 
  
################################################################################
 
# The only thing below here that you should feel the need to edit is the
 
# Version tag, which should be set to the *next* MythTV release.
 
 
################################################################################
 
################################################################################
 
# The name of the DVB driver package (used in a couple of places,
 
# so it's not hard-coded in the spec itself)
 
%define linuxtv_dvb_package linuxtv-dvb-1.1.1cvs20050529
 
 
# Compile type:  debug or release (Isaac recommends not using debug)
 
%define compile_type release
 
  
 
# A list of which applications we want to put into the desktop menu system
 
# A list of which applications we want to put into the desktop menu system
%define desktop_applications mythfrontend mythbackend mythtv-setup
+
%define desktop_applications mythfrontend mythtv-setup
  
 
# The vendor name we should attribute the aforementioned entries to
 
# The vendor name we should attribute the aforementioned entries to
%define desktop_vendor  mythtv
+
%define desktop_vendor  xris
  
# Are we running modular Xorg?  Default is to auto-detect FC5 or later, but you
+
# SVN Revision number and branch ID
# can also specify --with modular_x or --without modular_x to override.
+
%define _svnrev r18923
%define _modular_x %(if [ "%{?_with_modular_x}" ]; then echo 1; elif [ "%{?_without_modular_x}" ]; then echo 0; elif [ `rpm -q --queryformat='%{VERSION}' fedora-release` -ge 5 ]; then echo 1; else echo 0; fi)
+
%define branch trunk
 
 
# This script verifies that there is a mythtv SVN checkout at %{_svn_root} and
 
# if there isn't one, performs an anonymous checkout.  If the checkout already
 
# exists, it grabs the latest update.  The return value is the current SVN
 
# revision or a blank string (which will be checked below for errors).
 
%define _svn_rev %( if [ ! -d '%{_svn_root}/.svn' ] ; then REL=`svn co http://svn.mythtv.org/svn/trunk/ '%{_svn_root}'` ; else REL=`svn update '%{_svn_root}'`; fi; if [ $? != 0 ]; then echo '' ; else echo "$REL" | grep -i revision | sed -e 's/[^0-9]\\+//g'; fi )
 
  
 
#
 
#
Line 94: Line 86:
 
#
 
#
 
Name:          mythtv
 
Name:          mythtv
Version:        0.21
 
Release:        0.%{_svn_rev}.svn
 
 
Summary:        A digital video recorder (DVR) application.
 
Summary:        A digital video recorder (DVR) application.
 
 
URL:            http://www.mythtv.org/
 
URL:            http://www.mythtv.org/
License:        GPL
 
 
Group:          Applications/Multimedia
 
Group:          Applications/Multimedia
 +
 +
# Version/Release info
 +
Version: 0.22
 +
%if "%{branch}" == "trunk"
 +
Release: 0.1.svn.%{_svnrev}%{?dist}
 +
%else
 +
Release: 1%{?dist}
 +
%endif
 +
 +
# The primary license is GPLv2+, but bits are borrowed from a number of
 +
# projects... For a breakdown of the licensing, see PACKAGE-LICENSING.
 +
License: GPLv2+ and LGPLv2+ and LGPLv2 and (GPLv2 or QPL) and (GPLv2+ or LGPLv2+)
 +
 +
################################################################################
  
 
# Set "--with proc_opt" to let mythtv autodetect your CPU and run its
 
# Set "--with proc_opt" to let mythtv autodetect your CPU and run its
Line 106: Line 108:
 
# systems (particularly x86_64), so it is classified by the MythTV developers
 
# systems (particularly x86_64), so it is classified by the MythTV developers
 
# as "use at your own risk."
 
# as "use at your own risk."
%define with_proc_opt      %{?_with_proc_opt:         1} %{!?_with_proc_opt:        0}
+
%define with_proc_opt      %{?_with_proc_opt:       1} %{!?_with_proc_opt:      0}
 +
 
 +
# Set "--with debug" to enable MythTV debug compile mode
 +
%define with_debug        %{?_with_debug:          1} %{?!_with_debug:        0}
  
 
# The following options are enabled by default.  Use --without to disable them
 
# The following options are enabled by default.  Use --without to disable them
%define with_lirc          %{?_without_lirc:          0} %{?!_without_lirc:          1}
+
%define with_perl          %{?_without_perl:       0} %{!?_without_perl:       1}
%define with_firewire      %{?_without_firewire:      0} %{?!_without_firewire:      1}
+
%define with_python        %{?_without_python:     0} %{!?_without_python:     1}
%define with_dvb          %{?_without_dvb:          0} %{?!_without_dvb:          1}
 
%define with_alsa          %{?_without_alsa:          0} %{?!_without_alsa:          1}
 
%define with_oss          %{?_without_oss:          0} %{?!_without_oss:          1}
 
%define with_xrandr        %{?_without_xrandr:        0} %{?!_without_xrandr:        1}
 
%define with_xvmcnvidia    %{?_without_xvmcnvidia:    0} %{?!_without_xvmcnvidia:    1}
 
%define with_opengl_vsync  %{?_without_opengl_vsync:  0} %{!?_without_opengl_vsync:  1}
 
%define with_perl          %{?_without_perl:         0} %{!?_without_perl:         1}
 
%define with_aac          %{?_without_aac:           0} %{!?_without_aac:           1}
 
  
 
# The following options are disabled by default.  Use --with to enable them
 
# The following options are disabled by default.  Use --with to enable them
%define with_arts          %{?_with_arts:          1} %{?!_with_arts:          0}
+
%define with_directfb      %{?_with_directfb:       1} %{!?_with_directfb:      0}
%define with_jack          %{?_with_jack:          1} %{!?_with_jack:          0}
+
%define with_xvmcnvidia    %{?_with_xvmcnvidia:     1} %{?!_with_xvmcnvidia:   0}
%define with_xvmcvld      %{?_with_xvmcvld:      1} %{!?_with_xvmcvld:      0}
 
%define with_directfb      %{?_with_directfb:     1} %{!?_with_directfb:      0}
 
%define with_dts          %{?_with_dts:           1} %{!?_with_dts:          0}
 
%define with_x264          %{?_with_x264:          1} %{!?_with_x264:         0}
 
  
################################################################################
+
# All plugins get built by default, but you can disable them as you wish
 +
%define with_mytharchive    %{?_without_mytharchive:    0} %{!?_without_mytharchive:    1}
 +
%define with_mythbrowser    %{?_without_mythbrowser:    0} %{!?_without_mythbrowser:    1}
 +
%define with_mythcontrols  %{?_without_mythcontrols:  0} %{!?_without_mythcontrols:    1}
 +
%define with_mythflix      %{?_without_mythflix:      0} %{!?_without_mythflix:        1}
 +
%define with_mythgallery    %{?_without_mythgallery:    0} %{!?_without_mythgallery:    1}
 +
%define with_mythgame      %{?_without_mythgame:      0} %{!?_without_mythgame:        1}
 +
%define with_mythmovies    %{?_without_mythmovies:    0} %{!?_without_mythmovies:      1}
 +
%define with_mythmusic      %{?_without_mythmusic:      0} %{!?_without_mythmusic:      1}
 +
%define with_mythnews      %{?_without_mythnews:      0} %{!?_without_mythnews:        1}
 +
%define with_mythphone      %{?_without_mythphone:      0} %{!?_without_mythphone:      1}
 +
%define with_mythvideo      %{?_without_mythvideo:      0} %{!?_without_mythvideo:      1}
 +
%define with_mythweather    %{?_without_mythweather:    0} %{!?_without_mythweather:    1}
 +
%define with_mythweb        %{?_without_mythweb:        0} %{!?_without_mythweb:        1}
 +
%define with_mythzoneminder %{?_without_mythzoneminder: 0} %{!?_without_mythzoneminder:  1}
 +
 
 +
# The following plugin options are disabled by default.  Use --with to enable them
  
# Define some directory names that aren't present in rpm's own macro library
+
# MythPhone
%define _varlibdir    %{_localstatedir}/lib
+
%define with_festival      %{?_with_festival:      1} %{!?_with_festival:      0}
%define _varcachedir  %{_localstatedir}/cache
 
%define _logdir        %{_localstatedir}/log
 
%define _rundir        %{_localstatedir}/run
 
%define _subsysdir    %{_localstatedir}/lock/subsys
 
%define _sysconfigdir  %{_sysconfdir}/sysconfig
 
%define _logrotatedir  %{_sysconfdir}/logrotate.d
 
  
 
################################################################################
 
################################################################################
  
Source0:       http://www.mythtv.org/mc/%{name}-%{version}.tar.bz2
+
Source0:   http://www.mythtv.org/mc/mythtv-%{version}.tar.bz2
Source1:       mythbackend.sysconfig.in
+
Source1:  http://www.mythtv.org/mc/mythplugins-%{version}.tar.bz2
Source2:       mythbackend.init.in
+
Source10:  PACKAGE-LICENSING
Source3:       mythbackend.logrotate.in
+
Source101: mythbackend.sysconfig.in
Source4:       mythtv.png
+
Source102: mythbackend.init.in
Source5:       mythtv.desktop
+
Source103: mythbackend.logrotate.in
Source6:       mythfrontend.png
+
Source106: mythfrontend.png
Source7:       mythfrontend.desktop
+
Source107: mythfrontend.desktop
Source12:      http://linuxtv.org/download/dvb/%{linuxtv_dvb_package}.tar.bz2
+
Source108: mythtv-setup.png
Source100:     mythtv-doc.configure.ac
+
Source109: mythtv-setup.desktop
Source101:      mythtv-doc.Makefile.am
+
Source110: mysql.txt
 +
Source401: mythweb.conf
  
 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  
 
################################################################################
 
################################################################################
 +
# Python setup
 +
 +
%if %{with_python}
 +
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 +
%{!?python_version: %define python_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0]')}
 +
%endif
 +
 +
################################################################################
 +
 +
# Global MythTV and Shared Build Requirements
  
 
BuildRequires:  desktop-file-utils
 
BuildRequires:  desktop-file-utils
 
BuildRequires:  freetype-devel >= 2
 
BuildRequires:  freetype-devel >= 2
 
BuildRequires:  gcc-c++
 
BuildRequires:  gcc-c++
BuildRequires:  lame-devel
+
BuildRequires:  mysql-devel >= 5
BuildRequires:  libdvdnav-devel
+
BuildRequires:  qt4-devel
BuildRequires:  mysql-devel
 
BuildRequires:  qt-devel >= 3
 
  
# Yeah. we do need subversion, don't we...
+
BuildRequires:  lm_sensors-devel
BuildRequires:  subversion
+
BuildRequires:  lirc-devel
 +
BuildRequires:  nasm
  
# The modular version of Xorg requires a different set of build packages
+
# X, and Xv video support
%if %{_modular_x}
 
 
BuildRequires:  libXmu-devel
 
BuildRequires:  libXmu-devel
 
BuildRequires:  libXv-devel
 
BuildRequires:  libXv-devel
 +
BuildRequires:  libXvMC-devel
 
BuildRequires:  libXxf86vm-devel
 
BuildRequires:  libXxf86vm-devel
 
BuildRequires:  mesa-libGLU-devel
 
BuildRequires:  mesa-libGLU-devel
%else
+
BuildRequires:  xorg-x11-proto-devel
BuildRequires:  XFree86-devel
+
%ifarch %{ix86} x86_64
 +
BuildRequires:  xorg-x11-drv-i810-devel
 +
BuildRequires:  xorg-x11-drv-openchrome-devel
 
%endif
 
%endif
  
%if %{with_alsa}
+
# OpenGL video output and vsync support
 +
BuildRequires:  libGL-devel, libGLU-devel
 +
 
 +
# Misc A/V format support
 +
BuildRequires:  a52dec-devel
 +
BuildRequires:  faac-devel
 +
BuildRequires:  faad2-devel
 +
BuildRequires:  fftw2-devel < 3
 +
BuildRequires:  fftw2-devel >= 2.1.3
 +
BuildRequires:  flac-devel >= 1.0.4
 +
BuildRequires:  gsm-devel
 +
BuildRequires:  lame-devel
 +
BuildRequires:  libdca-devel
 +
BuildRequires:  libdvdcss-devel >= 1.2.7
 +
BuildRequires:  libdvdnav-devel
 +
BuildRequires:  libdvdread-devel >= 0.9.4
 +
BuildRequires:  libfame-devel >= 0.9.0
 +
BuildRequires:  libmad-devel
 +
BuildRequires:  libogg-devel
 +
BuildRequires:  libtheora-devel
 +
BuildRequires:  libvorbis-devel >= 1.0
 +
BuildRequires:  mjpegtools-devel >= 1.6.1
 +
BuildRequires:  taglib-devel >= 1.4
 +
BuildRequires:  transcode >= 0.6.8
 +
BuildRequires:  x264-devel
 +
BuildRequires:  xvidcore-devel >= 0.9.1
 +
 
 +
# Audio framework support
 
BuildRequires:  alsa-lib-devel
 
BuildRequires:  alsa-lib-devel
 +
BuildRequires:  arts-devel
 +
BuildRequires:  jack-audio-connection-kit-devel
 +
 +
# Need dvb headers to build in dvb support
 +
BuildRequires: kernel-headers
 +
 +
# FireWire cable box support
 +
BuildRequires:  libavc1394-devel
 +
BuildRequires:  libiec61883-devel
 +
BuildRequires:  libraw1394-devel
 +
 +
%if %{with_directfb}
 +
BuildRequires:  directfb-devel
 
%endif
 
%endif
  
%if %{with_arts}
+
%if %{with_xvmcnvidia}
BuildRequires:  arts-devel
+
BuildRequires:  xorg-x11-drv-nvidia-devel
 
%endif
 
%endif
  
%if %{with_directfb}
+
# API Build Requirements
BuildRequires:  directfb-devel
+
 
 +
%if %{with_perl}
 +
BuildRequires:  perl
 +
BuildRequires:  perl(ExtUtils::MakeMaker)
 
%endif
 
%endif
  
%if %{with_dts}
+
%if %{with_python}
BuildRequires:  libdts-devel
+
BuildRequires:  python-devel
 
%endif
 
%endif
  
#%if %{with_dvb}
+
# Plugin Build Requirements
#BuildRequires:  linuxtv-dvb-devel
+
 
#%endif
+
%if %{with_mythbrowser}
 +
BuildRequires:  kdelibs3-devel
 +
%endif
  
%if %{with_firewire}
+
%if %{with_mythgallery}
BuildRequires:  libavc1394-devel
+
BuildRequires:  libtiff-devel
BuildRequires:  libiec61883-devel >= 0.1.0svn49
+
BuildRequires:  libexif-devel >= 0.6.9
BuildRequires:  libraw1394-devel  >= 1.2
 
 
%endif
 
%endif
  
%if %{with_lirc}
+
%if %{with_mythgame}
#BuildRequires:  lirc-lib-devel
+
BuildRequires:  zlib-devel
BuildRequires:  lirc-devel
 
 
%endif
 
%endif
  
%if %{with_opengl_vsync}
+
%if %{with_mythmusic}
#BuildRequires:  nvidia-graphics-devel
+
BuildRequires:  libcdaudio-devel >= 0.99.6
BuildRequires:  xorg-x11-drv-nvidia-devel
+
BuildRequires:  cdparanoia-devel
 +
BuildRequires:  libvisual-devel
 +
BuildRequires:  SDL-devel
 
%endif
 
%endif
  
%if %{with_xvmcvld}
+
%if %{with_mythnews}
BuildRequires:  libXvMC-devel
+
%endif
#BuildRequires:  /etc/X11/XvMCConfig
 
BuildRequires:  %{_libdir}/libXvMCW.so.1
 
BuildRequires:  %{_includedir}/X11/extensions/vldXvMC.h
 
  
 +
%if %{with_mythphone}
 +
%endif
 +
%if 0%{?fedora} >= 9
 +
BuildRequires: ncurses-devel
 +
%else
 +
BuildRequires: libtermcap-devel
 +
%endif
 +
%if %{with_festival}
 +
BuildRequires:  festival-devel
 
%endif
 
%endif
  
%if %{with_xvmcnvidia}
+
%if %{with_mythvideo}
#BuildRequires:  nvidia-graphics-devel
 
BuildRequires:  xorg-x11-drv-nvidia-devel
 
BuildRequires:  libXvMC-devel
 
BuildRequires:  %{_libdir}/libXvMCW.so.1
 
 
%endif
 
%endif
  
%if %{with_x264}
+
%if %{with_mythweather}
BuildRequires: x264-devel
+
Requires:       mythweather      >= %{version}
 +
Requires:      perl(XML::Simple)
 +
Requires:      perl(LWP::Simple)
 
%endif
 
%endif
  
%if %{with_aac}
+
%if %{with_mythzoneminder}
BuildRequires:  faac-devel
 
BuildRequires:  faad2-devel
 
 
%endif
 
%endif
 +
 +
################################################################################
 +
# Requirements for the mythtv meta package
 +
 +
Requires:  libmyth            = %{version}-%{release}
 +
Requires:  mythtv-backend    = %{version}-%{release}
 +
Requires:  mythtv-base-themes = %{version}-%{release}
 +
Requires:  mythtv-common      = %{version}-%{release}
 +
Requires:  mythtv-docs        = %{version}-%{release}
 +
Requires:  mythtv-frontend    = %{version}-%{release}
 +
Requires:  mythtv-setup      = %{version}-%{release}
 +
Requires:  perl-MythTV        = %{version}-%{release}
 +
Requires:  python-MythTV      = %{version}-%{release}
 +
 +
Requires:  mythplugins        = %{version}-%{release}
 +
Requires:  mythtv-themes      = %{version}
 +
 +
Requires:  mysql-server >= 5, mysql >= 5
 +
# XMLTV is not yet packaged for rpmfusion
 +
#Requires: xmltv
 +
Requires:  wget >= 1.9.1
 +
 +
# faad2-devel.ppc64 is not available, so:
 +
ExcludeArch: ppc64
 +
 +
# Generate the required mythtv-frontend-api version string here so we only
 +
# have to do it once.
 +
%define mythfeapiver %(echo %{version} | awk -F. '{print $1 "." $2}')
  
 
################################################################################
 
################################################################################
  
 
%description
 
%description
 +
MythTV provides a unified graphical interface for recording and viewing
 +
television programs.  Refer to the mythtv package for more information.
 +
 +
There are also several add-ons and themes available. In order to facilitate
 +
installations with smart/apt-get/yum and other related package
 +
resolvers this meta-package can be used to install all in one sweep.
 +
 
MythTV implements the following DVR features, and more, with a
 
MythTV implements the following DVR features, and more, with a
 
unified graphical interface:
 
unified graphical interface:
  
  - Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
+
  - Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
  - Video compression using RTjpeg or MPEG-4
+
  - Video compression using RTjpeg or MPEG-4, and support for DVB and
 +
  hardware encoder cards/devices.
 
  - Program listing retrieval using XMLTV
 
  - Program listing retrieval using XMLTV
 
  - Themable, semi-transparent on-screen display
 
  - Themable, semi-transparent on-screen display
Line 252: Line 350:
 
  - Resolution of conflicts between scheduled recordings
 
  - Resolution of conflicts between scheduled recordings
 
  - Basic video editing
 
  - Basic video editing
 +
 +
################################################################################
 +
 +
%package docs
 +
Summary: MythTV documentation
 +
Group:  Documentation
 +
 +
%description docs
 +
The MythTV documentation, contrib files, database initialization file
 +
and miscellaneous other bits and pieces.
  
 
################################################################################
 
################################################################################
Line 261: Line 369:
 
Requires:  freetype >= 2
 
Requires:  freetype >= 2
 
Requires:  lame
 
Requires:  lame
Requires:  qt >= 3
+
Requires:  qt4
Requires:  qt-MySQL
+
Requires:  qt4-MySQL
  
 
%description -n libmyth
 
%description -n libmyth
Line 275: Line 383:
 
Group:    Development/Libraries
 
Group:    Development/Libraries
  
Requires:  libmyth = %{version}
+
Requires:  libmyth = %{version}-%{release}
Requires:  freetype-devel >= 2, lame-devel, qt-devel >= 3,
 
Requires:  mysql-devel
 
Requires:  libdvdnav
 
  
%if %{with_alsa}
+
Requires:  freetype-devel >= 2
Requires:  alsa-lib-devel
+
Requires:  mysql-devel >= 5
%endif
+
Requires:  qt4-devel
 +
Requires:  lm_sensors-devel
 +
Requires:  lirc-devel
  
%if %{with_arts}
+
# X, and Xv video support
Requires:  arts-devel
+
Requires:  libXmu-devel
 +
Requires:  libXv-devel
 +
Requires:  libXvMC-devel
 +
Requires:  libXxf86vm-devel
 +
Requires:  mesa-libGLU-devel
 +
Requires:  xorg-x11-proto-devel
 +
%ifarch %{ix86} x86_64
 +
Requires:  xorg-x11-drv-i810-devel
 +
Requires:  xorg-x11-drv-openchrome-devel
 
%endif
 
%endif
  
%if %{with_directfb}
+
# OpenGL video output and vsync support
Requires:  directfb-devel
+
Requires:  libGL-devel, libGLU-devel
%endif
 
  
%if %{with_dts}
+
# Misc A/V format support
Requires:  libdts-devel
+
Requires:  a52dec-devel
%endif
+
Requires:  faac-devel
 +
Requires:  faad2-devel
 +
Requires:  fftw2-devel < 3
 +
Requires:  fftw2-devel >= 2.1.3
 +
Requires:  flac-devel >= 1.0.4
 +
Requires:  gsm-devel
 +
Requires:  lame-devel
 +
Requires:  libdca-devel
 +
Requires:  libdvdcss-devel >= 1.2.7
 +
Requires:  libdvdnav-devel
 +
Requires:  libdvdread-devel >= 0.9.4
 +
Requires:  libfame-devel >= 0.9.0
 +
Requires:  libmad-devel
 +
Requires:  libogg-devel
 +
Requires:  libtheora-devel
 +
Requires:  libvorbis-devel >= 1.0
 +
Requires:  mjpegtools-devel >= 1.6.1
 +
Requires:  taglib-devel >= 1.4
 +
Requires:  transcode >= 0.6.8
 +
Requires:  x264-devel
 +
Requires:  xvidcore-devel >= 0.9.1
  
#%if %{with_dvb}
+
# Audio framework support
#Requires:  linuxtv-dvb-devel
+
Requires:  alsa-lib-devel
#%endif
+
Requires:  arts-devel
 +
Requires:  jack-audio-connection-kit-devel
  
%if %{with_firewire}
+
# Need dvb headers for dvb support
Requires:  libiec61883-devel >= 0.1.0svn49
+
Requires:  kernel-headers
%endif
 
  
%if %{with_lirc}
+
# FireWire cable box support
#Requires:  lirc-lib-devel
+
Requires:  libavc1394-devel
Requires:  lirc-devel
+
Requires:  libiec61883-devel
%endif
+
Requires:  libraw1394-devel
  
%if %{with_xvmcvld}
+
%if %{with_directfb}
Requires:  libXvMC
+
Requires:  directfb-devel
#Requires:  /etc/X11/XvMCConfig
 
 
%endif
 
%endif
  
 
%if %{with_xvmcnvidia}
 
%if %{with_xvmcnvidia}
#Requires:  nvidia-graphics-devel
 
 
Requires:  xorg-x11-drv-nvidia-devel
 
Requires:  xorg-x11-drv-nvidia-devel
Requires:  libXvMC
 
#Requires:  /etc/X11/XvMCConfig
 
%endif
 
 
%if %{with_x264}
 
Requires:  x264-devel
 
%endif
 
 
%if %{with_aac}
 
Requires:  faac-devel
 
Requires:  faad2-devel
 
 
%endif
 
%endif
  
Line 336: Line 457:
 
################################################################################
 
################################################################################
  
%if %{with_perl}
+
%package base-themes
 
+
Summary: Core user interface themes for mythtv
%package -n perl-MythTV
+
Group:   Applications/Multimedia
Summary:       Perl bindings for MythTV
 
Group:         Development/Libraries
 
# Wish we could do this:
 
#BuildArch:      noarch
 
 
 
BuildRequires:  perl
 
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 
  
 
+
# Replace an old ATRMS package
%description -n perl-MythTV
 
Provides a perl-based interface to interacting with MythTV.
 
 
 
%endif
 
 
 
################################################################################
 
 
 
%package -n mythtv-themes
 
Summary:    Base themes for mythtv's frontend.
 
Group:      Applications/Multimedia
 
 
Provides:  mythtv-theme-gant
 
Provides:  mythtv-theme-gant
 
Obsoletes:  mythtv-theme-gant
 
Obsoletes:  mythtv-theme-gant
  
%description -n mythtv-themes
+
%description base-themes
 
MythTV provides a unified graphical interface for recording and viewing
 
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.
+
television programs.  Refer to the mythtv-docs package for more information.
  
This package contains only the base themes used by the frontend and
+
This package contains the base themes for the mythtv user interface.
mythtvsetup.
 
  
 
################################################################################
 
################################################################################
  
%package -n mythtv-frontend
+
%package frontend
Summary:  Client component of mythtv (a DVR).
+
Summary:  Client component of mythtv (a DVR)
 
Group:    Applications/Multimedia
 
Group:    Applications/Multimedia
 +
Requires:  freetype, lame
 +
Requires:  mythtv-common      = %{version}-%{release}
 +
Requires:  mythtv-base-themes  = %{version}
 +
Provides:  mythtv-frontend-api = %{mythfeapiver}
  
Requires:  mythtv = %{version}
+
%description frontend
Requires:  mythtv-themes = %{version}
 
Provides:  mythtv-frontend-api = %(echo %{version} | awk -F. '{print $1 "." $2}')
 
 
 
%description -n mythtv-frontend
 
 
MythTV provides a unified graphical interface for recording and viewing
 
MythTV provides a unified graphical interface for recording and viewing
 
television programs.  Refer to the mythtv package for more information.
 
television programs.  Refer to the mythtv package for more information.
Line 389: Line 492:
 
################################################################################
 
################################################################################
  
%package -n mythtv-backend
+
%package backend
Summary:    Server component of mythtv (a DVR).
+
Summary:    Server component of mythtv (a DVR)
 
Group:      Applications/Multimedia
 
Group:      Applications/Multimedia
 +
Requires:  lame
 +
Requires:  mythtv-common = %{version}-%{release}
 +
Conflicts:  xmltv-grabbers < 0.5.37
  
Conflicts:  xmltv-grabbers < 0.5.34
+
%description backend
Requires:  mythtv = %{version}
 
 
 
%description -n mythtv-backend
 
 
MythTV provides a unified graphical interface for recording and viewing
 
MythTV provides a unified graphical interface for recording and viewing
 
television programs.  Refer to the mythtv package for more information.
 
television programs.  Refer to the mythtv package for more information.
Line 407: Line 510:
 
################################################################################
 
################################################################################
  
%package -n mythtv-setup
+
%package setup
Summary:   Setup the mythtv backend.
+
Summary:   Setup the mythtv backend
Group:     Applications/Multimedia
+
Group:     Applications/Multimedia
Provides:   mythtvsetup = %{version}
+
Requires:  freetype
Obsoletesmythtvsetup <= %{version}
+
Requires: mythtv-backend = %{version}-%{release}
 +
Requiresmythtv-base-themes = %{version}
  
Requires:  mythtv-backend = %{version}
+
%description setup
Requires:  mythtv-themes  = %{version}
 
 
 
%description -n mythtv-setup
 
 
MythTV provides a unified graphical interface for recording and viewing
 
MythTV provides a unified graphical interface for recording and viewing
 
television programs.  Refer to the mythtv package for more information.
 
television programs.  Refer to the mythtv package for more information.
Line 425: Line 526:
 
################################################################################
 
################################################################################
  
%prep
+
%package common
 +
Summary: Common components needed by multiple other MythTV components
 +
Group: Applications/Multimedia
 +
 
 +
%description common
 +
MythTV provides a unified graphical interface for recording and viewing
 +
television programs.  Refer to the mythtv package for more information.
 +
 
 +
This package contains components needed by multiple other MythTV components.
 +
 
 +
################################################################################
 +
 
 +
%if %{with_perl}
 +
 
 +
%package -n perl-MythTV
 +
Summary:        Perl bindings for MythTV
 +
Group:          Development/Languages
 +
# Wish we could do this:
 +
#BuildArch:      noarch
 +
 
 +
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 +
Requires:      perl(DBD::mysql)
 +
# Disabled because there are no RPM packages for these yet,
 +
# and RPM doesn't seem to be picking up on CPAN versions
 +
#Requires:      perl(Net::UPnP)
 +
#Requires:      perl(Net::UPnP::ControlPoint)
 +
 
 +
%description -n perl-MythTV
 +
Provides a perl-based interface to interacting with MythTV.
  
# If there was a problem getting the svn revision, we need to alert the user.
 
%if !%{_svn_rev}
 
    echo -e "\n\nThere was a problem determing the current SVN revision."  \
 
            "\nAny subversion errors should be listed a few lines above"    \
 
            "\nthis error message.  Please resolve them and try again.\n\n"
 
    exit 1
 
 
%endif
 
%endif
  
# Since we'll be copying the files from the repository checkout instead of
+
################################################################################
# extracting a tarball (-T), we only need to create the target directory (-c).
+
 
%setup -q -T -c
+
%if %{with_python}
  
# Copy the checkout to the rpm build directory.
+
%package -n python-MythTV
    rsync -a --cvs-exclude              \
+
Summary:        Python bindings for MythTV
          %{_svn_root}/%{name}/*        \
+
Group:          Development/Languages
          %{_builddir}/%{name}-%{version}/
+
# Wish we could do this:
 +
#BuildArch:      noarch
 +
 
 +
Requires:      MySQL-python
 +
 
 +
%description -n python-MythTV
 +
Provides a python-based interface to interacting with MythTV.
  
# Extract the DVB files if we're building with DVB support
 
%if %{with_dvb}
 
%setup -q -T -D -a 12
 
 
%endif
 
%endif
  
# Replace static lib paths with %{_lib} so we build properly on x86_64
+
################################################################################
# systems, where the libs are actually in lib64.
+
 
    if [ "%{_lib}" != "lib" ]; then
+
# Meta package for all mythtv plugins
        grep -rl /lib/  . | xargs sed -i -e 's,/lib/,/%{_lib}/,g'
+
%package -n mythplugins
        grep -rl /lib$  . | xargs sed -i -e 's,/lib$,/%{_lib},'
 
        grep -rl '/lib ' . | xargs sed -i -e 's,/lib ,/%{_lib} ,g'
 
    fi
 
  
# test for X not with xinit, but instead with libX11.so
+
Summary:  Main MythTV plugins
    sed -i -e 's,test -f /usr/X11R6/bin/xinit,test -f /usr/X11R6/%{_lib}/libX11.so,' configure
+
Group:    Applications/Multimedia
  
# We also need Xv libs to build XvMCNVIDIA
+
Requires:  mythmusic      = %{version}-%{release}
    sed -i -e 's,VENDOR_XVMC_LIBS="-lXvMCNVIDIA",VENDOR_XVMC_LIBS="-lXvMCNVIDIA -lXv",' configure
+
Requires:  mythvideo      = %{version}-%{release}
 +
Requires:  mythweather    = %{version}-%{release}
 +
Requires:  mythgallery    = %{version}-%{release}
 +
Requires:  mythgame      = %{version}-%{release}
 +
Requires:  mythnews      = %{version}-%{release}
 +
Requires:  mythbrowser    = %{version}-%{release}
 +
Requires:  mythphone      = %{version}-%{release}
 +
Requires:  mythcontrols  = %{version}-%{release}
 +
Requires:  mythflix      = %{version}-%{release}
 +
Requires:  mytharchive    = %{version}-%{release}
 +
Requires:  mythzoneminder = %{version}-%{release}
 +
Requires:  mythmovies    = %{version}-%{release}
 +
Requires:  mythweb        = %{version}-%{release}
  
# Fix path to artsc.h on Fedora
+
%description -n mythplugins
#    find . -type f | xargs grep -l artsc/artsc.h | xargs sed -i -e 's,artsc/artsc.h,artsc.h,g'
+
This is a consolidation of all the official MythTV plugins that used to be
 +
distributed as separate downloads from mythtv.org.
  
# Prevent all of those nasty installs to ../../../../../bin/whatever
+
################################################################################
    echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
+
%if %{with_mytharchive}
    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
 
    chmod 644 settings.pro
 
  
# Install these files that MythTV doesn't include,
+
%package -n mytharchive
# and update them with the paths set by rpmbuild.
+
Summary:   A module for MythTV for creating and burning DVDs
    cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} .
+
Group:     Applications/Multimedia
    for file in mythbackend.init      \
 
                mythbackend.sysconfig \
 
                mythbackend.logrotate; do
 
      sed -e 's#@logdir@#%{_logdir}#g'            \
 
          -e 's#@rundir@#%{_rundir}#g'            \
 
          -e 's#@sysconfigdir@#%{_sysconfigdir}#g' \
 
          -e 's#@initdir@#%{_initrddir}#g'        \
 
          -e 's#@bindir@#%{_bindir}#g'            \
 
          -e 's#@sbindir@#%{_sbindir}#g'          \
 
          -e 's#@subsysdir@#%{_subsysdir}#g'      \
 
          -e 's#@varlibdir@#%{_varlibdir}#g'      \
 
          -e 's#@varcachedir@#%{_varcachedir}#g'   \
 
          -e 's#@logrotatedir@#%{_logrotatedir}#g' \
 
      < $file.in > $file
 
     done
 
  
# Fix the perl module's install mode
+
Requires:  mythtv-frontend-api = %{mythfeapiver}
    sed -i -e 's#perl Makefile.PL#%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"#' \
+
Requires:  MySQL-python
        bindings/perl/perl.pro
+
Requires:  cdrecord >= 2.01
 +
Requires:  dvd+rw-tools >= 5.21.4.10.8
 +
Requires:  dvdauthor >= 0.6.11
 +
Requires:  ffmpeg >= 0.4.9
 +
Requires:  mjpegtools >= 1.6.2
 +
Requires:  mkisofs >= 2.01
 +
Requires:  python >= 2.3.5
 +
Requires:  python-imaging
 +
Requires:  transcode >= 1.0.2
  
# dummy docs that we can install for rpmlint's sake.
+
%description -n mytharchive
    rm -rf docs/dummy
+
MythArchive is a new plugin for MythTV that lets you create DVDs from
    mkdir docs/dummy
+
your recorded shows, MythVideo files and any video files available on
    echo "nothing here - dummy file" > docs/dummy/mythtv-backend
+
your system.
    echo "nothing here - dummy file" > docs/dummy/mythtv-setup
 
    echo "nothing here - dummy file" > docs/dummy/mythtv-frontend
 
    echo "nothing here - dummy file" > docs/dummy/mythtv-themes
 
  
 +
%endif
 
################################################################################
 
################################################################################
 +
%if %{with_mythbrowser}
  
%build
+
%package -n mythbrowser
 +
Summary:  A small web browser module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
  
# Need to set $QTDIR?
+
%description -n mythbrowser
[ -n "$QTDIR" ] || . %{_sysconfdir}/profile.d/qt.sh
+
MythBrowser is a full fledged web-browser (multiple tabs) to display
 +
webpages in full-screen mode. Simple page navigation is possible.
 +
Starting with version 0.13 it also has full support for mouse driven
 +
navigation (right mouse opens and clos es the popup menu).
  
# Initialize the options string
+
MythBrowser also contains a BookmarkManager to manage the website
OPTS=""
+
links in a simple mythplugin.
  
# Tune for the various processor types?
 
# we need to do something specific here re cpu detecting
 
%if %{with_proc_opt}
 
    OPTS="$OPTS --enable-proc-opt"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythcontrols}
 +
 +
%package -n mythcontrols
 +
Summary:  A key bindings editor for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
  
# Go through each of the config options and make sure they are
+
%description -n mythcontrols
# enabled (or disabled) as requested.
+
MythControls is a key bindings editor for MythTV.
  
%if %{with_arts}
 
    OPTS="$OPTS --enable-audio-arts"
 
%else
 
    OPTS="$OPTS --disable-audio-arts"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythflix}
 +
 +
%package -n mythflix
 +
Summary:  A NetFlix module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythflix
 +
MythFlix is a NetFlix queue manager for MythTV.
  
%if %{with_alsa}
 
    OPTS="$OPTS --enable-audio-alsa"
 
%else
 
    OPTS="$OPTS --disable-audio-alsa"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythgallery}
 +
 +
%package -n mythgallery
 +
Summary:  A gallery/slideshow module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythgallery
 +
A gallery/slideshow module for MythTV.
  
%if %{with_oss}
 
    OPTS="$OPTS --enable-audio-oss"
 
%else
 
    OPTS="$OPTS --disable-audio-oss"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythgame}
 +
 +
%package -n mythgame
 +
Summary:  A game frontend (xmame, nes, snes, pc) for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythgame
 +
A game frontend (xmame, nes, snes, pc) for MythTV.
 +
 +
################################################################################
 +
%package -n mythgame-emulators
 +
Summary:  Meta-package requiring emulators for game types mythgame knows about
 +
Group:    Applications/Multimedia
 +
Requires:  mythgame = %{version}-%{release}
 +
# Multi Arcade Machine Emulator, Amiga, Atari 2600
 +
Requires:  sdlmame
 +
Requires:  e-uae
 +
Requires:  stella
 +
# Nintendo, Super Nintendo, Nintendo 64
 +
Requires:  fceultra
 +
Requires:  zsnes
 +
Requires:  mupen64, mupen64-ricevideo
 +
# Sega Genesis, Sega Master System, Game Gear
 +
Requires:  gens
 +
Requires:  dega-sdl
 +
Requires:  osmose
 +
# TurboGraphx 16 (and others)
 +
Requires:  mednafen
 +
 +
%description -n mythgame-emulators
 +
Meta-package requiring emulators for game types mythgame knows about.
  
%if %{with_xvmcnvidia}
 
    OPTS="$OPTS --enable-xvmc"
 
%else
 
    OPTS="$OPTS --disable-xvmc"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythmovies}
 +
 +
%package -n mythmovies
 +
Summary:  A module for MythTV for providing local show times and cinema listings
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythmovies
 +
MythZoneMinder is a plugin to provide show times and cinema listings
 +
based on Zip/Post code and a given radius. It uses external scripts to
 +
grab times and so can be used in any country so long as a script is
 +
written for a local data source. It ships with a grabber for the USA
 +
which uses the ignyte website.
  
%if %{with_xvmcvld}
 
    OPTS="$OPTS --enable-xvmc-vld"
 
%else
 
    OPTS="$OPTS --disable-xvmc-vld"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythmusic}
 +
 +
%package -n mythmusic
 +
Summary:  The music player add-on module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythmusic
 +
Music add-on for mythtv.
  
%if %{with_opengl_vsync}
 
    OPTS="$OPTS --enable-opengl-vsync"
 
%else
 
    OPTS="$OPTS --disable-opengl-vsync"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythnews}
 +
 +
%package -n mythnews
 +
Summary:  An RSS news feed plugin for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythnews
 +
An RSS news feed reader plugin for MythTV.
  
%if %{with_lirc}
 
    OPTS="$OPTS --enable-lirc"
 
%else
 
    OPTS="$OPTS --disable-lirc"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythphone}
 +
 +
%package -n mythphone
 +
Summary:  A video conferencing module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythphone
 +
Mythphone is a phone and videophone capability on MYTH using the
 +
standard SIP protocol.  It is compatible with Microsoft XP Messenger
 +
and with SIP Service Providers such as Free World Dialup
 +
(fwd.pulver.com).
  
%if %{with_firewire}
 
    OPTS="$OPTS --enable-firewire"
 
%else
 
    OPTS="$OPTS --disable-firewire"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythvideo}
 +
 +
%package -n mythvideo
 +
Summary:  A generic video player frontend module for MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
Requires:  mplayer
 +
Requires:  transcode >= 0.6.8
 +
 +
Provides:  mythdvd = %{version}-%{release}
 +
Obsoletes: mythdvd < %{version}-%{release}
 +
 +
%description -n mythvideo
 +
MythVideo is a MythTV module that allows you to play videos, DVDs and
 +
(optionally) VCDs. It can also be configured to let you rip DVDs and
 +
transcode their video and audio content to other (generally smaller)
 +
formats. The player can either use the MythTV internal software (which
 +
now supports DVD menus), or simply to invoke your favorite DVD/XVCD
 +
playing software (mplayer, ogle, xine, etc) as an external
 +
command. The transcoding is based on and derived from the excellent
 +
transcode package.
  
%if %{with_jack}
 
    OPTS="$OPTS --enable-audio-jack"
 
%else
 
    OPTS="$OPTS --disable-audio-jack"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythweather}
 +
 +
%package -n mythweather
 +
Summary:  A MythTV module that displays a weather forcast
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
Requires:  perl(XML::SAX::Base)
 +
 +
%description -n mythweather
 +
A MythTV module that displays a weather forcast.
  
%if %{with_xrandr}
 
    OPTS="$OPTS --enable-xrandr"
 
%else
 
    OPTS="$OPTS --disable-xrandr"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythweb}
 +
 +
%package -n mythweb
 +
Summary:  The web interface to MythTV
 +
Group:    Applications/Multimedia
 +
Requires:  httpd >= 1.3.26
 +
Requires:  php >= 5.1
 +
Requires:  php-mysql
 +
 +
%description -n mythweb
 +
The web interface to MythTV.
  
%if %{with_directfb}
 
    OPTS="$OPTS --enable-directfb"
 
%else
 
    OPTS="$OPTS --disable-directfb"
 
 
%endif
 
%endif
 +
################################################################################
 +
%if %{with_mythzoneminder}
 +
 +
%package -n mythzoneminder
 +
Summary:  A module for MythTV for camera security and surveillance
 +
Group:    Applications/Multimedia
 +
Requires:  mythtv-frontend-api = %{mythfeapiver}
 +
 +
%description -n mythzoneminder
 +
MythZoneMinder is a plugin to interface to some of the features of
 +
ZoneMinder. You can use it to view a status window similar to the
 +
console window in ZM. Also there are screens to view live camera shots
 +
and replay recorded events.
  
%if %{with_dts}
 
    OPTS="$OPTS --enable-libdts"
 
%else
 
    OPTS="$OPTS --disable-libdts"
 
 
%endif
 
%endif
 +
################################################################################
  
%if %{with_dvb}
+
%prep
     OPTS="$OPTS --enable-dvb"
+
%setup -q -c -a 1
#   OPTS="$OPTS --enable-dvb-eit"
+
 
     OPTS="$OPTS --dvb-path=%{_builddir}/%{name}-%{version}/%{linuxtv_dvb_package}/linux/include/"
+
# Replace static lib paths with %{_lib} so we build properly on x86_64
%else
+
# systems, where the libs are actually in lib64.
     OPTS="$OPTS --disable-dvb"
+
     if [ "%{_lib}" != "lib" ]; then
%endif
+
        grep -rlZ /lib/  . | xargs -r0 sed -i -e 's,/lib/,/%{_lib}/,g'
 +
        grep -rlZ /lib$  . | xargs -r0 sed -i -e 's,/lib$,/%{_lib},'
 +
        grep -rlZ '/lib ' . | xargs -r0 sed -i -e 's,/lib ,/%{_lib} ,g'
 +
    fi
 +
 
 +
##### MythTV
 +
 
 +
cd mythtv-%{version}
 +
 
 +
# Drop execute permissions on contrib bits, since they'll be %doc
 +
    find contrib/ -type f -exec chmod -x "{}" \;
 +
 
 +
# Nuke Windows and Mac OS X build scripts
 +
     rm -rf contrib/Win32 contrib/OSX
 +
 
 +
# Put perl bits in the right place and set opt flags
 +
    sed -i -e 's#perl Makefile.PL#%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"#' \
 +
        bindings/perl/perl.pro
 +
 
 +
# Install other source files, and fix pathnames
 +
    cp -a %{SOURCE10} %{SOURCE101} %{SOURCE102} %{SOURCE103} .
 +
    cp -a %{SOURCE106} %{SOURCE107} %{SOURCE108} %{SOURCE109} .
 +
    for file in mythbackend.init \
 +
                mythbackend.sysconfig \
 +
                mythbackend.logrotate; do
 +
        sed -e's|@logdir@|%{_localstatedir}/log|g' \
 +
            -e's|@rundir@|%{_localstatedir}/run|g' \
 +
            -e's|@sysconfdir@|%{_sysconfdir}|g' \
 +
            -e's|@sysconfigdir@|%{_sysconfdir}/sysconfig|g' \
 +
            -e's|@initdir@|%{_sysconfdir}/init.d|g' \
 +
            -e's|@bindir@|%{_bindir}|g' \
 +
            -e's|@sbindir@|%{_sbindir}|g' \
 +
            -e's|@subsysdir@|%{_localstatedir}/lock/subsys|g' \
 +
            -e's|@varlibdir@|%{_localstatedir}/lib|g' \
 +
            -e's|@varcachedir@|%{_localstatedir}/cache|g' \
 +
            -e's|@logrotatedir@|%{_sysconfdir}/logrotate.d|g' \
 +
            < $file.in > $file
 +
    done
 +
 
 +
# Prevent all of those nasty installs to ../../../../../bin/whatever
 +
#    echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
 +
#    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
 +
#    chmod 644 settings.pro
 +
 
 +
# We also need Xv libs to build XvMCNVIDIA
 +
     sed -i -e 's,VENDOR_XVMC_LIBS="-lXvMCNVIDIA",VENDOR_XVMC_LIBS="-lXvMCNVIDIA -lXv",' configure
 +
 
 +
# On to mythplugins
 +
    cd ..
 +
 
 +
##### MythPlugins
 +
 
 +
cd mythplugins-%{version}
 +
 
 +
# Fix /mnt/store -> /var/lib/mythmusic
 +
    cd mythmusic
 +
    sed -i -e's,/mnt/store/music,%{_localstatedir}/lib/mythmusic,' mythmusic/globalsettings.cpp
 +
    cd ..
 +
 
 +
# Fix /mnt/store -> /var/lib/mythvideo
 +
    cd mythvideo
 +
    sed -i -e 's,/share/Movies/dvd,%{_localstatedir}/lib/mythvideo,' mythvideo/globalsettings.cpp
 +
    cd ..
 +
 
 +
# Fix up permissions for MythWeb
 +
    cd mythweb
 +
    chmod -R g-w ./*
 +
    cd ..
 +
 
 +
# Prevent all of those nasty installs to ../../../../../bin/whatever
 +
#    echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
 +
#    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
 +
#    chmod 644 settings.pro
 +
 
 +
# And back to the compile root
 +
    cd ..
  
%if %{with_perl}
+
################################################################################
    OPTS="$OPTS --with-bindings=perl"
 
%endif
 
  
%if %{with_x264}
+
%build
    OPTS="$OPTS --enable-x264"
 
%endif
 
  
%if %{with_aac}
+
# First, we build MythTV
    OPTS="$OPTS --enable-libfaac"
+
cd mythtv-%{version}
    OPTS="$OPTS --enable-libfaad --enable-libfaadbin"
 
%endif
 
  
 
# Similar to 'percent' configure, but without {_target_platform} and
 
# Similar to 'percent' configure, but without {_target_platform} and
Line 618: Line 933:
 
# configure macro passes, so we do this manually.
 
# configure macro passes, so we do this manually.
 
./configure \
 
./configure \
     --prefix=%{_prefix}           \
+
     --prefix=%{_prefix}                         \
     --libdir=%{_libdir}           \
+
     --libdir=%{_libdir}                         \
     --libdir-name=%{_lib}         \
+
     --libdir-name=%{_lib}                       \
     --mandir=%{_mandir}           \
+
     --mandir=%{_mandir}                         \
     --compile-type=%{compile_type} \
+
--disable-iptv \
--enable-joystick-menu         \
+
    --enable-pthreads                          \
--enable-ivtv                 \
+
    --enable-ffmpeg-pthreads                    \
--enable-x11                   \
+
    --enable-joystick-menu                      \
--enable-xv                    \
+
    --enable-audio-arts                        \
     $OPTS
+
    --enable-audio-alsa                        \
 +
    --enable-audio-oss                          \
 +
     --enable-audio-jack                        \
 +
    --enable-x11 --x11-path=%{_includedir}     \
 +
    --enable-xv                                \
 +
    --enable-xvmc-vld --enable-xvmc-pro         \
 +
    --enable-opengl-video --enable-opengl-vsync \
 +
    --enable-xrandr                            \
 +
    --enable-lirc                              \
 +
    --enable-ivtv                               \
 +
    --enable-firewire                          \
 +
    --enable-dvb                                \
 +
    --enable-libfaac                            \
 +
    --enable-libfaad --enable-libfaad --enable-libfaadbin \
 +
    --enable-liba52                            \
 +
    --enable-libmp3lame                        \
 +
    --enable-libtheora --enable-libvorbis      \
 +
    --enable-libxvid                            \
 +
%if %{with_xvmcnvidia}
 +
    --xvmc-lib=XvMCNVIDIA_dynamic              \
 +
    --enable-xvmc-opengl                        \
 +
%else
 +
    --disable-xvmc-opengl                      \
 +
%endif
 +
%if %{with_directfb}
 +
    --enable-directfb                          \
 +
%else
 +
    --disable-directfb                          \
 +
%endif
 +
%if !%{with_perl}
 +
    --without-bindings=perl                    \
 +
%endif
 +
%if !%{with_python}
 +
    --without-bindings=python                   \
 +
%endif
 +
%ifarch ppc
 +
    --extra-cflags="%{optflags} -maltivec -fomit-frame-pointer" \
 +
    --extra-cxxflags="%{optflags} -maltivec -fomit-frame-pointer" \
 +
%else
 +
    --extra-cflags="%{optflags} -fomit-frame-pointer" \
 +
    --extra-cxxflags="%{optflags} -fomit-frame-pointer" \
 +
%endif
 +
%ifarch %{ix86}
 +
    --cpu=i686 --tune=i686 --enable-mmx \
 +
%endif
 +
%if %{with_proc_opt}
 +
    --enable-proc-opt \
 +
%endif
 +
%if %{with_debug}
 +
    --compile-type=debug                        \
 +
%else
 +
    --compile-type=release                      \
 +
%endif
 +
     --enable-debug
 +
###    --enable-libx264                            \
 +
 
 +
# Insert rpm version-release for mythbackend --version output
 +
    find . -name version.pro -exec sed -i -e 's,svnversion \$\${SVNTREEDIR},echo "%{version}-%{release}",g' {} \;
  
 
# Make
 
# Make
make %{?_smp_mflags}
+
    make %{?_smp_mflags}
 +
 
 +
# Prepare to build the plugins
 +
    cd ..
 +
    mkdir temp
 +
    temp=`pwd`/temp
 +
    make -C mythtv-%{version} install INSTALL_ROOT=$temp
 +
    export LD_LIBRARY_PATH=$temp%{_libdir}:$LD_LIBRARY_PATH
 +
 
 +
# Next, we build the plugins
 +
cd mythplugins-%{version}
 +
 
 +
# Fix things up so they can find our "temp" install location for libmyth
 +
    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
 +
    find . -name \*.pro \
 +
        -exec sed -i -e "s,INCLUDEPATH += .\+/include/mythtv,INCLUDEPATH += $temp%{_includedir}/mythtv," {} \; \
 +
        -exec sed -i -e "s,TARGETDEPS += \$\${LIBDIR}/libmyth,TARGETDEPS += $temp%{_libdir}/libmyth," {} \; \
 +
        -exec sed -i -e "s,\$\${PREFIX}/include/mythtv,$temp%{_includedir}/mythtv," {} \;
 +
    echo "INCLUDEPATH -= \$\${PREFIX}/include" >> settings.pro
 +
    echo "INCLUDEPATH -= %{_includedir}"      >> settings.pro
 +
    echo "INCLUDEPATH += $temp%{_includedir}"  >> settings.pro
 +
    echo "INCLUDEPATH += %{_includedir}"      >> settings.pro
 +
    echo "LIBS *= -L$temp%{_libdir}"          >> settings.pro
 +
    echo "QMAKE_LIBDIR += $temp%{_libdir}"    >> targetdep.pro
 +
 
 +
    ./configure \
 +
        --prefix=${temp}%{_prefix} \
 +
        --libdir=%{_libdir} \
 +
        --libdir-name=%{_lib} \
 +
    %if %{with_mytharchive}
 +
        --enable-mytharchive \
 +
        --enable-create-dvd \
 +
        --enable-create-archive \
 +
    %else
 +
        --disable-mytharchive \
 +
    %endif
 +
    %if %{with_mythbrowser}
 +
        --enable-mythbrowser \
 +
    %else
 +
        --disable-mythbrowser \
 +
    %endif
 +
    %if %{with_mythcontrols}
 +
        --enable-mythcontrols \
 +
    %else
 +
        --disable-mythcontrols \
 +
    %endif
 +
    %if %{with_mythflix}
 +
        --enable-mythflix \
 +
    %else
 +
        --disable-mythflix \
 +
    %endif
 +
    %if %{with_mythgallery}
 +
        --enable-mythgallery \
 +
        --enable-exif \
 +
        --enable-new-exif \
 +
    %else
 +
        --disable-mythgallery \
 +
    %endif
 +
    %if %{with_mythgame}
 +
        --enable-mythgame \
 +
    %else
 +
        --disable-mythgame \
 +
    %endif
 +
    %if %{with_mythmovies}
 +
        --enable-mythmovies \
 +
    %else
 +
        --disable-mythmovies \
 +
    %endif
 +
    %if %{with_mythmusic}
 +
        --enable-mythmusic \
 +
    %else
 +
        --disable-mythmusic \
 +
    %endif
 +
    %if %{with_mythnews}
 +
        --enable-mythnews \
 +
    %else
 +
        --disable-mythnews \
 +
    %endif
 +
    %if %{with_mythphone}
 +
        --enable-mythphone \
 +
    %else
 +
        --disable-mythphone \
 +
    %endif
 +
    %if %{with_mythvideo}
 +
        --enable-mythvideo \
 +
        --enable-transcode \
 +
        --enable-vcd \
 +
    %else
 +
        --disable-mythvideo \
 +
    %endif
 +
    %if %{with_mythweather}
 +
        --enable-mythweather \
 +
    %else
 +
        --disable-mythweather \
 +
    %endif
 +
    %if %{with_mythweb}
 +
        --enable-mythweb \
 +
    %else
 +
        --disable-mythweb \
 +
    %endif
 +
    %if %{with_mythzoneminder}
 +
        --enable-mythzoneminder \
 +
    %else
 +
        --disable-mythzoneminder \
 +
    %endif
 +
    %if %{with_festival}
 +
        --enable-festival \
 +
    %else
 +
        --disable-festival \
 +
    %endif
 +
        --enable-opengl \
 +
        --enable-libvisual \
 +
        --enable-fftw \
 +
        --enable-sdl \
 +
        --enable-aac
 +
 
 +
    make %{?_smp_mflags}
 +
 
 +
    cd ..
  
# We don't want rpm to add perl requirements to anything in contrib
 
find contrib -type f | xargs -r chmod a-x
 
  
 
################################################################################
 
################################################################################
Line 639: Line 1,127:
 
%install
 
%install
  
rm -rf %{buildroot}
+
# Clean
make install INSTALL_ROOT=%{buildroot}
+
    rm -rf %{buildroot}
 +
 
 +
# First, install MythTV
 +
cd mythtv-%{version}
 +
 
 +
    make install INSTALL_ROOT=%{buildroot}
 +
 
 +
    ln -s mythtv-setup %{buildroot}%{_bindir}/mythtvsetup
 +
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythtv
 +
    mkdir -p %{buildroot}%{_localstatedir}/cache/mythtv
 +
    mkdir -p %{buildroot}%{_localstatedir}/log/mythtv
 +
    mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
 +
    mkdir -p %{buildroot}%{_sysconfdir}/init.d
 +
    mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
 +
    mkdir -p %{buildroot}%{_sysconfdir}/mythtv
  
ln -s mythtv-setup %{buildroot}%{_bindir}/mythtvsetup
+
# Fix permissions on executable python bindings
mkdir -p %{buildroot}%{_varlibdir}/mythtv
+
    chmod +x %{buildroot}%{python_sitelib}/MythTV/Myth{DB,TV}.py
mkdir -p %{buildroot}%{_varcachedir}/mythtv
 
mkdir -p %{buildroot}%{_logdir}/mythtv
 
mkdir -p %{buildroot}%{_logrotatedir}
 
mkdir -p %{buildroot}%{_initrddir}
 
mkdir -p %{buildroot}%{_sysconfigdir}
 
  
# get perms right for rpmlint.
+
# mysql.txt and other config/init files
install -p -m 755 mythbackend.init     %{buildroot}%{_initrddir}/mythbackend
+
    install -m 644 %{SOURCE110} %{buildroot}%{_sysconfdir}/mythtv/
install -p -m 644 mythbackend.sysconfig %{buildroot}%{_sysconfigdir}/mythbackend
+
    echo "# to be filled in by mythtv-setup" > %{buildroot}%{_sysconfdir}/mythtv/config.xml
install -p -m 644 mythbackend.logrotate %{buildroot}%{_logrotatedir}/mythbackend
+
    install -p -m 755 mythbackend.init %{buildroot}%{_sysconfdir}/init.d/mythbackend
 +
    install -p -m 644 mythbackend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mythbackend
 +
    install -p -m 644 mythbackend.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/mythbackend
  
 
# Desktop entries
 
# Desktop entries
mkdir -p %{buildroot}%{_datadir}/pixmaps
+
    mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
+
    mkdir -p %{buildroot}%{_datadir}/applications
for file in %{desktop_applications}; do
+
    for file in %{desktop_applications}; do
  if [ ! -f %{_sourcedir}/$file.png ] ; then
+
      install -p $file.png %{buildroot}%{_datadir}/pixmaps/$file.png
    cp %{_sourcedir}/mythfrontend.png %{_sourcedir}/$file.png
+
      desktop-file-install --vendor %{desktop_vendor} \
    cp %{_sourcedir}/mythfrontend.desktop %{_sourcedir}/$file.desktop
+
        --dir %{buildroot}%{_datadir}/applications    \
  fi
+
        --add-category X-Fedora-Extra     \
  install -p %{_sourcedir}/$file.png %{buildroot}%{_datadir}/pixmaps/$file.png
+
        --add-category Application       \
  desktop-file-install --vendor %{desktop_vendor} \
+
        --add-category AudioVideo         \
    --dir %{buildroot}%{_datadir}/applications    \
+
        $file.desktop
    --add-category X-Red-Hat-Extra               \
+
    done
    --add-category Application                   \
 
    --add-category AudioVideo                     \
 
    %{_sourcedir}/$file.desktop
 
done
 
  
mkdir -p %{buildroot}%{_libdir}/mythtv/plugins
+
    mkdir -p %{buildroot}%{_libdir}/mythtv/plugins
  
mkdir -p %{buildroot}%{_datadir}/mythtv/build/
+
    mkdir -p %{buildroot}%{_datadir}/mythtv/build/
install -p -m 644 settings.pro %{buildroot}%{_datadir}/mythtv/build/
+
    install -p -m 644 settings.pro %{buildroot}%{_datadir}/mythtv/build/
  
# Fix the perl .packlist info
+
    cd ..
%if %{with_perl}
+
 
     sed -i -e "s#^$RPM_BUILD_ROOT##" "$RPM_BUILD_ROOT/%{perl_vendorarch}/auto/"*/.packlist
+
# MythPlugins
 +
cd mythplugins-%{version}
 +
 
 +
    make install INSTALL_ROOT=%{buildroot}
 +
 
 +
%if %{with_mythmusic}
 +
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythmusic
 +
%endif
 +
%if %{with_mythvideo}
 +
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythvideo
 +
%endif
 +
%if %{with_mythgallery}
 +
    mkdir -p %{buildroot}%{_localstatedir}/lib/pictures
 +
%endif
 +
%if %{with_mythgame}
 +
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/nes/{roms,screens}
 +
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/snes/{roms,screens}
 +
#   mkdir -p %{buildroot}%{_datadir}/mythtv/games/mame/{roms,screens,flyers,cabs}
 +
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/PC/screens
 +
    mkdir -p %{buildroot}%{_datadir}/mame
 +
    ln -s ../../mame %{buildroot}%{_datadir}/mythtv/games/xmame
 +
    mkdir -p %{buildroot}%{_datadir}/mame/flyers
 +
    ln -s snap %{buildroot}%{_datadir}/mythtv/games/xmame/screens
 +
    mkdir -p %{buildroot}%{_sysconfdir}/mythgame
 +
    cp -a mythgame/gamelist.xml %{buildroot}%{_sysconfdir}/mythgame/
 +
    ln -s ../../../../../%{_sysconfdir}/mythgame/ \
 +
        %{buildroot}%{_datadir}/mythtv/games/PC/gamelist.xml
 +
%endif
 +
 
 +
%if %{with_mythweb}
 +
    cd mythweb
 +
    mkdir -p %{buildroot}%{_datadir}/mythweb
 +
     cp -a * %{buildroot}%{_datadir}/mythweb/
 +
    mkdir -p %{buildroot}%{_datadir}/mythweb/{image_cache,php_sessions}
 +
# fix up permissions
 +
    chmod -R g-x %{buildroot}%{_datadir}/mythweb
 +
 
 +
    mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
 +
    cp %{SOURCE401} %{buildroot}%{_sysconfdir}/httpd/conf.d/
 +
# drop .htaccess file, settings handled in the above
 +
    rm -f %{buildroot}%{_datadir}/mythweb/data/.htaccess
 +
    cd ..
 
%endif
 
%endif
 +
 +
# And back to the build/install root
 +
    cd ..
  
 
################################################################################
 
################################################################################
Line 692: Line 1,231:
 
# Add the "mythtv" user
 
# Add the "mythtv" user
 
/usr/sbin/useradd -c "mythtvbackend User" \
 
/usr/sbin/useradd -c "mythtvbackend User" \
        -s /sbin/nologin -r -d %{_varlibdir}/mythtv mythtv 2> /dev/null || :
+
    -s /sbin/nologin -r -d %{_varlibdir}/mythtv mythtv 2> /dev/null || :
  
 
%post
 
%post
Line 700: Line 1,239:
 
%postun -n libmyth -p /sbin/ldconfig
 
%postun -n libmyth -p /sbin/ldconfig
  
%post -n mythtv-backend
+
%post backend
 
/sbin/chkconfig --add mythbackend
 
/sbin/chkconfig --add mythbackend
  
%preun -n mythtv-backend
+
%preun backend
 
if [ $1 = 0 ]; then
 
if [ $1 = 0 ]; then
 
     /sbin/service mythbackend stop > /dev/null 2>&1
 
     /sbin/service mythbackend stop > /dev/null 2>&1
Line 713: Line 1,252:
 
%files
 
%files
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
%doc README* UPGRADING AUTHORS COPYING FAQ
 
%doc database keys.txt
 
%doc docs/*.html docs/*.png docs/*.txt contrib
 
  
%define ghostattr %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
+
%files docs
 +
%defattr(-,root,root,-)
 +
%doc mythtv-%{version}/README* mythtv-%{version}/UPGRADING
 +
%doc mythtv-%{version}/AUTHORS mythtv-%{version}/COPYING mythtv-%{version}/FAQ
 +
%doc mythtv-%{version}/database mythtv-%{version}/keys.txt
 +
%doc mythtv-%{version}/docs/*.html mythtv-%{version}/docs/*.png
 +
%doc mythtv-%{version}/docs/*.txt mythtv-%{version}/contrib
 +
%doc mythtv-%{version}/PACKAGE-LICENSING
 +
 
 +
%files common
 +
%defattr(-,root,root,-)
 +
%dir %{_sysconfdir}/mythtv
 +
%config(noreplace) %{_sysconfdir}/mythtv/mysql.txt
 +
%config(noreplace) %{_sysconfdir}/mythtv/config.xml
 +
%{_bindir}/mythcommflag
 +
%{_bindir}/mythtranscode
 +
%{_datadir}/mythtv/mythconverg*.pl
  
%files -n mythtv-backend
+
%files backend
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
%attr(-,mythtv,mythtv) %dir %{_logdir}/mythtv
 
%attr(-,mythtv,mythtv) %dir %{_varcachedir}/mythtv
 
%attr(-,mythtv,mythtv) %dir %{_varlibdir}/mythtv
 
%config(noreplace) %{_logrotatedir}/mythbackend
 
%config(noreplace) %{_sysconfigdir}/mythbackend
 
 
%{_bindir}/mythbackend
 
%{_bindir}/mythbackend
 
%{_bindir}/mythfilldatabase
 
%{_bindir}/mythfilldatabase
 
%{_bindir}/mythjobqueue
 
%{_bindir}/mythjobqueue
%{_bindir}/mythtranscode
 
 
%{_bindir}/mythreplex
 
%{_bindir}/mythreplex
%{_initrddir}/mythbackend
+
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/lib/mythtv
# Hm, somehow this doesn't work yet ... :(
+
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/cache/mythtv
#%ghostattr %{_logdir}/mythtv/mythbackend.log*
+
%{_sysconfdir}/init.d/mythbackend
#%ghostattr %{_rundir}/mythbackend.pid
+
%config(noreplace) %{_sysconfdir}/sysconfig/mythbackend
#%ghostattr %{_subsysdir}/mythbackend
+
%config(noreplace) %{_sysconfdir}/logrotate.d/mythbackend
%doc docs/dummy/mythtv-backend
+
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/log/mythtv
  
%files -n mythtv-setup
+
%files setup
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
 
%{_bindir}/mythtv-setup
 
%{_bindir}/mythtv-setup
 
%{_bindir}/mythtvsetup
 
%{_bindir}/mythtvsetup
%doc docs/dummy/mythtv-setup
+
%{_datadir}/mythtv/setup.xml
 +
%{_datadir}/applications/*mythtv-setup.desktop
  
%files -n mythtv-frontend
+
%files frontend
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
%{_bindir}/mythcommflag
+
%{_datadir}/mythtv/CDS_scpd.xml
 +
%{_datadir}/mythtv/CMGR_scpd.xml
 +
%{_datadir}/mythtv/MFEXML_scpd.xml
 +
%{_datadir}/mythtv/MSRR_scpd.xml
 +
%{_datadir}/mythtv/devicemaster.xml
 +
%{_datadir}/mythtv/deviceslave.xml
 +
%{_datadir}/mythtv/info_menu.xml
 +
%{_datadir}/mythtv/info_settings.xml
 +
%{_datadir}/mythtv/library.xml
 +
%{_datadir}/mythtv/main_settings.xml
 +
%{_datadir}/mythtv/mainmenu.xml
 +
%{_datadir}/mythtv/manage_recordings.xml
 +
%{_datadir}/mythtv/media_settings.xml
 +
%{_datadir}/mythtv/optical_menu.xml
 +
%{_datadir}/mythtv/recpriorities_settings.xml
 +
%{_datadir}/mythtv/setup.xml
 +
%{_datadir}/mythtv/tv_lists.xml
 +
%{_datadir}/mythtv/tv_schedule.xml
 +
%{_datadir}/mythtv/tv_search.xml
 +
%{_datadir}/mythtv/tv_settings.xml
 +
%{_datadir}/mythtv/tvmenu.xml
 +
%{_datadir}/mythtv/util_menu.xml
 
%{_bindir}/mythfrontend
 
%{_bindir}/mythfrontend
 +
%{_bindir}/mythtv
 +
%{_bindir}/mythtvosd
 
%{_bindir}/mythlcdserver
 
%{_bindir}/mythlcdserver
 
%{_bindir}/mythshutdown
 
%{_bindir}/mythshutdown
%{_bindir}/mythtv
 
%{_bindir}/mythtvosd
 
 
%{_bindir}/mythwelcome
 
%{_bindir}/mythwelcome
%{_datadir}/applications/*myth*.desktop
+
%{_libdir}/mythtv/filters
 +
%dir %{_libdir}/mythtv/plugins
 
%{_datadir}/mythtv/*.ttf
 
%{_datadir}/mythtv/*.ttf
%{_datadir}/mythtv/*.xml
+
%dir %{_datadir}/mythtv/i18n
%{_datadir}/mythtv/i18n
+
%{_datadir}/mythtv/i18n/mythfrontend_*.qm
 +
%{_datadir}/applications/*mythfrontend.desktop
 
%{_datadir}/pixmaps/myth*.png
 
%{_datadir}/pixmaps/myth*.png
%{_libdir}/mythtv/filters
 
%{_libdir}/mythtv/plugins
 
%doc docs/dummy/mythtv-frontend
 
  
%files -n mythtv-themes
+
%files base-themes
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
%{_datadir}/mythtv/themes
+
%dir %{_datadir}/mythtv/themes
%doc docs/dummy/mythtv-themes
+
%{_datadir}/mythtv/themes/*
  
 
%files -n libmyth
 
%files -n libmyth
Line 775: Line 1,342:
 
%{_includedir}/*
 
%{_includedir}/*
 
%{_libdir}/*.so
 
%{_libdir}/*.so
%{_libdir}/*.a
+
%exclude %{_libdir}/*.a
 
%{_datadir}/mythtv/build/settings.pro
 
%{_datadir}/mythtv/build/settings.pro
 +
 +
%files -n mythplugins
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/COPYING
  
 
%if %{with_perl}
 
%if %{with_perl}
 
 
%files -n perl-MythTV
 
%files -n perl-MythTV
 
%defattr(-,root,root,-)
 
%defattr(-,root,root,-)
%{perl_vendorlib}/*
+
%{perl_vendorlib}/MythTV.pm
%{perl_vendorarch}/auto/*
+
%dir %{perl_vendorlib}/MythTV
 +
%{perl_vendorlib}/MythTV/*.pm
 +
%{perl_vendorlib}/IO/Socket/INET/MythTV.pm
 +
%exclude %{perl_vendorarch}/auto/MythTV/.packlist
 +
%endif
  
 +
%if %{with_python}
 +
%files -n python-MythTV
 +
%defattr(-,root,root,-)
 +
%dir %{python_sitelib}/MythTV/
 +
%{python_sitelib}/MythTV/*
 +
%if 0%{?fedora} >= 9
 +
%{python_sitelib}/MythTV-*.egg-info
 +
%endif
 
%endif
 
%endif
  
################################################################################
+
%if %{with_mytharchive}
 +
%files -n mytharchive
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mytharchive/AUTHORS
 +
%doc mythplugins-%{version}/mytharchive/COPYING
 +
%doc mythplugins-%{version}/mytharchive/README
 +
%doc mythplugins-%{version}/mytharchive/TODO
 +
%{_bindir}/mytharchivehelper
 +
%{_libdir}/mythtv/plugins/libmytharchive.so
 +
%{_datadir}/mythtv/archiveformat.xml
 +
%{_datadir}/mythtv/archivemenu.xml
 +
%{_datadir}/mythtv/archiveutils.xml
 +
%{_datadir}/mythtv/mytharchive
 +
%{_datadir}/mythtv/i18n/mytharchive_*.qm
 +
%endif
  
%changelog
+
%if %{with_mythbrowser}
 +
%files -n mythbrowser
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythbrowser/AUTHORS
 +
%doc mythplugins-%{version}/mythbrowser/COPYING
 +
%doc mythplugins-%{version}/mythbrowser/README
 +
%{_bindir}/mythbrowser
 +
%{_libdir}/mythtv/plugins/libmythbookmarkmanager.so
 +
%{_datadir}/mythtv/i18n/mythbrowser_*.qm
 +
%endif
  
* Sat Nov 18 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythcontrols}
- Add x264 support
+
%files -n mythcontrols
- Add faac support
+
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythcontrols/AUTHORS
 +
%doc mythplugins-%{version}/mythcontrols/COPYING
 +
%doc mythplugins-%{version}/mythcontrols/README
 +
%doc mythplugins-%{version}/mythcontrols/TODO
 +
%{_libdir}/mythtv/plugins/libmythcontrols.so
 +
%{_datadir}/mythtv/i18n/mythcontrols_*.qm
 +
%endif
  
* Wed Aug 30 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythflix}
- add -i to the SVN grep to account for certain foreign languages that capitalize "Revision"
+
%files -n mythflix
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythflix/AUTHORS
 +
%doc mythplugins-%{version}/mythflix/COPYING
 +
%doc mythplugins-%{version}/mythflix/README
 +
%{_libdir}/mythtv/plugins/libmythflix.so
 +
%{_datadir}/mythtv/mythflix
 +
%{_datadir}/mythtv/i18n/mythflix_*.qm
 +
%{_datadir}/mythtv/i18n/mythflix_*.ts
 +
%{_datadir}/mythtv/netflix_menu.xml
 +
%endif
  
* Mon Jul 03 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythgallery}
- Add perl-MythTV subpackage
+
%files -n mythgallery
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythgallery/AUTHORS
 +
%doc mythplugins-%{version}/mythgallery/COPYING
 +
%doc mythplugins-%{version}/mythgallery/README
 +
%{_libdir}/mythtv/plugins/libmythgallery.so
 +
%{_datadir}/mythtv/i18n/mythgallery_*.qm
 +
%{_localstatedir}/lib/pictures
 +
%endif
  
* Sun May 21 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythgame}
- Add libdvdnav dependencies
+
%files -n mythgame
- Add dependency for /etc/X11/XvMCConfig for runtime xvmc detection
+
%defattr(-,root,root,-)
 +
%dir %{_sysconfdir}/mythgame
 +
%config(noreplace) %{_sysconfdir}/mythgame/gamelist.xml
 +
%{_libdir}/mythtv/plugins/libmythgame.so
 +
%{_datadir}/mythtv/games
 +
%exclude %{_datadir}/mythtv/games/xmame
 +
%{_datadir}/mythtv/game_settings.xml
 +
%{_datadir}/mythtv/i18n/mythgame_*.qm
  
* Wed May 10 2006 Chris Petersen <rpm@forevermore.net>
+
%files -n mythgame-emulators
- Replace libXvMCW with libXvMC to reduce dependency on atrpms, which doesn't seem to carry the package anymore.
+
%defattr(-,root,root,-)
 +
%{_datadir}/mythtv/games/xmame
 +
%{_datadir}/mame/screens
 +
%{_datadir}/mame/flyers
 +
%endif
  
* Sat Apr 01 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythmovies}
- Enhance SVN support so that the build doesn't fail if there were updated files in the repository.
+
%files -n mythmovies
- Add detection for modular X.org so we don't need two spec files.
+
%defattr(-,root,root,-)
- Add documentation at the top of the file for the --with and --without options.
+
%doc mythplugins-%{version}/mythmovies/COPYING
- Rename _myth_svnroot to _svn_root to make the code more portable to other packages.
+
%doc mythplugins-%{version}/mythmovies/README
 +
%doc mythplugins-%{version}/mythmovies/TODO
 +
%{_bindir}/ignyte
 +
%{_datadir}/mythtv/themes/default/movies-ui.xml
 +
%{_libdir}/mythtv/plugins/libmythmovies.so
 +
%endif
  
* Fri Mar 31 2006 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythmusic}
- Improve comments and rearrange some of the declarations for a better layout.
+
%files -n mythmusic
- Remove mythbackend from desktop_applications, since it's not something that gets launched from a menu.
+
%defattr(-,root,root,-)
- Add with_dts option.
+
%doc mythplugins-%{version}/mythmusic/AUTHORS
- Replace XFree86-devel BuildRequires with Xorg 7's mesa-libGLU-devel.
+
%doc mythplugins-%{version}/mythmusic/COPYING
- Remove mythepg and mythprogfind, as they don't seem to exist anymore.
+
%doc mythplugins-%{version}/mythmusic/README
- Remove commented-out reference to mysql.txt.
+
%{_libdir}/mythtv/plugins/libmythmusic.so
- Put mythtranscode in the backend package, where it's supposed to be.
+
%{_localstatedir}/lib/mythmusic
- Why run perl in sed mode when you can just run sed? (`perl -p` -> `sed`)
+
%{_datadir}/mythtv/musicmenu.xml
- Remove the unnecessary check for .cvsignore files.
+
%{_datadir}/mythtv/music_settings.xml
- Remove a bunch of unnecessary directory changes.
+
%{_datadir}/mythtv/MXML_scpd.xml
- Set with_proc_opt off by default, as it should be (rpm does a good enough job with this).
+
%{_datadir}/mythtv/i18n/mythmusic_*.qm
- Add _smp_mflags to the make call.
+
%endif
- Fix all kinds of inconsistencies in the svn grabbing and build code so that it actually works (even with ccache)
 
  
* Tue Jan 03 2006 David Bussenschutt <buzz@oska.com> %{version}-%{release}
+
%if %{with_mythnews}
- Converted/Modified Chris' July 19 2005 spec to fully automate build of SVN for nightly snapshots.
+
%files -n mythnews
- reenabled opengl-vsync by default since atrpms has it enabled now!
+
%defattr(-,root,root,-)
- enabled --with-proc-opt by default, as most SVN users will want this.
+
%doc mythplugins-%{version}/mythnews/AUTHORS
- enabled 'debug' as SVN users will probably want this, gdb friendly.
+
%doc mythplugins-%{version}/mythnews/COPYING
- pulled axel's %%{_lib} fixes from June 4 2005 into this file
+
%doc mythplugins-%{version}/mythnews/README
- resolved svn chicken-and-egg 'what version is this specfile?' question, by aborting on svn revision change
+
%{_libdir}/mythtv/plugins/libmythnews.so
- ran results through rpmlint and fixed other minor errors (minor install perms)
+
%{_datadir}/mythtv/mythnews
- made all package,description,files keywords use -n syntax for clarity
+
%{_datadir}/mythtv/i18n/mythnews_*.qm
 +
%endif
  
* Tue Jul 19 2005 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythphone}
- Remove atrpms patches
+
%files -n mythphone
- Change desktop vendor from atrpms to mythtv
+
%defattr(-,root,root,-)
- Change summary from PVR to DVR
+
%doc mythplugins-%{version}/mythphone/AUTHORS
 +
%doc mythplugins-%{version}/mythphone/COPYING
 +
%doc mythplugins-%{version}/mythphone/README
 +
%doc mythplugins-%{version}/mythphone/TODO
 +
%{_libdir}/mythtv/plugins/libmythphone.so
 +
%{_datadir}/mythtv/i18n/mythphone_*.qm
 +
%endif
 +
 
 +
%if %{with_mythvideo}
 +
%files -n mythvideo
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythvideo/COPYING
 +
%doc mythplugins-%{version}/mythvideo/README*
 +
%{_libdir}/mythtv/plugins/libmythvideo.so
 +
%{_datadir}/mythtv/mythvideo
 +
%{_datadir}/mythtv/i18n/mythvideo_*.qm
 +
%{_datadir}/mythtv/video_settings.xml
 +
%{_datadir}/mythtv/videomenu.xml
 +
%{_localstatedir}/lib/mythvideo
 +
%{_bindir}/mtd
 +
%endif
  
* Mon Apr 18 2005 Chris Petersen <rpm@forevermore.net>
+
%if %{with_mythweather}
- Clean up spec, add documentation
+
%files -n mythweather
- Rework --with and --without options
+
%defattr(-,root,root,-)
- Disable opengl-vsync by default (it's unstable for too many people)
+
%doc mythplugins-%{version}/mythweather/AUTHORS
 +
%doc mythplugins-%{version}/mythweather/COPYING
 +
%doc mythplugins-%{version}/mythweather/README
 +
%{_libdir}/mythtv/plugins/libmythweather.so
 +
%{_datadir}/mythtv/i18n/mythweather_*.qm
 +
%{_datadir}/mythtv/weather_settings.xml
 +
%{_datadir}/mythtv/mythweather
 +
%endif
  
* Fri Apr 15 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
+
%if %{with_mythweb}
- Update to 0.18.
+
%files -n mythweb
 +
%defattr(-,root,root,-)
 +
%doc mythplugins-%{version}/mythweb/README
 +
%config(noreplace) %{_sysconfdir}/httpd/conf.d/mythweb.conf
 +
%defattr(-,apache,apache,0775)
 +
%dir %{_datadir}/mythweb
 +
%{_datadir}/mythweb/*
 +
%endif
  
* Thu Apr 14 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
+
%if %{with_mythzoneminder}
- Split off some themes into the myththemes package.
+
%files -n mythzoneminder
 +
%defattr(-,root,root,-)
 +
%{_libdir}/mythtv/plugins/libmythzoneminder.so
 +
%{_datadir}/mythtv/zonemindermenu.xml
 +
%{_bindir}/mythzmserver
 +
%endif
  
* Mon Apr 04 2005 Jarod Wilson <jarod@wilsonet.com>
+
################################################################################
- Rebuilt against nVidia 7174 XvMC
 
- Includes Qt 3.3.4 time change patch
 
  
* Thu Mar 03 2005 Jarod Wilson <jarod@wilsonet.com>
+
%changelog
- Rebuilt against 20050228 DVB
 
- Add patch to include nVidia XvMC support again,
 
  but have it turned off by default
 
  
* Wed Feb 23 2005 Jarod Wilson <jarod@wilsonet.com>
+
* Tue Oct 28 2008 Chris Petersen <rpm@forevermore.net> 0.22-0.1.svn
- Added FireWire support
+
- Update to compile for pre-0.22 svn trunk, including new files and qt4 deps
 +
- Major cleanup and porting from my personal spec (which was a combination
 +
  of works from atrpms and some of Jarod's earlier works).
 +
- Add a few more --with and --without options, including the ability to
 +
  disable specific mythplugins.
  
* Fri Feb 11 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Wed Sep 10 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.21-8
- Update to 0.17.
+
- rebuild for new libraw1394
  
* Sat Nov 27 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sun Jul 20 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-7
- Now that it works, disable XvMC in default build ...
+
- Disable XvMC VLD and Pro support on ppc due to lack of
 +
  openchrome driver.
  
* Wed Nov 24 2004 Jarod Wilson <jcw@wilsonet.com>
+
* Sat Jul 19 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-6
- Fix xvmcnvidia build.
+
- Fix spec typo
 +
- Disable mythstream patch for now, too much fuzz, revisit later
  
* Fri Sep 17 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Fri Jul 18 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-5
- Remove dependencies on xmltv-grabbers and mysql (Edward Rudd
+
- Update release-0-21-fixes patches (r17859)
  <eddie@omegaware.com>).
+
- Don't use %%bcond, breaks on some older buildsystems
- Include math.h in dvbdiseqc.cpp (Edward Rudd <eddie@omegaware.com>).
+
- Put several bits in -common sub-package, as both backend
- Enable opengl_vsync and xrandr for some distributions.
+
  and frontend may need them for one reason or another
  
* Fri Sep 10 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Fri May 16 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-4
- Update to 0.16.
+
- Add BR: xorg-x11-drv-i810-devel, xorg-x11-drv-openchrome-devel
 +
- Make building with nVidia XvMC an available custom option, fix up
 +
  conflict between it and other XvMC implementations
 +
- Update release-0-21-fixes patches (r17338)
  
* Tue Aug  21 2004 Ben Stanley <bds02@uow.edu.au>
+
* Sat Apr 05 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-3
- Sub-release 75.
+
- Fix up PACKAGE-LICENSING inclusion
- Included dvb support in the build.
 
- Included .png files for html help
 
  
* Tue Jun  1 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sat Apr 05 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-2
- Add patch for gcc < 3 (Edward Rudd <eddie@omegaware.com>).
+
- RPMFusion package review cleanups
- Update to 0.15.1.
+
- Put mythtv-setup.desktop in mythtv-setup package
- Remove patch, has already been applied.
+
- Fix up initscript to start properly
- New patch from Edward.
+
- Drop unused %%ghostattr define
 +
- Attempt to clarify licensing
 +
- Clean up assorted Requires and BuildRequires
 +
- Update release-0-21-fixes patches (r16965)
  
* Thu May 27 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sun Mar 09 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-1
- Updated to 0.15.
+
- MythTV 0.21 (r16468)
 +
- Add release-0-21-fixes for DVD menu display fix (r16486)
  
* Wed May  5 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Tue Mar 04 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.17.r16394
- Use workaround for qmake project depth bug
+
- Update to latest release-0-21-fixes pre-release branch code (16394).
  (by Robert Hardy <rhardy@webcon.ca>).
 
  
* Tue Feb 17 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Fri Feb 29 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.16.r16316
- Split off mythtvsetup and the base themes into their own sub packages.
+
- Update to latest release-0-21-fixes pre-release branch code (16316).
- Make mysql.txt part of both frontend and backend.
+
- Add mythgame-emulators meta-package that requires a bunch of
- Added support for arts and dvb. arts has been enabled by default.
+
  emulators for roms mythgame knows about.
 +
- Account for python egg on f9+
 +
- Enable gsm support by default
  
* Sun Feb 1 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Wed Feb 27 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.15.r16307
- Update to 0.14.
+
- Update to latest release-0-21-fixes pre-release branch code (16307).
- Disable directfb in default build.
+
- Try to fix up a bunch of rpmlint warnings and errors.
  
* Sun Jan  4 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sat Feb 23 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.14.r16238
- Enable directfb.
+
- Update to latest svn trunk (16238).
 +
- Package up python bits.
  
* Sat Dec 20 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Thu Feb 14 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.13.r16019
- Patch for missing tvformat default (bttv always did PAL).
+
- Update to latest svn trunk (16019).
  
* Thu Dec 11 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Mon Feb 11 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.12.r15914
- Update to 0.13.
+
- Update to latest svn trunk (15914).
- Remove ringbuffer patch (applied in 0.13).
+
- Turn on multi-threaded video decoding.
  
* Tue Oct 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Thu Jan 31 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.11.r15699
- Add cvs patch fixing ringbuffer races.
+
- More spec file overhauling, make it build in Fedora 9
- Remove settings patch for alsa/lirc and make it configurable
 
  from the rpmbuild invocation instead with --with/--without switches
 
- New qmake invocation.
 
  
* Sun Oct 19 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Thu Jan 31 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.10.r15699
- Update to 0.12.
+
- Update to latest svn trunk (15699).
- Move path macros out of specfile.
+
- Misc spec reformatting.
- Remove imdb patch.
 
- Silence install/upgrade output.
 
  
* Mon Oct 13 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sat Jan 26 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.9.r15614
- Activate native alsa and lirc modes.
+
- Update to latest svn trunk (15614).
  
* Sat Sep 20 2003 "Jarod C. Wilson" <jcw@wilsonet.com>
+
* Tue Jan 01 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.8.r15281
- Added patch for imdb changes.
+
- Update to latest svn trunk (15281).
 +
- Fix up version-release insertion in mythbackend --version output
  
* Sat Aug 16 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Fri Dec 07 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.7.r15081
- Update to 0.11.
+
- Update to latest svn trunk (15081).
  
* Wed Jul  2 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Sat Nov 17 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14888
- Update to 0.10.
+
- Update to latest svn trunk (14888).
  
* Tue Jun 24 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Wed Oct 17 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14695
- Make logrotate script accept non-existing logfiles.
+
- Update to latest svn trunk (14695).
  
* Sat Jun 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Fri Oct 12 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14667
- Split off mythtv-suite.
+
- Update to latest svn trunk (14667).
 +
- Build dvb support against kernel-headers instead
 +
- Drop unnecessary patches
 +
- Tweak BR: to not use any file deps (I only care about recent distros)
 +
- Rework mythweb bits to be compliant w/Fedora packaging guidelines
 +
- Enable OpenGL video output support
 +
- Make dvb and opengl bits non-conditional (always enabled)
  
* Thu Jun 12 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Wed Oct 10 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.5.r14658
- Update to 0.9.1 release.
+
- Update to latest svn trunk (14658).
- Split /var/spool/mythtv to /var/lib/mythtv and /var/cache/mythtv.
+
- Tweak configure options a bit more
  (as Debian does).
 
  
* Tue Jun 10 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Tue Oct 02 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.4.r14589
- Update to 0.9 release.
+
- Update to latest svn trunk (14589).
 +
- Restructure how optflags are passed into build
 +
- Nuke some extra non-standard macros
 +
- Drop ancient dvb tarball, create with_dvb option, always using v4l-devel
  
* Wed May 14 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Wed Sep 12 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.4.r14488
- Fixed packaging bug in libmyth-devel.
+
- Update to latest svn trunk (14488).
  
* Tue Apr  8 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Tue Aug 28 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.3.r14346
- Rebuilt for Red Hat 9.
+
- Update to latest svn trunk (14346).
  
* Sun Mar 23 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Mon Aug 27 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.3.r14337
- Fixed desktop entries.
+
- Update to latest svn trunk (14337).
  
* Sat Mar 22 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Tue May 22 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.2.r13492
- Add g flag to sed.
+
- Update to latest svn trunk (13492).
- Don't use mythtv user yet.
+
- More non-standard macro nuking
  
* Fri Mar 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
* Mon May 21 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.1.r13487
- Add mythtv user.
+
- Update to latest svn trunk (13487).
- Add desktop entries.
+
- Reshuffle theme files
 +
- Credit where credit is due: forking this off the current ATrpms spec
 +
</pre>
  
* Wed Mar 19 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
-----
- Added start/stop scripts for mythbackend.
 
  
* Tue Mar 18 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
====build_myth.sh====
- Removed unneeded 0.7 patches.
 
  
* Mon Mar 17 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
<pre>
- Update to 0.8.
+
#!/bin/bash
- Synced with Matt Zimmerman's debian package (package splitting).
 
- Split off lib, devel, frontend, backend packages.
 
  
* Thu Feb 13 2003 Paul Jara <pjara@rogers.com>
+
#
- Added a patch that prevents a segmentation fault in mythfilldatabase.
+
# Script for building MythTV packages from an SVN checkout.
 +
#
 +
# by:  Chris Petersen <rpm@forevermore.net>
 +
#
 +
# The latest version of this file can be found at:
 +
#
 +
#    http://www.mythtv.org/wiki/index.php/Mythtv-svn-rpmbuild.spec
 +
#
 +
# This file is intended to be sourced into bash with the "." command,
 +
# not just run directly on the command line.  If you just run this as
 +
# ./build_myth.sh you will not load the installmyth function into your
 +
# environment, and will be unable to install packages should you choose
 +
# to put off doing so immediately after compiling.
 +
#
 +
# Please make sure that the rpm build parameters are to your liking (a
 +
# number of plugins are disabled by default/example in this script to
 +
# show you that the spec is capable of compiling only those plugins that
 +
# you wish to install).  The same goes for the installmyth function,
 +
# which only installs those packages which I personally use.
 +
#
 +
# I will eventually clean up this script to add parameters and make it
 +
# a little easier to configure/use.
 +
#
  
* Thu Jan 16 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
+
# A function to build mythtv
- Added dependency to qt-MySQL (Roy Stogner <roystgnr@ticam.utexas.edu>).
+
    function buildmyth {
 +
        REV="$1"
 +
        DIR=/usr/src/mythtv-svn
 +
        VERSION="0.22"
 +
    # Remove the existing libmyth-devel so it doesn't confuse qmake
 +
    # (we can't override the order of the include file path)
 +
        echo "Removing existing libmyth-devel package to avoid conflicts"
 +
        sudo rpm -e libmyth-devel
 +
    # Check out or update the svn checkout
 +
        if [ -d "$DIR" ]; then
 +
            if [ -z "$REV" -o 0"$REV" -lt 1 ]; then
 +
                echo "Updating svn checkout"
 +
                REL=`svn up "$DIR"`
 +
            else
 +
                echo "Updating svn checkout to r$REV"
 +
                REL=`svn up -r "$REV" "$DIR"`
 +
            fi
 +
        else
 +
            if [ -z "$REV" -o 0"$REV" -lt 1 ]; then
 +
                echo "Checking out mythtv-svn to $DIR"
 +
                REL=`svn co http://svn.mythtv.org/svn/trunk/ "$DIR"`
 +
            else
 +
                echo "Checking out mythtv-svn r$REV to $DIR"
 +
                REL=`svn co -r "$REV" http://svn.mythtv.org/svn/trunk/ "$DIR"`
 +
            fi
 +
        fi
 +
        if [ $? != 0 ]; then
 +
            echo "Problem with svn checkout"
 +
            return $?
 +
        fi
 +
        REL=`echo "$REL" | grep -i revision | sed -e 's/[^0-9]\\+//g'`
 +
        echo "SVN Revision $REL"
 +
    # Update SPEC
 +
        echo "Update specfile _svnver to r$REL"
 +
        sed -i \
 +
            -e "s,define _svnrev .\+,define _svnrev r$REL," \
 +
            -e "s,define branch .\+,define branch trunk,"  \
 +
            -e "s,Version:.\+,Version: $VERSION,"          \
 +
            /usr/src/redhat/SPECS/mythtv-svn.spec
 +
    # Create the appropriate tarballs
 +
        echo "Creating tarballs"
 +
        cd "$DIR"
 +
        for file in mythtv mythplugins; do
 +
            mv "$file" "$file-$VERSION"
 +
            tar jcf /usr/src/redhat/SOURCES/mythtv/$file-$VERSION.tar.bz2 --exclude .svn "$file-$VERSION"
 +
            mv "$file-$VERSION" "$file"
 +
        done
 +
        cd -
 +
    # Build
 +
#            --with debug            \
 +
        rpmbuild -bb /usr/src/redhat/SPECS/mythtv-svn.spec \
 +
            --without mytharchive  \
 +
            --without mythflix      \
 +
            --without mythgallery  \
 +
            --without mythcontrols  \
 +
            --without mythgame      \
 +
            --without mythphone    \
 +
            --without mythbrowser  \
 +
            --without mythmovies    \
 +
            --without mythnews      \
 +
            --without mythzoneminder
 +
    # Error?
 +
        if [ "$?" -ne 0 ]; then
 +
            echo "Build error."
 +
            return
 +
        fi
 +
    # Install
 +
        echo -n "Install r$REL? [n] "
 +
        read INST
 +
        if [ "$INST" = "y" -o "$INST" = "Y" -o "$INST" = "yes" ]; then
 +
            installmyth "$VERSION" "$REL"
 +
        else
 +
            echo "If you wish to install later, just run: installmyth \"$VERSION\" \"$REL\""
 +
        fi
 +
    }
  
* Thu Dec 5 2002 Axel Thimm <Axel.Thimm@ATrpms.net>
+
# A separate function to install mythtv packages, so it can be called separately
- fixed installation paths.
+
    function installmyth {
 +
        VERSION="$1"
 +
        REL="$2"
 +
        sudo rpm -Uvh --force                                                            \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-docs-$VERSION-0.1.svn.r$REL.*.rpm        \
 +
            /usr/src/redhat/RPMS/x86_64/libmyth-$VERSION-0.1.svn.r$REL.*.rpm            \
 +
            /usr/src/redhat/RPMS/x86_64/libmyth-devel-$VERSION-0.1.svn.r$REL.*.rpm      \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-base-themes-$VERSION-0.1.svn.r$REL.*.rpm \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-frontend-$VERSION-0.1.svn.r$REL.*.rpm    \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-backend-$VERSION-0.1.svn.r$REL.*.rpm      \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-setup-$VERSION-0.1.svn.r$REL.*.rpm        \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-common-$VERSION-0.1.svn.r$REL.*.rpm      \
 +
            /usr/src/redhat/RPMS/x86_64/perl-MythTV-$VERSION-0.1.svn.r$REL.*.rpm        \
 +
            /usr/src/redhat/RPMS/x86_64/python-MythTV-$VERSION-0.1.svn.r$REL.*.rpm      \
 +
            /usr/src/redhat/RPMS/x86_64/mythmusic-$VERSION-0.1.svn.r$REL.*.rpm          \
 +
            /usr/src/redhat/RPMS/x86_64/mythvideo-$VERSION-0.1.svn.r$REL.*.rpm          \
 +
            /usr/src/redhat/RPMS/x86_64/mythweather-$VERSION-0.1.svn.r$REL.*.rpm        \
 +
            /usr/src/redhat/RPMS/x86_64/mythtv-debuginfo-$VERSION-0.1.svn.r$REL.*.rpm
 +
    }
  
* Wed Nov 13 2002 Axel Thimm <Axel.Thimm@ATrpms.net>
+
# Actually build the packages.
- Initial build.
+
    buildmyth
 
</pre>
 
</pre>
  
 
[[Category:Scripts]]
 
[[Category:Scripts]]

Revision as of 00:01, 30 October 2008

This spec is for building MythTV RPM packages from a subversion checkout. It should be used along with the build_myth.sh shell script included at the bottom of this page.

This will presumably work with any version of fedora from version 5 onward, and expects that you are pulling your packages from livna/rpmfusion. If you use atrpms, you will probably need to rename a couple of the dependencies to compensate for their different naming scheme.

Please read the documentation at the top of the file before using it.

#
# Specfile for building MythPlugins RPMs from a subversion checkout.
#
# by:   Chris Petersen <rpm@forevermore.net>
#       Jarod Wilson <jarod@wilsonet.com>
#
#  Modified/Extended from the great (non-svn based) work of:
#     Axel Thimm <Axel.Thimm@ATrpms.net>
#     David Bussenschutt <buzz@oska.com>
#     and others; see changelog at bottom for details.
#
# The latest version of this file can be found at:
#
#     http://www.mythtv.org/wiki/index.php/Mythtv-svn-rpmbuild.spec
#
# Note:
#
#     This spec relies upon several files included in the RPMFusion mythtv
#     src.rpm file.  Please install it into your build tree before trying to
#     build anything with this spec.
#
# Explanation of options:
#
# --with proc_opt           Enable MythTV's optimized processor detection code
#                               and override RPM's defaults.
# --with debug              Enable debug mode
#
# The following options are disabled by default.  Use these options to enable:
#
# --with directfb           Enable directfb support
#
# The following options are enabled by default.  Use these options to disable:
#
# --without xvmcnvidia      Disable NVidia XvMC support
# --without perl            Disable building of the perl bindings
# --without python          Disable building of the python bindings
#
# # All plugins get built by default, but you can disable them as you wish:
#
# --without mytharchive
# --without mythbrowser
# --without mythcontrols
# --without mythflix
# --without mythgallery
# --without mythgame
# --without mythmovies
# --without mythmusic
# --without mythnews
# --without mythphone
# --without mythvideo
# --without mythweather
# --without mythzoneminder
# --without mythweb
#
# The following options are disabled by default.  Use these options to enable:
#
# --with festival           Enable festival/festvox support in MythPhone
#

################################################################################

# A list of which applications we want to put into the desktop menu system
%define desktop_applications mythfrontend mythtv-setup

# The vendor name we should attribute the aforementioned entries to
%define desktop_vendor  xris

# SVN Revision number and branch ID
%define _svnrev r18923
%define branch trunk

#
# Basic descriptive tags for this package:
#
Name:           mythtv
Summary:        A digital video recorder (DVR) application.
URL:            http://www.mythtv.org/
Group:          Applications/Multimedia

# Version/Release info
Version: 0.22
%if "%{branch}" == "trunk"
Release: 0.1.svn.%{_svnrev}%{?dist}
%else
Release: 1%{?dist}
%endif

# The primary license is GPLv2+, but bits are borrowed from a number of
# projects... For a breakdown of the licensing, see PACKAGE-LICENSING.
License: GPLv2+ and LGPLv2+ and LGPLv2 and (GPLv2 or QPL) and (GPLv2+ or LGPLv2+)

################################################################################

# Set "--with proc_opt" to let mythtv autodetect your CPU and run its
# processor-specific optimizations.  It seems to cause compile problems on many
# systems (particularly x86_64), so it is classified by the MythTV developers
# as "use at your own risk."
%define with_proc_opt      %{?_with_proc_opt:       1} %{!?_with_proc_opt:      0}

# Set "--with debug" to enable MythTV debug compile mode
%define with_debug         %{?_with_debug:          1} %{?!_with_debug:         0}

# The following options are enabled by default.  Use --without to disable them
%define with_perl          %{?_without_perl:        0} %{!?_without_perl:       1}
%define with_python        %{?_without_python:      0} %{!?_without_python:     1}

# The following options are disabled by default.  Use --with to enable them
%define with_directfb      %{?_with_directfb:       1} %{!?_with_directfb:      0}
%define with_xvmcnvidia    %{?_with_xvmcnvidia:     1} %{?!_with_xvmcnvidia:    0}

# All plugins get built by default, but you can disable them as you wish
%define with_mytharchive    %{?_without_mytharchive:    0} %{!?_without_mytharchive:     1}
%define with_mythbrowser    %{?_without_mythbrowser:    0} %{!?_without_mythbrowser:     1}
%define with_mythcontrols   %{?_without_mythcontrols:   0} %{!?_without_mythcontrols:    1}
%define with_mythflix       %{?_without_mythflix:       0} %{!?_without_mythflix:        1}
%define with_mythgallery    %{?_without_mythgallery:    0} %{!?_without_mythgallery:     1}
%define with_mythgame       %{?_without_mythgame:       0} %{!?_without_mythgame:        1}
%define with_mythmovies     %{?_without_mythmovies:     0} %{!?_without_mythmovies:      1}
%define with_mythmusic      %{?_without_mythmusic:      0} %{!?_without_mythmusic:       1}
%define with_mythnews       %{?_without_mythnews:       0} %{!?_without_mythnews:        1}
%define with_mythphone      %{?_without_mythphone:      0} %{!?_without_mythphone:       1}
%define with_mythvideo      %{?_without_mythvideo:      0} %{!?_without_mythvideo:       1}
%define with_mythweather    %{?_without_mythweather:    0} %{!?_without_mythweather:     1}
%define with_mythweb        %{?_without_mythweb:        0} %{!?_without_mythweb:         1}
%define with_mythzoneminder %{?_without_mythzoneminder: 0} %{!?_without_mythzoneminder:  1}

# The following plugin options are disabled by default.  Use --with to enable them

# MythPhone
%define with_festival       %{?_with_festival:      1} %{!?_with_festival:      0}

################################################################################

Source0:   http://www.mythtv.org/mc/mythtv-%{version}.tar.bz2
Source1:   http://www.mythtv.org/mc/mythplugins-%{version}.tar.bz2
Source10:  PACKAGE-LICENSING
Source101: mythbackend.sysconfig.in
Source102: mythbackend.init.in
Source103: mythbackend.logrotate.in
Source106: mythfrontend.png
Source107: mythfrontend.desktop
Source108: mythtv-setup.png
Source109: mythtv-setup.desktop
Source110: mysql.txt
Source401: mythweb.conf

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

################################################################################
# Python setup

%if %{with_python}
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_version: %define python_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0]')}
%endif

################################################################################

# Global MythTV and Shared Build Requirements

BuildRequires:  desktop-file-utils
BuildRequires:  freetype-devel >= 2
BuildRequires:  gcc-c++
BuildRequires:  mysql-devel >= 5
BuildRequires:  qt4-devel

BuildRequires:  lm_sensors-devel
BuildRequires:  lirc-devel
BuildRequires:  nasm

# X, and Xv video support
BuildRequires:  libXmu-devel
BuildRequires:  libXv-devel
BuildRequires:  libXvMC-devel
BuildRequires:  libXxf86vm-devel
BuildRequires:  mesa-libGLU-devel
BuildRequires:  xorg-x11-proto-devel
%ifarch %{ix86} x86_64
BuildRequires:  xorg-x11-drv-i810-devel
BuildRequires:  xorg-x11-drv-openchrome-devel
%endif

# OpenGL video output and vsync support
BuildRequires:  libGL-devel, libGLU-devel

# Misc A/V format support
BuildRequires:  a52dec-devel
BuildRequires:  faac-devel
BuildRequires:  faad2-devel
BuildRequires:  fftw2-devel < 3
BuildRequires:  fftw2-devel >= 2.1.3
BuildRequires:  flac-devel >= 1.0.4
BuildRequires:  gsm-devel
BuildRequires:  lame-devel
BuildRequires:  libdca-devel
BuildRequires:  libdvdcss-devel >= 1.2.7
BuildRequires:  libdvdnav-devel
BuildRequires:  libdvdread-devel >= 0.9.4
BuildRequires:  libfame-devel >= 0.9.0
BuildRequires:  libmad-devel
BuildRequires:  libogg-devel
BuildRequires:  libtheora-devel
BuildRequires:  libvorbis-devel >= 1.0
BuildRequires:  mjpegtools-devel >= 1.6.1
BuildRequires:  taglib-devel >= 1.4
BuildRequires:  transcode >= 0.6.8
BuildRequires:  x264-devel
BuildRequires:  xvidcore-devel >= 0.9.1

# Audio framework support
BuildRequires:  alsa-lib-devel
BuildRequires:  arts-devel
BuildRequires:  jack-audio-connection-kit-devel

# Need dvb headers to build in dvb support
BuildRequires: kernel-headers

# FireWire cable box support
BuildRequires:  libavc1394-devel
BuildRequires:  libiec61883-devel
BuildRequires:  libraw1394-devel

%if %{with_directfb}
BuildRequires:  directfb-devel
%endif

%if %{with_xvmcnvidia}
BuildRequires:  xorg-x11-drv-nvidia-devel
%endif

# API Build Requirements

%if %{with_perl}
BuildRequires:  perl
BuildRequires:  perl(ExtUtils::MakeMaker)
%endif

%if %{with_python}
BuildRequires:  python-devel
%endif

# Plugin Build Requirements

%if %{with_mythbrowser}
BuildRequires:  kdelibs3-devel
%endif

%if %{with_mythgallery}
BuildRequires:  libtiff-devel
BuildRequires:  libexif-devel >= 0.6.9
%endif

%if %{with_mythgame}
BuildRequires:  zlib-devel
%endif

%if %{with_mythmusic}
BuildRequires:  libcdaudio-devel >= 0.99.6
BuildRequires:  cdparanoia-devel
BuildRequires:  libvisual-devel
BuildRequires:  SDL-devel
%endif

%if %{with_mythnews}
%endif

%if %{with_mythphone}
%endif
%if 0%{?fedora} >= 9
BuildRequires: ncurses-devel
%else
BuildRequires: libtermcap-devel
%endif
%if %{with_festival}
BuildRequires:  festival-devel
%endif

%if %{with_mythvideo}
%endif

%if %{with_mythweather}
Requires:       mythweather      >= %{version}
Requires:       perl(XML::Simple)
Requires:       perl(LWP::Simple)
%endif

%if %{with_mythzoneminder}
%endif

################################################################################
# Requirements for the mythtv meta package

Requires:  libmyth            = %{version}-%{release}
Requires:  mythtv-backend     = %{version}-%{release}
Requires:  mythtv-base-themes = %{version}-%{release}
Requires:  mythtv-common      = %{version}-%{release}
Requires:  mythtv-docs        = %{version}-%{release}
Requires:  mythtv-frontend    = %{version}-%{release}
Requires:  mythtv-setup       = %{version}-%{release}
Requires:  perl-MythTV        = %{version}-%{release}
Requires:  python-MythTV      = %{version}-%{release}

Requires:  mythplugins        = %{version}-%{release}
Requires:  mythtv-themes      = %{version}

Requires:  mysql-server >= 5, mysql >= 5
# XMLTV is not yet packaged for rpmfusion
#Requires: xmltv
Requires:  wget >= 1.9.1

# faad2-devel.ppc64 is not available, so:
ExcludeArch: ppc64

# Generate the required mythtv-frontend-api version string here so we only
# have to do it once.
%define mythfeapiver %(echo %{version} | awk -F. '{print $1 "." $2}')

################################################################################

%description
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

There are also several add-ons and themes available. In order to facilitate
installations with smart/apt-get/yum and other related package
resolvers this meta-package can be used to install all in one sweep.

MythTV implements the following DVR features, and more, with a
unified graphical interface:

 - Basic 'live-tv' functionality.  Pause/Fast Forward/Rewind "live" TV.
 - Video compression using RTjpeg or MPEG-4, and support for DVB and
   hardware encoder cards/devices.
 - Program listing retrieval using XMLTV
 - Themable, semi-transparent on-screen display
 - Electronic program guide
 - Scheduled recording of TV programs
 - Resolution of conflicts between scheduled recordings
 - Basic video editing

################################################################################

%package docs
Summary: MythTV documentation
Group:   Documentation

%description docs
The MythTV documentation, contrib files, database initialization file
and miscellaneous other bits and pieces.

################################################################################

%package -n libmyth
Summary:   Library providing mythtv support.
Group:     System Environment/Libraries

Requires:  freetype >= 2
Requires:  lame
Requires:  qt4
Requires:  qt4-MySQL

%description -n libmyth
Common library code for MythTV and add-on modules (development)
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

################################################################################

%package -n libmyth-devel
Summary:   Development files for libmyth.
Group:     Development/Libraries

Requires:  libmyth = %{version}-%{release}

Requires:  freetype-devel >= 2
Requires:  mysql-devel >= 5
Requires:  qt4-devel
Requires:  lm_sensors-devel
Requires:  lirc-devel

# X, and Xv video support
Requires:  libXmu-devel
Requires:  libXv-devel
Requires:  libXvMC-devel
Requires:  libXxf86vm-devel
Requires:  mesa-libGLU-devel
Requires:  xorg-x11-proto-devel
%ifarch %{ix86} x86_64
Requires:  xorg-x11-drv-i810-devel
Requires:  xorg-x11-drv-openchrome-devel
%endif

# OpenGL video output and vsync support
Requires:  libGL-devel, libGLU-devel

# Misc A/V format support
Requires:  a52dec-devel
Requires:  faac-devel
Requires:  faad2-devel
Requires:  fftw2-devel < 3
Requires:  fftw2-devel >= 2.1.3
Requires:  flac-devel >= 1.0.4
Requires:  gsm-devel
Requires:  lame-devel
Requires:  libdca-devel
Requires:  libdvdcss-devel >= 1.2.7
Requires:  libdvdnav-devel
Requires:  libdvdread-devel >= 0.9.4
Requires:  libfame-devel >= 0.9.0
Requires:  libmad-devel
Requires:  libogg-devel
Requires:  libtheora-devel
Requires:  libvorbis-devel >= 1.0
Requires:  mjpegtools-devel >= 1.6.1
Requires:  taglib-devel >= 1.4
Requires:  transcode >= 0.6.8
Requires:  x264-devel
Requires:  xvidcore-devel >= 0.9.1

# Audio framework support
Requires:  alsa-lib-devel
Requires:  arts-devel
Requires:  jack-audio-connection-kit-devel

# Need dvb headers for dvb support
Requires:  kernel-headers

# FireWire cable box support
Requires:  libavc1394-devel
Requires:  libiec61883-devel
Requires:  libraw1394-devel

%if %{with_directfb}
Requires:  directfb-devel
%endif

%if %{with_xvmcnvidia}
Requires:  xorg-x11-drv-nvidia-devel
%endif

%description -n libmyth-devel
This package contains the header files and libraries for developing
add-ons for mythtv.

################################################################################

%package base-themes
Summary: Core user interface themes for mythtv
Group:   Applications/Multimedia

# Replace an old ATRMS package
Provides:   mythtv-theme-gant
Obsoletes:  mythtv-theme-gant

%description base-themes
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv-docs package for more information.

This package contains the base themes for the mythtv user interface.

################################################################################

%package frontend
Summary:   Client component of mythtv (a DVR)
Group:     Applications/Multimedia
Requires:  freetype, lame
Requires:  mythtv-common       = %{version}-%{release}
Requires:  mythtv-base-themes  = %{version}
Provides:  mythtv-frontend-api = %{mythfeapiver}

%description frontend
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

This package contains only the client software, which provides a
front-end for playback and configuration.  It requires access to a
mythtv-backend installation, either on the same system or one
reachable via the network.

################################################################################

%package backend
Summary:    Server component of mythtv (a DVR)
Group:      Applications/Multimedia
Requires:   lame
Requires:   mythtv-common = %{version}-%{release}
Conflicts:  xmltv-grabbers < 0.5.37

%description backend
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

This package contains only the server software, which provides video
and audio capture and encoding services.  In order to be useful, it
requires a mythtv-frontend installation, either on the same system or
one reachable via the network.

################################################################################

%package setup
Summary:   Setup the mythtv backend
Group:     Applications/Multimedia
Requires:  freetype
Requires:  mythtv-backend = %{version}-%{release}
Requires:  mythtv-base-themes = %{version}

%description setup
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

This package contains only the setup software for configuring the
mythtv backend.

################################################################################

%package common
Summary: Common components needed by multiple other MythTV components
Group: Applications/Multimedia

%description common
MythTV provides a unified graphical interface for recording and viewing
television programs.  Refer to the mythtv package for more information.

This package contains components needed by multiple other MythTV components.

################################################################################

%if %{with_perl}

%package -n perl-MythTV
Summary:        Perl bindings for MythTV
Group:          Development/Languages
# Wish we could do this:
#BuildArch:      noarch

Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires:       perl(DBD::mysql)
# Disabled because there are no RPM packages for these yet,
# and RPM doesn't seem to be picking up on CPAN versions
#Requires:       perl(Net::UPnP)
#Requires:       perl(Net::UPnP::ControlPoint)

%description -n perl-MythTV
Provides a perl-based interface to interacting with MythTV.

%endif

################################################################################

%if %{with_python}

%package -n python-MythTV
Summary:        Python bindings for MythTV
Group:          Development/Languages
# Wish we could do this:
#BuildArch:      noarch

Requires:       MySQL-python

%description -n python-MythTV
Provides a python-based interface to interacting with MythTV.

%endif

################################################################################

# Meta package for all mythtv plugins
%package -n mythplugins

Summary:  Main MythTV plugins
Group:    Applications/Multimedia

Requires:  mythmusic      = %{version}-%{release}
Requires:  mythvideo      = %{version}-%{release}
Requires:  mythweather    = %{version}-%{release}
Requires:  mythgallery    = %{version}-%{release}
Requires:  mythgame       = %{version}-%{release}
Requires:  mythnews       = %{version}-%{release}
Requires:  mythbrowser    = %{version}-%{release}
Requires:  mythphone      = %{version}-%{release}
Requires:  mythcontrols   = %{version}-%{release}
Requires:  mythflix       = %{version}-%{release}
Requires:  mytharchive    = %{version}-%{release}
Requires:  mythzoneminder = %{version}-%{release}
Requires:  mythmovies     = %{version}-%{release}
Requires:  mythweb        = %{version}-%{release}

%description -n mythplugins
This is a consolidation of all the official MythTV plugins that used to be
distributed as separate downloads from mythtv.org.

################################################################################
%if %{with_mytharchive}

%package -n mytharchive
Summary:   A module for MythTV for creating and burning DVDs
Group:     Applications/Multimedia

Requires:  mythtv-frontend-api = %{mythfeapiver}
Requires:  MySQL-python
Requires:  cdrecord >= 2.01
Requires:  dvd+rw-tools >= 5.21.4.10.8
Requires:  dvdauthor >= 0.6.11
Requires:  ffmpeg >= 0.4.9
Requires:  mjpegtools >= 1.6.2
Requires:  mkisofs >= 2.01
Requires:  python >= 2.3.5
Requires:  python-imaging
Requires:  transcode >= 1.0.2

%description -n mytharchive
MythArchive is a new plugin for MythTV that lets you create DVDs from
your recorded shows, MythVideo files and any video files available on
your system.

%endif
################################################################################
%if %{with_mythbrowser}

%package -n mythbrowser
Summary:   A small web browser module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythbrowser
MythBrowser is a full fledged web-browser (multiple tabs) to display
webpages in full-screen mode. Simple page navigation is possible.
Starting with version 0.13 it also has full support for mouse driven
navigation (right mouse opens and clos es the popup menu).

MythBrowser also contains a BookmarkManager to manage the website
links in a simple mythplugin.

%endif
################################################################################
%if %{with_mythcontrols}

%package -n mythcontrols
Summary:   A key bindings editor for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythcontrols
MythControls is a key bindings editor for MythTV.

%endif
################################################################################
%if %{with_mythflix}

%package -n mythflix
Summary:   A NetFlix module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythflix
MythFlix is a NetFlix queue manager for MythTV.

%endif
################################################################################
%if %{with_mythgallery}

%package -n mythgallery
Summary:   A gallery/slideshow module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythgallery
A gallery/slideshow module for MythTV.

%endif
################################################################################
%if %{with_mythgame}

%package -n mythgame
Summary:   A game frontend (xmame, nes, snes, pc) for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythgame
A game frontend (xmame, nes, snes, pc) for MythTV.

################################################################################
%package -n mythgame-emulators
Summary:   Meta-package requiring emulators for game types mythgame knows about
Group:     Applications/Multimedia
Requires:  mythgame = %{version}-%{release}
# Multi Arcade Machine Emulator, Amiga, Atari 2600
Requires:  sdlmame
Requires:  e-uae
Requires:  stella
# Nintendo, Super Nintendo, Nintendo 64
Requires:  fceultra
Requires:  zsnes
Requires:  mupen64, mupen64-ricevideo
# Sega Genesis, Sega Master System, Game Gear
Requires:  gens
Requires:  dega-sdl
Requires:  osmose
# TurboGraphx 16 (and others)
Requires:  mednafen

%description -n mythgame-emulators
Meta-package requiring emulators for game types mythgame knows about.

%endif
################################################################################
%if %{with_mythmovies}

%package -n mythmovies
Summary:   A module for MythTV for providing local show times and cinema listings
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythmovies
MythZoneMinder is a plugin to provide show times and cinema listings
based on Zip/Post code and a given radius. It uses external scripts to
grab times and so can be used in any country so long as a script is
written for a local data source. It ships with a grabber for the USA
which uses the ignyte website.

%endif
################################################################################
%if %{with_mythmusic}

%package -n mythmusic
Summary:   The music player add-on module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythmusic
Music add-on for mythtv.

%endif
################################################################################
%if %{with_mythnews}

%package -n mythnews
Summary:   An RSS news feed plugin for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythnews
An RSS news feed reader plugin for MythTV.

%endif
################################################################################
%if %{with_mythphone}

%package -n mythphone
Summary:   A video conferencing module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythphone
Mythphone is a phone and videophone capability on MYTH using the
standard SIP protocol.  It is compatible with Microsoft XP Messenger
and with SIP Service Providers such as Free World Dialup
(fwd.pulver.com).

%endif
################################################################################
%if %{with_mythvideo}

%package -n mythvideo
Summary:   A generic video player frontend module for MythTV
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}
Requires:  mplayer
Requires:  transcode >= 0.6.8

Provides:  mythdvd = %{version}-%{release}
Obsoletes: mythdvd < %{version}-%{release}

%description -n mythvideo
MythVideo is a MythTV module that allows you to play videos, DVDs and
(optionally) VCDs. It can also be configured to let you rip DVDs and
transcode their video and audio content to other (generally smaller)
formats. The player can either use the MythTV internal software (which
now supports DVD menus), or simply to invoke your favorite DVD/XVCD
playing software (mplayer, ogle, xine, etc) as an external
command. The transcoding is based on and derived from the excellent
transcode package.

%endif
################################################################################
%if %{with_mythweather}

%package -n mythweather
Summary:   A MythTV module that displays a weather forcast
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}
Requires:  perl(XML::SAX::Base)

%description -n mythweather
A MythTV module that displays a weather forcast.

%endif
################################################################################
%if %{with_mythweb}

%package -n mythweb
Summary:   The web interface to MythTV
Group:     Applications/Multimedia
Requires:  httpd >= 1.3.26
Requires:  php >= 5.1
Requires:  php-mysql

%description -n mythweb
The web interface to MythTV.

%endif
################################################################################
%if %{with_mythzoneminder}

%package -n mythzoneminder
Summary:   A module for MythTV for camera security and surveillance
Group:     Applications/Multimedia
Requires:  mythtv-frontend-api = %{mythfeapiver}

%description -n mythzoneminder
MythZoneMinder is a plugin to interface to some of the features of
ZoneMinder. You can use it to view a status window similar to the
console window in ZM. Also there are screens to view live camera shots
and replay recorded events.

%endif
################################################################################

%prep
%setup -q -c -a 1

# Replace static lib paths with %{_lib} so we build properly on x86_64
# systems, where the libs are actually in lib64.
    if [ "%{_lib}" != "lib" ]; then
        grep -rlZ /lib/   . | xargs -r0 sed -i -e 's,/lib/,/%{_lib}/,g'
        grep -rlZ /lib$   . | xargs -r0 sed -i -e 's,/lib$,/%{_lib},'
        grep -rlZ '/lib ' . | xargs -r0 sed -i -e 's,/lib ,/%{_lib} ,g'
    fi

##### MythTV

cd mythtv-%{version}

# Drop execute permissions on contrib bits, since they'll be %doc
    find contrib/ -type f -exec chmod -x "{}" \;

# Nuke Windows and Mac OS X build scripts
    rm -rf contrib/Win32 contrib/OSX

# Put perl bits in the right place and set opt flags
    sed -i -e 's#perl Makefile.PL#%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"#' \
        bindings/perl/perl.pro

# Install other source files, and fix pathnames
    cp -a %{SOURCE10} %{SOURCE101} %{SOURCE102} %{SOURCE103} .
    cp -a %{SOURCE106} %{SOURCE107} %{SOURCE108} %{SOURCE109} .
    for file in mythbackend.init \
                mythbackend.sysconfig \
                mythbackend.logrotate; do
        sed -e's|@logdir@|%{_localstatedir}/log|g' \
            -e's|@rundir@|%{_localstatedir}/run|g' \
            -e's|@sysconfdir@|%{_sysconfdir}|g' \
            -e's|@sysconfigdir@|%{_sysconfdir}/sysconfig|g' \
            -e's|@initdir@|%{_sysconfdir}/init.d|g' \
            -e's|@bindir@|%{_bindir}|g' \
            -e's|@sbindir@|%{_sbindir}|g' \
            -e's|@subsysdir@|%{_localstatedir}/lock/subsys|g' \
            -e's|@varlibdir@|%{_localstatedir}/lib|g' \
            -e's|@varcachedir@|%{_localstatedir}/cache|g' \
            -e's|@logrotatedir@|%{_sysconfdir}/logrotate.d|g' \
            < $file.in > $file
    done

# Prevent all of those nasty installs to ../../../../../bin/whatever
#    echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
#    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
#    chmod 644 settings.pro

# We also need Xv libs to build XvMCNVIDIA
    sed -i -e 's,VENDOR_XVMC_LIBS="-lXvMCNVIDIA",VENDOR_XVMC_LIBS="-lXvMCNVIDIA -lXv",' configure

# On to mythplugins
    cd ..

##### MythPlugins

cd mythplugins-%{version}

# Fix /mnt/store -> /var/lib/mythmusic
    cd mythmusic
    sed -i -e's,/mnt/store/music,%{_localstatedir}/lib/mythmusic,' mythmusic/globalsettings.cpp
    cd ..

# Fix /mnt/store -> /var/lib/mythvideo
    cd mythvideo
    sed -i -e 's,/share/Movies/dvd,%{_localstatedir}/lib/mythvideo,' mythvideo/globalsettings.cpp
    cd ..

# Fix up permissions for MythWeb
    cd mythweb
    chmod -R g-w ./*
    cd ..

# Prevent all of those nasty installs to ../../../../../bin/whatever
#    echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
#    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
#    chmod 644 settings.pro

# And back to the compile root
    cd ..

################################################################################

%build

# First, we build MythTV
cd mythtv-%{version}

# Similar to 'percent' configure, but without {_target_platform} and
# {_exec_prefix} etc... MythTV no longer accepts the parameters that the
# configure macro passes, so we do this manually.
./configure \
    --prefix=%{_prefix}                         \
    --libdir=%{_libdir}                         \
    --libdir-name=%{_lib}                       \
    --mandir=%{_mandir}                         \
--disable-iptv \
    --enable-pthreads                           \
    --enable-ffmpeg-pthreads                    \
    --enable-joystick-menu                      \
    --enable-audio-arts                         \
    --enable-audio-alsa                         \
    --enable-audio-oss                          \
    --enable-audio-jack                         \
    --enable-x11 --x11-path=%{_includedir}      \
    --enable-xv                                 \
    --enable-xvmc-vld --enable-xvmc-pro         \
    --enable-opengl-video --enable-opengl-vsync \
    --enable-xrandr                             \
    --enable-lirc                               \
    --enable-ivtv                               \
    --enable-firewire                           \
    --enable-dvb                                \
    --enable-libfaac                            \
    --enable-libfaad --enable-libfaad --enable-libfaadbin \
    --enable-liba52                             \
    --enable-libmp3lame                         \
    --enable-libtheora --enable-libvorbis       \
    --enable-libxvid                            \
%if %{with_xvmcnvidia}
    --xvmc-lib=XvMCNVIDIA_dynamic               \
    --enable-xvmc-opengl                        \
%else
    --disable-xvmc-opengl                       \
%endif
%if %{with_directfb}
    --enable-directfb                           \
%else
    --disable-directfb                          \
%endif
%if !%{with_perl}
    --without-bindings=perl                     \
%endif
%if !%{with_python}
    --without-bindings=python                   \
%endif
%ifarch ppc
    --extra-cflags="%{optflags} -maltivec -fomit-frame-pointer" \
    --extra-cxxflags="%{optflags} -maltivec -fomit-frame-pointer" \
%else
    --extra-cflags="%{optflags} -fomit-frame-pointer" \
    --extra-cxxflags="%{optflags} -fomit-frame-pointer" \
%endif
%ifarch %{ix86}
    --cpu=i686 --tune=i686 --enable-mmx \
%endif
%if %{with_proc_opt}
    --enable-proc-opt \
%endif
%if %{with_debug}
    --compile-type=debug                        \
%else
    --compile-type=release                      \
%endif
    --enable-debug
###    --enable-libx264                            \

# Insert rpm version-release for mythbackend --version output
    find . -name version.pro -exec sed -i -e 's,svnversion \$\${SVNTREEDIR},echo "%{version}-%{release}",g' {} \;

# Make
    make %{?_smp_mflags}

# Prepare to build the plugins
    cd ..
    mkdir temp
    temp=`pwd`/temp
    make -C mythtv-%{version} install INSTALL_ROOT=$temp
    export LD_LIBRARY_PATH=$temp%{_libdir}:$LD_LIBRARY_PATH

# Next, we build the plugins
cd mythplugins-%{version}

# Fix things up so they can find our "temp" install location for libmyth
    echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
    find . -name \*.pro \
        -exec sed -i -e "s,INCLUDEPATH += .\+/include/mythtv,INCLUDEPATH += $temp%{_includedir}/mythtv," {} \; \
        -exec sed -i -e "s,TARGETDEPS += \$\${LIBDIR}/libmyth,TARGETDEPS += $temp%{_libdir}/libmyth," {} \; \
        -exec sed -i -e "s,\$\${PREFIX}/include/mythtv,$temp%{_includedir}/mythtv," {} \;
    echo "INCLUDEPATH -= \$\${PREFIX}/include" >> settings.pro
    echo "INCLUDEPATH -= %{_includedir}"       >> settings.pro
    echo "INCLUDEPATH += $temp%{_includedir}"  >> settings.pro
    echo "INCLUDEPATH += %{_includedir}"       >> settings.pro
    echo "LIBS *= -L$temp%{_libdir}"           >> settings.pro
    echo "QMAKE_LIBDIR += $temp%{_libdir}"     >> targetdep.pro

    ./configure \
        --prefix=${temp}%{_prefix} \
        --libdir=%{_libdir} \
        --libdir-name=%{_lib} \
    %if %{with_mytharchive}
        --enable-mytharchive \
        --enable-create-dvd \
        --enable-create-archive \
    %else
        --disable-mytharchive \
    %endif
    %if %{with_mythbrowser}
        --enable-mythbrowser \
    %else
        --disable-mythbrowser \
    %endif
    %if %{with_mythcontrols}
        --enable-mythcontrols \
    %else
        --disable-mythcontrols \
    %endif
    %if %{with_mythflix}
        --enable-mythflix \
    %else
        --disable-mythflix \
    %endif
    %if %{with_mythgallery}
        --enable-mythgallery \
        --enable-exif \
        --enable-new-exif \
    %else
        --disable-mythgallery \
    %endif
    %if %{with_mythgame}
        --enable-mythgame \
    %else
        --disable-mythgame \
    %endif
    %if %{with_mythmovies}
        --enable-mythmovies \
    %else
        --disable-mythmovies \
    %endif
    %if %{with_mythmusic}
        --enable-mythmusic \
    %else
        --disable-mythmusic \
    %endif
    %if %{with_mythnews}
        --enable-mythnews \
    %else
        --disable-mythnews \
    %endif
    %if %{with_mythphone}
        --enable-mythphone \
    %else
        --disable-mythphone \
    %endif
    %if %{with_mythvideo}
        --enable-mythvideo \
        --enable-transcode \
        --enable-vcd \
    %else
        --disable-mythvideo \
    %endif
    %if %{with_mythweather}
        --enable-mythweather \
    %else
        --disable-mythweather \
    %endif
    %if %{with_mythweb}
        --enable-mythweb \
    %else
        --disable-mythweb \
    %endif
    %if %{with_mythzoneminder}
        --enable-mythzoneminder \
    %else
        --disable-mythzoneminder \
    %endif
    %if %{with_festival}
        --enable-festival \
    %else
        --disable-festival \
    %endif
        --enable-opengl \
        --enable-libvisual \
        --enable-fftw \
        --enable-sdl \
        --enable-aac

    make %{?_smp_mflags}

    cd ..


################################################################################

%install

# Clean
    rm -rf %{buildroot}

# First, install MythTV
cd mythtv-%{version}

    make install INSTALL_ROOT=%{buildroot}

    ln -s mythtv-setup %{buildroot}%{_bindir}/mythtvsetup
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythtv
    mkdir -p %{buildroot}%{_localstatedir}/cache/mythtv
    mkdir -p %{buildroot}%{_localstatedir}/log/mythtv
    mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
    mkdir -p %{buildroot}%{_sysconfdir}/init.d
    mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
    mkdir -p %{buildroot}%{_sysconfdir}/mythtv

# Fix permissions on executable python bindings
    chmod +x %{buildroot}%{python_sitelib}/MythTV/Myth{DB,TV}.py

# mysql.txt and other config/init files
    install -m 644 %{SOURCE110} %{buildroot}%{_sysconfdir}/mythtv/
    echo "# to be filled in by mythtv-setup" > %{buildroot}%{_sysconfdir}/mythtv/config.xml
    install -p -m 755 mythbackend.init %{buildroot}%{_sysconfdir}/init.d/mythbackend
    install -p -m 644 mythbackend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mythbackend
    install -p -m 644 mythbackend.logrotate  %{buildroot}%{_sysconfdir}/logrotate.d/mythbackend

# Desktop entries
    mkdir -p %{buildroot}%{_datadir}/pixmaps
    mkdir -p %{buildroot}%{_datadir}/applications
    for file in %{desktop_applications}; do
      install -p $file.png %{buildroot}%{_datadir}/pixmaps/$file.png
      desktop-file-install --vendor %{desktop_vendor} \
        --dir %{buildroot}%{_datadir}/applications    \
        --add-category X-Fedora-Extra     \
        --add-category Application        \
        --add-category AudioVideo         \
        $file.desktop
    done

    mkdir -p %{buildroot}%{_libdir}/mythtv/plugins

    mkdir -p %{buildroot}%{_datadir}/mythtv/build/
    install -p -m 644 settings.pro %{buildroot}%{_datadir}/mythtv/build/

    cd ..

# MythPlugins
cd mythplugins-%{version}

    make install INSTALL_ROOT=%{buildroot}

%if %{with_mythmusic}
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythmusic
%endif
%if %{with_mythvideo}
    mkdir -p %{buildroot}%{_localstatedir}/lib/mythvideo
%endif
%if %{with_mythgallery}
    mkdir -p %{buildroot}%{_localstatedir}/lib/pictures
%endif
%if %{with_mythgame}
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/nes/{roms,screens}
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/snes/{roms,screens}
#   mkdir -p %{buildroot}%{_datadir}/mythtv/games/mame/{roms,screens,flyers,cabs}
    mkdir -p %{buildroot}%{_datadir}/mythtv/games/PC/screens
    mkdir -p %{buildroot}%{_datadir}/mame
    ln -s ../../mame %{buildroot}%{_datadir}/mythtv/games/xmame
    mkdir -p %{buildroot}%{_datadir}/mame/flyers
    ln -s snap %{buildroot}%{_datadir}/mythtv/games/xmame/screens
    mkdir -p %{buildroot}%{_sysconfdir}/mythgame
    cp -a mythgame/gamelist.xml %{buildroot}%{_sysconfdir}/mythgame/
    ln -s ../../../../../%{_sysconfdir}/mythgame/ \
        %{buildroot}%{_datadir}/mythtv/games/PC/gamelist.xml
%endif

%if %{with_mythweb}
    cd mythweb
    mkdir -p %{buildroot}%{_datadir}/mythweb
    cp -a * %{buildroot}%{_datadir}/mythweb/
    mkdir -p %{buildroot}%{_datadir}/mythweb/{image_cache,php_sessions}
# fix up permissions
    chmod -R g-x %{buildroot}%{_datadir}/mythweb

    mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
    cp %{SOURCE401} %{buildroot}%{_sysconfdir}/httpd/conf.d/
# drop .htaccess file, settings handled in the above
    rm -f %{buildroot}%{_datadir}/mythweb/data/.htaccess
    cd ..
%endif

# And back to the build/install root
    cd ..

################################################################################

%clean
rm -rf %{buildroot}

################################################################################

%pre
# Add the "mythtv" user
/usr/sbin/useradd -c "mythtvbackend User" \
    -s /sbin/nologin -r -d %{_varlibdir}/mythtv mythtv 2> /dev/null || :

%post

%post -n libmyth -p /sbin/ldconfig

%postun -n libmyth -p /sbin/ldconfig

%post backend
/sbin/chkconfig --add mythbackend

%preun backend
if [ $1 = 0 ]; then
    /sbin/service mythbackend stop > /dev/null 2>&1
    /sbin/chkconfig --del mythbackend
fi

################################################################################

%files
%defattr(-,root,root,-)

%files docs
%defattr(-,root,root,-)
%doc mythtv-%{version}/README* mythtv-%{version}/UPGRADING
%doc mythtv-%{version}/AUTHORS mythtv-%{version}/COPYING mythtv-%{version}/FAQ
%doc mythtv-%{version}/database mythtv-%{version}/keys.txt
%doc mythtv-%{version}/docs/*.html mythtv-%{version}/docs/*.png
%doc mythtv-%{version}/docs/*.txt mythtv-%{version}/contrib
%doc mythtv-%{version}/PACKAGE-LICENSING

%files common
%defattr(-,root,root,-)
%dir %{_sysconfdir}/mythtv
%config(noreplace) %{_sysconfdir}/mythtv/mysql.txt
%config(noreplace) %{_sysconfdir}/mythtv/config.xml
%{_bindir}/mythcommflag
%{_bindir}/mythtranscode
%{_datadir}/mythtv/mythconverg*.pl

%files backend
%defattr(-,root,root,-)
%{_bindir}/mythbackend
%{_bindir}/mythfilldatabase
%{_bindir}/mythjobqueue
%{_bindir}/mythreplex
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/lib/mythtv
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/cache/mythtv
%{_sysconfdir}/init.d/mythbackend
%config(noreplace) %{_sysconfdir}/sysconfig/mythbackend
%config(noreplace) %{_sysconfdir}/logrotate.d/mythbackend
%attr(-,mythtv,mythtv) %dir %{_localstatedir}/log/mythtv

%files setup
%defattr(-,root,root,-)
%{_bindir}/mythtv-setup
%{_bindir}/mythtvsetup
%{_datadir}/mythtv/setup.xml
%{_datadir}/applications/*mythtv-setup.desktop

%files frontend
%defattr(-,root,root,-)
%{_datadir}/mythtv/CDS_scpd.xml
%{_datadir}/mythtv/CMGR_scpd.xml
%{_datadir}/mythtv/MFEXML_scpd.xml
%{_datadir}/mythtv/MSRR_scpd.xml
%{_datadir}/mythtv/devicemaster.xml
%{_datadir}/mythtv/deviceslave.xml
%{_datadir}/mythtv/info_menu.xml
%{_datadir}/mythtv/info_settings.xml
%{_datadir}/mythtv/library.xml
%{_datadir}/mythtv/main_settings.xml
%{_datadir}/mythtv/mainmenu.xml
%{_datadir}/mythtv/manage_recordings.xml
%{_datadir}/mythtv/media_settings.xml
%{_datadir}/mythtv/optical_menu.xml
%{_datadir}/mythtv/recpriorities_settings.xml
%{_datadir}/mythtv/setup.xml
%{_datadir}/mythtv/tv_lists.xml
%{_datadir}/mythtv/tv_schedule.xml
%{_datadir}/mythtv/tv_search.xml
%{_datadir}/mythtv/tv_settings.xml
%{_datadir}/mythtv/tvmenu.xml
%{_datadir}/mythtv/util_menu.xml
%{_bindir}/mythfrontend
%{_bindir}/mythtv
%{_bindir}/mythtvosd
%{_bindir}/mythlcdserver
%{_bindir}/mythshutdown
%{_bindir}/mythwelcome
%{_libdir}/mythtv/filters
%dir %{_libdir}/mythtv/plugins
%{_datadir}/mythtv/*.ttf
%dir %{_datadir}/mythtv/i18n
%{_datadir}/mythtv/i18n/mythfrontend_*.qm
%{_datadir}/applications/*mythfrontend.desktop
%{_datadir}/pixmaps/myth*.png

%files base-themes
%defattr(-,root,root,-)
%dir %{_datadir}/mythtv/themes
%{_datadir}/mythtv/themes/*

%files -n libmyth
%defattr(-,root,root,-)
%{_libdir}/*.so.*

%files -n libmyth-devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so
%exclude %{_libdir}/*.a
%{_datadir}/mythtv/build/settings.pro

%files -n mythplugins
%defattr(-,root,root,-)
%doc mythplugins-%{version}/COPYING

%if %{with_perl}
%files -n perl-MythTV
%defattr(-,root,root,-)
%{perl_vendorlib}/MythTV.pm
%dir %{perl_vendorlib}/MythTV
%{perl_vendorlib}/MythTV/*.pm
%{perl_vendorlib}/IO/Socket/INET/MythTV.pm
%exclude %{perl_vendorarch}/auto/MythTV/.packlist
%endif

%if %{with_python}
%files -n python-MythTV
%defattr(-,root,root,-)
%dir %{python_sitelib}/MythTV/
%{python_sitelib}/MythTV/*
%if 0%{?fedora} >= 9
%{python_sitelib}/MythTV-*.egg-info
%endif
%endif

%if %{with_mytharchive}
%files -n mytharchive
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mytharchive/AUTHORS
%doc mythplugins-%{version}/mytharchive/COPYING
%doc mythplugins-%{version}/mytharchive/README
%doc mythplugins-%{version}/mytharchive/TODO
%{_bindir}/mytharchivehelper
%{_libdir}/mythtv/plugins/libmytharchive.so
%{_datadir}/mythtv/archiveformat.xml
%{_datadir}/mythtv/archivemenu.xml
%{_datadir}/mythtv/archiveutils.xml
%{_datadir}/mythtv/mytharchive
%{_datadir}/mythtv/i18n/mytharchive_*.qm
%endif

%if %{with_mythbrowser}
%files -n mythbrowser
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythbrowser/AUTHORS
%doc mythplugins-%{version}/mythbrowser/COPYING
%doc mythplugins-%{version}/mythbrowser/README
%{_bindir}/mythbrowser
%{_libdir}/mythtv/plugins/libmythbookmarkmanager.so
%{_datadir}/mythtv/i18n/mythbrowser_*.qm
%endif

%if %{with_mythcontrols}
%files -n mythcontrols
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythcontrols/AUTHORS
%doc mythplugins-%{version}/mythcontrols/COPYING
%doc mythplugins-%{version}/mythcontrols/README
%doc mythplugins-%{version}/mythcontrols/TODO
%{_libdir}/mythtv/plugins/libmythcontrols.so
%{_datadir}/mythtv/i18n/mythcontrols_*.qm
%endif

%if %{with_mythflix}
%files -n mythflix
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythflix/AUTHORS
%doc mythplugins-%{version}/mythflix/COPYING
%doc mythplugins-%{version}/mythflix/README
%{_libdir}/mythtv/plugins/libmythflix.so
%{_datadir}/mythtv/mythflix
%{_datadir}/mythtv/i18n/mythflix_*.qm
%{_datadir}/mythtv/i18n/mythflix_*.ts
%{_datadir}/mythtv/netflix_menu.xml
%endif

%if %{with_mythgallery}
%files -n mythgallery
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythgallery/AUTHORS
%doc mythplugins-%{version}/mythgallery/COPYING
%doc mythplugins-%{version}/mythgallery/README
%{_libdir}/mythtv/plugins/libmythgallery.so
%{_datadir}/mythtv/i18n/mythgallery_*.qm
%{_localstatedir}/lib/pictures
%endif

%if %{with_mythgame}
%files -n mythgame
%defattr(-,root,root,-)
%dir %{_sysconfdir}/mythgame
%config(noreplace) %{_sysconfdir}/mythgame/gamelist.xml
%{_libdir}/mythtv/plugins/libmythgame.so
%{_datadir}/mythtv/games
%exclude %{_datadir}/mythtv/games/xmame
%{_datadir}/mythtv/game_settings.xml
%{_datadir}/mythtv/i18n/mythgame_*.qm

%files -n mythgame-emulators
%defattr(-,root,root,-)
%{_datadir}/mythtv/games/xmame
%{_datadir}/mame/screens
%{_datadir}/mame/flyers
%endif

%if %{with_mythmovies}
%files -n mythmovies
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythmovies/COPYING
%doc mythplugins-%{version}/mythmovies/README
%doc mythplugins-%{version}/mythmovies/TODO
%{_bindir}/ignyte
%{_datadir}/mythtv/themes/default/movies-ui.xml
%{_libdir}/mythtv/plugins/libmythmovies.so
%endif

%if %{with_mythmusic}
%files -n mythmusic
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythmusic/AUTHORS
%doc mythplugins-%{version}/mythmusic/COPYING
%doc mythplugins-%{version}/mythmusic/README
%{_libdir}/mythtv/plugins/libmythmusic.so
%{_localstatedir}/lib/mythmusic
%{_datadir}/mythtv/musicmenu.xml
%{_datadir}/mythtv/music_settings.xml
%{_datadir}/mythtv/MXML_scpd.xml
%{_datadir}/mythtv/i18n/mythmusic_*.qm
%endif

%if %{with_mythnews}
%files -n mythnews
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythnews/AUTHORS
%doc mythplugins-%{version}/mythnews/COPYING
%doc mythplugins-%{version}/mythnews/README
%{_libdir}/mythtv/plugins/libmythnews.so
%{_datadir}/mythtv/mythnews
%{_datadir}/mythtv/i18n/mythnews_*.qm
%endif

%if %{with_mythphone}
%files -n mythphone
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythphone/AUTHORS
%doc mythplugins-%{version}/mythphone/COPYING
%doc mythplugins-%{version}/mythphone/README
%doc mythplugins-%{version}/mythphone/TODO
%{_libdir}/mythtv/plugins/libmythphone.so
%{_datadir}/mythtv/i18n/mythphone_*.qm
%endif

%if %{with_mythvideo}
%files -n mythvideo
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythvideo/COPYING
%doc mythplugins-%{version}/mythvideo/README*
%{_libdir}/mythtv/plugins/libmythvideo.so
%{_datadir}/mythtv/mythvideo
%{_datadir}/mythtv/i18n/mythvideo_*.qm
%{_datadir}/mythtv/video_settings.xml
%{_datadir}/mythtv/videomenu.xml
%{_localstatedir}/lib/mythvideo
%{_bindir}/mtd
%endif

%if %{with_mythweather}
%files -n mythweather
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythweather/AUTHORS
%doc mythplugins-%{version}/mythweather/COPYING
%doc mythplugins-%{version}/mythweather/README
%{_libdir}/mythtv/plugins/libmythweather.so
%{_datadir}/mythtv/i18n/mythweather_*.qm
%{_datadir}/mythtv/weather_settings.xml
%{_datadir}/mythtv/mythweather
%endif

%if %{with_mythweb}
%files -n mythweb
%defattr(-,root,root,-)
%doc mythplugins-%{version}/mythweb/README
%config(noreplace) %{_sysconfdir}/httpd/conf.d/mythweb.conf
%defattr(-,apache,apache,0775)
%dir %{_datadir}/mythweb
%{_datadir}/mythweb/*
%endif

%if %{with_mythzoneminder}
%files -n mythzoneminder
%defattr(-,root,root,-)
%{_libdir}/mythtv/plugins/libmythzoneminder.so
%{_datadir}/mythtv/zonemindermenu.xml
%{_bindir}/mythzmserver
%endif

################################################################################

%changelog

* Tue Oct 28 2008 Chris Petersen <rpm@forevermore.net> 0.22-0.1.svn
- Update to compile for pre-0.22 svn trunk, including new files and qt4 deps
- Major cleanup and porting from my personal spec (which was a combination
  of works from atrpms and some of Jarod's earlier works).
- Add a few more --with and --without options, including the ability to
  disable specific mythplugins.

* Wed Sep 10 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.21-8
- rebuild for new libraw1394

* Sun Jul 20 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-7
- Disable XvMC VLD and Pro support on ppc due to lack of
  openchrome driver.

* Sat Jul 19 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-6
- Fix spec typo
- Disable mythstream patch for now, too much fuzz, revisit later

* Fri Jul 18 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-5
- Update release-0-21-fixes patches (r17859)
- Don't use %%bcond, breaks on some older buildsystems
- Put several bits in -common sub-package, as both backend
  and frontend may need them for one reason or another

* Fri May 16 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-4
- Add BR: xorg-x11-drv-i810-devel, xorg-x11-drv-openchrome-devel
- Make building with nVidia XvMC an available custom option, fix up
  conflict between it and other XvMC implementations
- Update release-0-21-fixes patches (r17338)

* Sat Apr 05 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-3
- Fix up PACKAGE-LICENSING inclusion

* Sat Apr 05 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-2
- RPMFusion package review cleanups
- Put mythtv-setup.desktop in mythtv-setup package
- Fix up initscript to start properly
- Drop unused %%ghostattr define
- Attempt to clarify licensing
- Clean up assorted Requires and BuildRequires
- Update release-0-21-fixes patches (r16965)

* Sun Mar 09 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-1
- MythTV 0.21 (r16468)
- Add release-0-21-fixes for DVD menu display fix (r16486)

* Tue Mar 04 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.17.r16394
- Update to latest release-0-21-fixes pre-release branch code (16394).

* Fri Feb 29 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.16.r16316
- Update to latest release-0-21-fixes pre-release branch code (16316).
- Add mythgame-emulators meta-package that requires a bunch of
  emulators for roms mythgame knows about.
- Account for python egg on f9+
- Enable gsm support by default

* Wed Feb 27 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.15.r16307
- Update to latest release-0-21-fixes pre-release branch code (16307).
- Try to fix up a bunch of rpmlint warnings and errors.

* Sat Feb 23 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.14.r16238
- Update to latest svn trunk (16238).
- Package up python bits.

* Thu Feb 14 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.13.r16019
- Update to latest svn trunk (16019).

* Mon Feb 11 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.12.r15914
- Update to latest svn trunk (15914).
- Turn on multi-threaded video decoding.

* Thu Jan 31 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.11.r15699
- More spec file overhauling, make it build in Fedora 9

* Thu Jan 31 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.10.r15699
- Update to latest svn trunk (15699).
- Misc spec reformatting.

* Sat Jan 26 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.9.r15614
- Update to latest svn trunk (15614).

* Tue Jan 01 2008 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.8.r15281
- Update to latest svn trunk (15281).
- Fix up version-release insertion in mythbackend --version output

* Fri Dec 07 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.7.r15081
- Update to latest svn trunk (15081).

* Sat Nov 17 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14888
- Update to latest svn trunk (14888).

* Wed Oct 17 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14695
- Update to latest svn trunk (14695).

* Fri Oct 12 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.6.r14667
- Update to latest svn trunk (14667).
- Build dvb support against kernel-headers instead
- Drop unnecessary patches
- Tweak BR: to not use any file deps (I only care about recent distros)
- Rework mythweb bits to be compliant w/Fedora packaging guidelines
- Enable OpenGL video output support
- Make dvb and opengl bits non-conditional (always enabled)

* Wed Oct 10 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.5.r14658
- Update to latest svn trunk (14658).
- Tweak configure options a bit more

* Tue Oct 02 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.4.r14589
- Update to latest svn trunk (14589).
- Restructure how optflags are passed into build
- Nuke some extra non-standard macros
- Drop ancient dvb tarball, create with_dvb option, always using v4l-devel

* Wed Sep 12 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.4.r14488
- Update to latest svn trunk (14488).

* Tue Aug 28 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.3.r14346
- Update to latest svn trunk (14346).

* Mon Aug 27 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.3.r14337
- Update to latest svn trunk (14337).

* Tue May 22 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.2.r13492
- Update to latest svn trunk (13492).
- More non-standard macro nuking

* Mon May 21 2007 Jarod Wilson <jarod@wilsonet.com> - 0.21-0.1.r13487
- Update to latest svn trunk (13487).
- Reshuffle theme files
- Credit where credit is due: forking this off the current ATrpms spec

build_myth.sh

#!/bin/bash

#
# Script for building MythTV packages from an SVN checkout.
#
# by:   Chris Petersen <rpm@forevermore.net>
#
# The latest version of this file can be found at:
#
#     http://www.mythtv.org/wiki/index.php/Mythtv-svn-rpmbuild.spec
#
# This file is intended to be sourced into bash with the "." command,
# not just run directly on the command line.  If you just run this as
# ./build_myth.sh you will not load the installmyth function into your
# environment, and will be unable to install packages should you choose
# to put off doing so immediately after compiling.
#
# Please make sure that the rpm build parameters are to your liking (a
# number of plugins are disabled by default/example in this script to
# show you that the spec is capable of compiling only those plugins that
# you wish to install).  The same goes for the installmyth function,
# which only installs those packages which I personally use.
# 
# I will eventually clean up this script to add parameters and make it
# a little easier to configure/use.
#

# A function to build mythtv
    function buildmyth {
        REV="$1"
        DIR=/usr/src/mythtv-svn
        VERSION="0.22"
    # Remove the existing libmyth-devel so it doesn't confuse qmake
    # (we can't override the order of the include file path)
        echo "Removing existing libmyth-devel package to avoid conflicts"
        sudo rpm -e libmyth-devel
    # Check out or update the svn checkout
        if [ -d "$DIR" ]; then
            if [ -z "$REV" -o 0"$REV" -lt 1 ]; then
                echo "Updating svn checkout"
                REL=`svn up "$DIR"`
            else
                echo "Updating svn checkout to r$REV"
                REL=`svn up -r "$REV" "$DIR"`
            fi
        else
            if [ -z "$REV" -o 0"$REV" -lt 1 ]; then
                echo "Checking out mythtv-svn to $DIR"
                REL=`svn co http://svn.mythtv.org/svn/trunk/ "$DIR"`
            else
                echo "Checking out mythtv-svn r$REV to $DIR"
                REL=`svn co -r "$REV" http://svn.mythtv.org/svn/trunk/ "$DIR"`
            fi
        fi
        if [ $? != 0 ]; then
            echo "Problem with svn checkout"
            return $?
        fi
        REL=`echo "$REL" | grep -i revision | sed -e 's/[^0-9]\\+//g'`
        echo "SVN Revision $REL"
    # Update SPEC
        echo "Update specfile _svnver to r$REL"
        sed -i \
            -e "s,define _svnrev .\+,define _svnrev r$REL," \
            -e "s,define branch .\+,define branch trunk,"   \
            -e "s,Version:.\+,Version: $VERSION,"           \
            /usr/src/redhat/SPECS/mythtv-svn.spec
    # Create the appropriate tarballs
        echo "Creating tarballs"
        cd "$DIR"
        for file in mythtv mythplugins; do
            mv "$file" "$file-$VERSION"
            tar jcf /usr/src/redhat/SOURCES/mythtv/$file-$VERSION.tar.bz2 --exclude .svn "$file-$VERSION"
            mv "$file-$VERSION" "$file"
        done
        cd -
    # Build
#            --with debug            \
        rpmbuild -bb /usr/src/redhat/SPECS/mythtv-svn.spec \
            --without mytharchive   \
            --without mythflix      \
            --without mythgallery   \
            --without mythcontrols  \
            --without mythgame      \
            --without mythphone     \
            --without mythbrowser   \
            --without mythmovies    \
            --without mythnews      \
            --without mythzoneminder
    # Error?
        if [ "$?" -ne 0 ]; then
            echo "Build error."
            return
        fi
    # Install
        echo -n "Install r$REL? [n] "
        read INST
        if [ "$INST" = "y" -o "$INST" = "Y" -o "$INST" = "yes" ]; then
            installmyth "$VERSION" "$REL"
        else
            echo "If you wish to install later, just run: installmyth \"$VERSION\" \"$REL\""
        fi
    }

# A separate function to install mythtv packages, so it can be called separately
    function installmyth {
        VERSION="$1"
        REL="$2"
        sudo rpm -Uvh --force                                                            \
            /usr/src/redhat/RPMS/x86_64/mythtv-docs-$VERSION-0.1.svn.r$REL.*.rpm         \
            /usr/src/redhat/RPMS/x86_64/libmyth-$VERSION-0.1.svn.r$REL.*.rpm             \
            /usr/src/redhat/RPMS/x86_64/libmyth-devel-$VERSION-0.1.svn.r$REL.*.rpm       \
            /usr/src/redhat/RPMS/x86_64/mythtv-base-themes-$VERSION-0.1.svn.r$REL.*.rpm  \
            /usr/src/redhat/RPMS/x86_64/mythtv-frontend-$VERSION-0.1.svn.r$REL.*.rpm     \
            /usr/src/redhat/RPMS/x86_64/mythtv-backend-$VERSION-0.1.svn.r$REL.*.rpm      \
            /usr/src/redhat/RPMS/x86_64/mythtv-setup-$VERSION-0.1.svn.r$REL.*.rpm        \
            /usr/src/redhat/RPMS/x86_64/mythtv-common-$VERSION-0.1.svn.r$REL.*.rpm       \
            /usr/src/redhat/RPMS/x86_64/perl-MythTV-$VERSION-0.1.svn.r$REL.*.rpm         \
            /usr/src/redhat/RPMS/x86_64/python-MythTV-$VERSION-0.1.svn.r$REL.*.rpm       \
            /usr/src/redhat/RPMS/x86_64/mythmusic-$VERSION-0.1.svn.r$REL.*.rpm           \
            /usr/src/redhat/RPMS/x86_64/mythvideo-$VERSION-0.1.svn.r$REL.*.rpm           \
            /usr/src/redhat/RPMS/x86_64/mythweather-$VERSION-0.1.svn.r$REL.*.rpm         \
            /usr/src/redhat/RPMS/x86_64/mythtv-debuginfo-$VERSION-0.1.svn.r$REL.*.rpm
    }

# Actually build the packages.
    buildmyth