Difference between revisions of "Mythtv-rpmbuild.spec"

From MythTV Official Wiki
Jump to: navigation, search
m (Removed last change as http://rpms.netmindz.net/ does not currently contain a valid website (just a test page), let alone rpms.)
Line 4: Line 4:
 
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>

Revision as of 22:12, 15 June 2008

This spec is for building MythTV RPM packages from a subversion checkout.

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.

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

#
# Specfile for building MythPlugins RPMs from a subversion checkout.
#
# by:   Chris Petersen <rpm@forevermore.net>
#
#  Modified/Extended from the great (non-svn based) work of:
#     David Bussenschutt <buzz@oska.com>
#     Axel Thimm <Axel.Thimm@ATrpms.net>
#     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 ATRPMS mythtv
#     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
#     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:
#
# --with(out) modular_x     Override the default detection code for modular X.org
#
# --with proc_opt           Enable MythTV's optimized processor detection code
#                               and override RPM's defaults.
#
# 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 dts                Enable dts support
#
# 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 opengl_vsync    Disable OpenGL video sync enhancements
# --without perl            Disable building of the perl bindings
#

# 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
%define desktop_applications mythfrontend mythbackend mythtv-setup

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

# Are we running modular Xorg?  Default is to auto-detect FC5 or later, but you
# can also specify --with modular_x or --without modular_x to override.
%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)

# 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 )

#
# Basic descriptive tags for this package:
#
Name:           mythtv
Version:        0.21
Release:        0.%{_svn_rev}.svn
Summary:        A digital video recorder (DVR) application.

URL:            http://www.mythtv.org/
License:        GPL
Group:          Applications/Multimedia

# 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}

# The following options are enabled by default.  Use --without to disable them
%define with_lirc          %{?_without_lirc:          0} %{?!_without_lirc:          1}
%define with_firewire      %{?_without_firewire:      0} %{?!_without_firewire:      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
%define with_arts          %{?_with_arts:          1} %{?!_with_arts:          0}
%define with_jack          %{?_with_jack:          1} %{!?_with_jack:          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}

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

# Define some directory names that aren't present in rpm's own macro library
%define _varlibdir     %{_localstatedir}/lib
%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
Source1:        mythbackend.sysconfig.in
Source2:        mythbackend.init.in
Source3:        mythbackend.logrotate.in
Source4:        mythtv.png
Source5:        mythtv.desktop
Source6:        mythfrontend.png
Source7:        mythfrontend.desktop
Source12:       http://linuxtv.org/download/dvb/%{linuxtv_dvb_package}.tar.bz2
Source100:      mythtv-doc.configure.ac
Source101:      mythtv-doc.Makefile.am

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

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

BuildRequires:  desktop-file-utils
BuildRequires:  freetype-devel >= 2
BuildRequires:  gcc-c++
BuildRequires:  lame-devel
BuildRequires:  libdvdnav-devel
BuildRequires:  mysql-devel
BuildRequires:  qt-devel >= 3

# Yeah. we do need subversion, don't we...
BuildRequires:  subversion

# The modular version of Xorg requires a different set of build packages
%if %{_modular_x}
BuildRequires:  libXmu-devel
BuildRequires:  libXv-devel
BuildRequires:  libXxf86vm-devel
BuildRequires:  mesa-libGLU-devel
%else
BuildRequires:  XFree86-devel
%endif

%if %{with_alsa}
BuildRequires:  alsa-lib-devel
%endif

%if %{with_arts}
BuildRequires:  arts-devel
%endif

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

%if %{with_dts}
BuildRequires:  libdts-devel
%endif

#%if %{with_dvb}
#BuildRequires:  linuxtv-dvb-devel
#%endif

%if %{with_firewire}
BuildRequires:  libavc1394-devel
BuildRequires:  libiec61883-devel >= 0.1.0svn49
BuildRequires:  libraw1394-devel  >= 1.2
%endif

%if %{with_lirc}
#BuildRequires:  lirc-lib-devel
BuildRequires:  lirc-devel
%endif

%if %{with_opengl_vsync}
#BuildRequires:  nvidia-graphics-devel
BuildRequires:  xorg-x11-drv-nvidia-devel
%endif

%if %{with_xvmcvld}
BuildRequires:  libXvMC-devel
#BuildRequires:  /etc/X11/XvMCConfig
BuildRequires:  %{_libdir}/libXvMCW.so.1
BuildRequires:  %{_includedir}/X11/extensions/vldXvMC.h

%endif

%if %{with_xvmcnvidia}
#BuildRequires:  nvidia-graphics-devel
BuildRequires:  xorg-x11-drv-nvidia-devel
BuildRequires:  libXvMC-devel
BuildRequires:  %{_libdir}/libXvMCW.so.1
%endif

%if %{with_x264}
BuildRequires:  x264-devel
%endif

%if %{with_aac}
BuildRequires:  faac-devel
BuildRequires:  faad2-devel
%endif

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

%description
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
 - 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 -n libmyth
Summary:   Library providing mythtv support.
Group:     System Environment/Libraries

Requires:  freetype >= 2
Requires:  lame
Requires:  qt >= 3
Requires:  qt-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}
Requires:  freetype-devel >= 2, lame-devel, qt-devel >= 3,
Requires:  mysql-devel
Requires:  libdvdnav

%if %{with_alsa}
Requires:  alsa-lib-devel
%endif

%if %{with_arts}
Requires:  arts-devel
%endif

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

%if %{with_dts}
Requires:  libdts-devel
%endif

#%if %{with_dvb}
#Requires:  linuxtv-dvb-devel
#%endif

%if %{with_firewire}
Requires:  libiec61883-devel >= 0.1.0svn49
%endif

%if %{with_lirc}
#Requires:  lirc-lib-devel
Requires:  lirc-devel
%endif

%if %{with_xvmcvld}
Requires:  libXvMC
#Requires:  /etc/X11/XvMCConfig
%endif

%if %{with_xvmcnvidia}
#Requires:  nvidia-graphics-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

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

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

%if %{with_perl}

%package -n perl-MythTV
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))


%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
Obsoletes:  mythtv-theme-gant

%description -n mythtv-themes
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 base themes used by the frontend and
mythtvsetup.

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

%package -n mythtv-frontend
Summary:   Client component of mythtv (a DVR).
Group:     Applications/Multimedia

Requires:  mythtv = %{version}
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
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 -n mythtv-backend
Summary:    Server component of mythtv (a DVR).
Group:      Applications/Multimedia

Conflicts:  xmltv-grabbers < 0.5.34
Requires:   mythtv = %{version}

%description -n mythtv-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 -n mythtv-setup
Summary:    Setup the mythtv backend.
Group:      Applications/Multimedia
Provides:   mythtvsetup = %{version}
Obsoletes:  mythtvsetup <= %{version}

Requires:   mythtv-backend = %{version}
Requires:   mythtv-themes  = %{version}

%description -n mythtv-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.

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

%prep

# 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

# 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

# Copy the checkout to the rpm build directory.
    rsync -a --cvs-exclude               \
          %{_svn_root}/%{name}/*         \
          %{_builddir}/%{name}-%{version}/

# Extract the DVB files if we're building with DVB support
%if %{with_dvb}
%setup -q -T -D -a 12
%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
        grep -rl /lib/   . | xargs sed -i -e 's,/lib/,/%{_lib}/,g'
        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
    sed -i -e 's,test -f /usr/X11R6/bin/xinit,test -f /usr/X11R6/%{_lib}/libX11.so,' configure

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

# Fix path to artsc.h on Fedora
#    find . -type f | xargs grep -l artsc/artsc.h | xargs sed -i -e 's,artsc/artsc.h,artsc.h,g'

# 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

# Install these files that MythTV doesn't include,
# and update them with the paths set by rpmbuild.
    cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} .
    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
    sed -i -e 's#perl Makefile.PL#%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"#' \
        bindings/perl/perl.pro

# dummy docs that we can install for rpmlint's sake.
    rm -rf docs/dummy
    mkdir docs/dummy
    echo "nothing here - dummy file" > docs/dummy/mythtv-backend
    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

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

%build

# Need to set $QTDIR?
[ -n "$QTDIR" ] || . %{_sysconfdir}/profile.d/qt.sh

# Initialize the options string
OPTS=""

# 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

# Go through each of the config options and make sure they are
# enabled (or disabled) as requested.

%if %{with_arts}
    OPTS="$OPTS --enable-audio-arts"
%else
    OPTS="$OPTS --disable-audio-arts"
%endif

%if %{with_alsa}
    OPTS="$OPTS --enable-audio-alsa"
%else
    OPTS="$OPTS --disable-audio-alsa"
%endif

%if %{with_oss}
    OPTS="$OPTS --enable-audio-oss"
%else
    OPTS="$OPTS --disable-audio-oss"
%endif

%if %{with_xvmcnvidia}
    OPTS="$OPTS --enable-xvmc"
%else
    OPTS="$OPTS --disable-xvmc"
%endif

%if %{with_xvmcvld}
    OPTS="$OPTS --enable-xvmc-vld"
%else
    OPTS="$OPTS --disable-xvmc-vld"
%endif

%if %{with_opengl_vsync}
    OPTS="$OPTS --enable-opengl-vsync"
%else
    OPTS="$OPTS --disable-opengl-vsync"
%endif

%if %{with_lirc}
    OPTS="$OPTS --enable-lirc"
%else
    OPTS="$OPTS --disable-lirc"
%endif

%if %{with_firewire}
    OPTS="$OPTS --enable-firewire"
%else
    OPTS="$OPTS --disable-firewire"
%endif

%if %{with_jack}
    OPTS="$OPTS --enable-audio-jack"
%else
    OPTS="$OPTS --disable-audio-jack"
%endif

%if %{with_xrandr}
    OPTS="$OPTS --enable-xrandr"
%else
    OPTS="$OPTS --disable-xrandr"
%endif

%if %{with_directfb}
    OPTS="$OPTS --enable-directfb"
%else
    OPTS="$OPTS --disable-directfb"
%endif

%if %{with_dts}
    OPTS="$OPTS --enable-libdts"
%else
    OPTS="$OPTS --disable-libdts"
%endif

%if %{with_dvb}
    OPTS="$OPTS --enable-dvb"
#    OPTS="$OPTS --enable-dvb-eit"
    OPTS="$OPTS --dvb-path=%{_builddir}/%{name}-%{version}/%{linuxtv_dvb_package}/linux/include/"
%else
    OPTS="$OPTS --disable-dvb"
%endif

%if %{with_perl}
    OPTS="$OPTS --with-bindings=perl"
%endif

%if %{with_x264}
    OPTS="$OPTS --enable-x264"
%endif

%if %{with_aac}
    OPTS="$OPTS --enable-libfaac"
    OPTS="$OPTS --enable-libfaad --enable-libfaadbin"
%endif

# 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}            \
    --compile-type=%{compile_type} \
	--enable-joystick-menu         \
	--enable-ivtv                  \
	--enable-x11                   \
	--enable-xv                    \
    $OPTS

# Make
make %{?_smp_mflags}

# We don't want rpm to add perl requirements to anything in contrib
find contrib -type f | xargs -r chmod a-x

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

%install

rm -rf %{buildroot}
make install INSTALL_ROOT=%{buildroot}

ln -s mythtv-setup %{buildroot}%{_bindir}/mythtvsetup
mkdir -p %{buildroot}%{_varlibdir}/mythtv
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.
install -p -m 755 mythbackend.init      %{buildroot}%{_initrddir}/mythbackend
install -p -m 644 mythbackend.sysconfig %{buildroot}%{_sysconfigdir}/mythbackend
install -p -m 644 mythbackend.logrotate %{buildroot}%{_logrotatedir}/mythbackend

# Desktop entries
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
for file in %{desktop_applications}; do
  if [ ! -f %{_sourcedir}/$file.png ] ; then
    cp %{_sourcedir}/mythfrontend.png %{_sourcedir}/$file.png
    cp %{_sourcedir}/mythfrontend.desktop %{_sourcedir}/$file.desktop
  fi
  install -p %{_sourcedir}/$file.png %{buildroot}%{_datadir}/pixmaps/$file.png
  desktop-file-install --vendor %{desktop_vendor} \
    --dir %{buildroot}%{_datadir}/applications    \
    --add-category X-Red-Hat-Extra                \
    --add-category Application                    \
    --add-category AudioVideo                     \
    %{_sourcedir}/$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/

# Fix the perl .packlist info
%if %{with_perl}
    sed -i -e "s#^$RPM_BUILD_ROOT##" "$RPM_BUILD_ROOT/%{perl_vendorarch}/auto/"*/.packlist
%endif

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

%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 -n mythtv-backend
/sbin/chkconfig --add mythbackend

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

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

%files
%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 -n mythtv-backend
%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}/mythfilldatabase
%{_bindir}/mythjobqueue
%{_bindir}/mythtranscode
%{_bindir}/mythreplex
%{_initrddir}/mythbackend
# Hm, somehow this doesn't work yet ... :(
#%ghostattr %{_logdir}/mythtv/mythbackend.log*
#%ghostattr %{_rundir}/mythbackend.pid
#%ghostattr %{_subsysdir}/mythbackend
%doc docs/dummy/mythtv-backend

%files -n mythtv-setup
%defattr(-,root,root,-)
%{_bindir}/mythtv-setup
%{_bindir}/mythtvsetup
%doc docs/dummy/mythtv-setup

%files -n mythtv-frontend
%defattr(-,root,root,-)
%{_bindir}/mythcommflag
%{_bindir}/mythfrontend
%{_bindir}/mythlcdserver
%{_bindir}/mythshutdown
%{_bindir}/mythtv
%{_bindir}/mythtvosd
%{_bindir}/mythwelcome
%{_datadir}/applications/*myth*.desktop
%{_datadir}/mythtv/*.ttf
%{_datadir}/mythtv/*.xml
%{_datadir}/mythtv/i18n
%{_datadir}/pixmaps/myth*.png
%{_libdir}/mythtv/filters
%{_libdir}/mythtv/plugins
%doc docs/dummy/mythtv-frontend

%files -n mythtv-themes
%defattr(-,root,root,-)
%{_datadir}/mythtv/themes
%doc docs/dummy/mythtv-themes

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

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

%if %{with_perl}

%files -n perl-MythTV
%defattr(-,root,root,-)
%{perl_vendorlib}/*
%{perl_vendorarch}/auto/*

%endif

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

%changelog

* Sat Nov 18 2006 Chris Petersen <rpm@forevermore.net>
- Add x264 support
- Add faac support

* Wed Aug 30 2006 Chris Petersen <rpm@forevermore.net>
- add -i to the SVN grep to account for certain foreign languages that capitalize "Revision"

* Mon Jul 03 2006 Chris Petersen <rpm@forevermore.net>
- Add perl-MythTV subpackage

* Sun May 21 2006 Chris Petersen <rpm@forevermore.net>
- Add libdvdnav dependencies
- Add dependency for /etc/X11/XvMCConfig for runtime xvmc detection

* Wed May 10 2006 Chris Petersen <rpm@forevermore.net>
- Replace libXvMCW with libXvMC to reduce dependency on atrpms, which doesn't seem to carry the package anymore.

* Sat Apr 01 2006 Chris Petersen <rpm@forevermore.net>
- Enhance SVN support so that the build doesn't fail if there were updated files in the repository.
- Add detection for modular X.org so we don't need two spec files.
- Add documentation at the top of the file for the --with and --without options.
- Rename _myth_svnroot to _svn_root to make the code more portable to other packages.

* Fri Mar 31 2006 Chris Petersen <rpm@forevermore.net>
- Improve comments and rearrange some of the declarations for a better layout.
- Remove mythbackend from desktop_applications, since it's not something that gets launched from a menu.
- Add with_dts option.
- Replace XFree86-devel BuildRequires with Xorg 7's mesa-libGLU-devel.
- Remove mythepg and mythprogfind, as they don't seem to exist anymore.
- Remove commented-out reference to mysql.txt.
- Put mythtranscode in the backend package, where it's supposed to be.
- Why run perl in sed mode when you can just run sed? (`perl -p` -> `sed`)
- Remove the unnecessary check for .cvsignore files.
- Remove a bunch of unnecessary directory changes.
- Set with_proc_opt off by default, as it should be (rpm does a good enough job with this).
- Add _smp_mflags to the make call.
- 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}
- Converted/Modified Chris' July 19 2005 spec to fully automate build of SVN for nightly snapshots.
- reenabled opengl-vsync by default since atrpms has it enabled now!
- enabled --with-proc-opt by default, as most SVN users will want this.
- enabled 'debug' as SVN users will probably want this, gdb friendly.
- pulled axel's %%{_lib} fixes from June 4 2005 into this file
- resolved svn chicken-and-egg 'what version is this specfile?' question, by aborting on svn revision change
- ran results through rpmlint and fixed other minor errors (minor install perms)
- made all package,description,files keywords use -n syntax for clarity

* Tue Jul 19 2005 Chris Petersen <rpm@forevermore.net>
- Remove atrpms patches
- Change desktop vendor from atrpms to mythtv
- Change summary from PVR to DVR

* Mon Apr 18 2005 Chris Petersen <rpm@forevermore.net>
- Clean up spec, add documentation
- Rework --with and --without options
- Disable opengl-vsync by default (it's unstable for too many people)

* Fri Apr 15 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.18.

* Thu Apr 14 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
- Split off some themes into the myththemes package.

* 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>
- 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>
- Added FireWire support

* Fri Feb 11 2005 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.17.

* Sat Nov 27 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Now that it works, disable XvMC in default build ...

* Wed Nov 24 2004 Jarod Wilson <jcw@wilsonet.com>
- Fix xvmcnvidia build.

* Fri Sep 17 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Remove dependencies on xmltv-grabbers and mysql (Edward Rudd
  <eddie@omegaware.com>).
- Include math.h in dvbdiseqc.cpp (Edward Rudd <eddie@omegaware.com>).
- Enable opengl_vsync and xrandr for some distributions.

* Fri Sep 10 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.16.

* Tue Aug  21 2004 Ben Stanley <bds02@uow.edu.au>
- Sub-release 75.
- Included dvb support in the build.
- Included .png files for html help

* Tue Jun  1 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Add patch for gcc < 3 (Edward Rudd <eddie@omegaware.com>).
- Update to 0.15.1.
- Remove patch, has already been applied.
- New patch from Edward.

* Thu May 27 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Updated to 0.15.

* Wed May  5 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Use workaround for qmake project depth bug
  (by Robert Hardy <rhardy@webcon.ca>).

* Tue Feb 17 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Split off mythtvsetup and the base themes into their own sub packages.
- Make mysql.txt part of both frontend and backend.
- Added support for arts and dvb. arts has been enabled by default.

* Sun Feb  1 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.14.
- Disable directfb in default build.

* Sun Jan  4 2004 Axel Thimm <Axel.Thimm@ATrpms.net>
- Enable directfb.

* Sat Dec 20 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Patch for missing tvformat default (bttv always did PAL).

* Thu Dec 11 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.13.
- Remove ringbuffer patch (applied in 0.13).

* Tue Oct 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Add cvs patch fixing ringbuffer races.
- 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>
- Update to 0.12.
- Move path macros out of specfile.
- Remove imdb patch.
- Silence install/upgrade output.

* Mon Oct 13 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Activate native alsa and lirc modes.

* Sat Sep 20 2003 "Jarod C. Wilson" <jcw@wilsonet.com>
- Added patch for imdb changes.

* Sat Aug 16 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.11.

* Wed Jul  2 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.10.

* Tue Jun 24 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Make logrotate script accept non-existing logfiles.

* Sat Jun 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Split off mythtv-suite.

* Thu Jun 12 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.9.1 release.
- Split /var/spool/mythtv to /var/lib/mythtv and /var/cache/mythtv.
  (as Debian does).

* Tue Jun 10 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.9 release.

* Wed May 14 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Fixed packaging bug in libmyth-devel.

* Tue Apr  8 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Rebuilt for Red Hat 9.

* Sun Mar 23 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Fixed desktop entries.

* Sat Mar 22 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Add g flag to sed.
- Don't use mythtv user yet.

* Fri Mar 21 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Add mythtv user.
- Add desktop entries.

* 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>
- Removed unneeded 0.7 patches.

* Mon Mar 17 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Update to 0.8.
- 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.

* Thu Jan 16 2003 Axel Thimm <Axel.Thimm@ATrpms.net>
- Added dependency to qt-MySQL (Roy Stogner <roystgnr@ticam.utexas.edu>).

* Thu Dec  5 2002 Axel Thimm <Axel.Thimm@ATrpms.net>
- fixed installation paths.

* Wed Nov 13 2002 Axel Thimm <Axel.Thimm@ATrpms.net>
- Initial build.