[packman] mythtv spec file

Simon Crute simon at geordie.demon.co.uk
Thu Oct 27 12:59:29 CEST 2005


Mythtv spec file for mythTV 0.18.1


-- 
Simon Crute
-------------- next part --------------
%define desktop_applications mythfrontend
%define desktop_vendor  atrpms
# FIXME: Until we get to build linuxtv-dvb-kernheaders
%define linuxtv_dvb_package linuxtv-dvb-1.1.1cvs20050529
#added cos fedora core must set these macros, and suse doesn't
%define _varlibdir /var/lib
%define _varcachedir /var/cache
%define _initdir /etc/rc.d
%define _sysconfigdir /etc
%define _logrotatedir /etc/logrotate.d
%define _logdir /var/log

Summary: A personal video recorder (PVR) application.
Name: mythtv
Version: 0.18.1
Release: at_114_snc_2
URL: http://www.mythtv.org/
License: GPL2
Group: Applications/Multimedia
Source0: http://www.mythtv.org/mfc/%{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
Source8: mythepg.png
Source9: mythepg.desktop
Source10: mythprogfind.png
Source11: mythprogfind.desktop
Source12: http://linuxtv.org/download/dvb/%{linuxtv_dvb_package}.tar.bz2
Source100: mythtv-doc.configure.ac
Source101: mythtv-doc.Makefile.am
Patch0: mythtv-0.18.1-svnfixes.patch
Patch1: mythtv-0.15-ostreaming.patch
Patch2: mythtv-0.17-mixeddeclarations.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gcc-c++
BuildRequires: XFree86-devel
BuildRequires: freetype2-devel >= 2, lame, qt3-devel >= 3, mysql-devel
%{!?_without_alsa:BuildRequires: alsa-lib-devel}
%{!?_without_arts:BuildRequires: arts-devel}
# FIXME: there is no such package yet
#%{!?_without_dvb:BuildRequires: linuxtv-dvb-kernheaders}
%{!?_without_lirc:BuildRequires: lirc}
%{?_with_xvmcnvidia:BuildRequires: nvidia-graphics-devel}
# FIXME: this dependency is arch dependent! E.g. a common src.rpm would not be anymore
#%{!?_without_xvmcvld:BuildRequires: /usr/include/X11/extensions/vldXvMC.h}
#
%{!?_without_xvmcw:BuildRequires: libxine1-xvmc}
%{?_with_directfb:BuildRequires: directfb-devel}
%{!?_without_opengl_vsync:BuildRequires: XFree86-devel, /usr/include/GL/glxext.h}
%{!?_without_firewire:BuildRequires: libiec61883-devel >= 0.1.0svn49, libraw1394-devel, libavc1394-devel}
BuildRequires: desktop-file-utils

%description
MythTV implements the following PVR 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: freetype2 >= 2, lame, qt3 >= 3,
Requires: qt3-mysql
Requires: mysql-shared

%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: freetype2-devel >= 2, lame, qt3-devel >= 3,
Requires: mysql-devel
%{!?_without_alsa:Requires: alsa-lib-devel}
%{!?_without_arts:Requires: arts-devel}
%{!?_without_lirc:Requires: lirc}
%{?_with_xvmcnvidia:Requires: nvidia-graphics-devel}
#%{!?_without_xvmcvld:Requires: /usr/include/X11/extensions/vldXvMC.h}
%{!?_without_xvmcw:Requires: xorg-x11-devel}
%{?_with_directfb:Requires: directfb-devel}
# FIXME: Until we get to build linuxtv-dvb-kernheaders
#%{!?_without_dvb:Requires: linuxtv-dvb-kernheaders}
%{!?_without_firewire:Requires: libiec61883-devel >= 0.1.0svn49, libraw1394-devel, libavc1394-devel}

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

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

%package themes
Summary: Base themes for mythtv's frontend.
Group: Applications/Multimedia
Provides: mythtv-theme-gant
Obsoletes: mythtv-theme-gant

%description 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 frontend
Summary: Client component of mythtv (a PVR).
Group: Applications/Multimedia
Requires: mythtv = %{version}
Requires: mythtv-themes = %{version}
Provides: mythtv-frontend-api = %(echo %{eversion} | awk -F. '{print $1 "." $2}')

%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 PVR).
Group: Applications/Multimedia
Conflicts: xmltv-grabbers < 0.5.34
Requires: mythtv = %{version}
Provides: mythtv-backend = 0.15

%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: mythtv-backend = %{version}
Requires: mythtv-themes = %{version}
Obsoletes: mythtvsetup <= %{evr}
Provides: mythtvsetup = %{evr}

%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.

%prep
%setup -q
# FIXME: Until we get to build linuxtv-dvb-kernheaders
%if %{!?_without_dvb:1}%{?_without_dvb:0}
%setup -q -T -D -a 12
%endif
%patch0 -p2 -b .svnfixes
%patch1 -p0 -b .ostreaming
%patch2 -p0 -b .c99

if [ "%{_lib}" != "lib" ]; then
  grep -rl /lib/ . | xargs perl -pi -e's,/lib/,/%{_lib}/,g'
  grep -rl /lib$ . | xargs perl -pi -e's,/lib$,/%{_lib},'
  grep -rl '/lib ' . | xargs perl -pi -e's,/lib ,/%{_lib} ,g'
fi
perl -pi -e's,test -f /usr/X11R6/bin/xinit,test -f /usr/X11R6/%{_lib}/libX11.so,' configure
perl -pi -e's,VENDOR_XVMC_LIBS="-lXvMCNVIDIA",VENDOR_XVMC_LIBS="-lXvMCNVIDIA -lXv",' configure

find . -type f | xargs grep -l artsc/artsc.h | xargs perl -pi -e's,artsc/artsc.h,artsc.h,g'

echo "QMAKE_PROJECT_DEPTH = 0" >> mythtv.pro
echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro

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@|%{_sysconfdir}|g' \
      -e's|@initdir@|%{_initdir}|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 /usr/local -> %{_prefix}
#grep -rl /usr/local . | xargs -r echo perl -pi.local "-e's|/usr/local|'%{_prefix}'|g'" | sh -x

%build
./configure \
	--compile-type=%{?_with_debug:debug}%{!?_with_debug:release} \
	--prefix=%{_prefix} \
	--enable-joystick-menu \
	%{!?_without_lirc:--enable-lirc}%{?_without_lirc:--disable-lirc} \
	--enable-ivtv \
	%{!?_without_firewire:--enable-firewire}%{?_without_firewire:--disable-firewire} \
	%{!?_without_dvb:--enable-dvb --dvb-path=%{_builddir}/%{name}-%{version}/%{linuxtv_dvb_package}/linux/include/ --enable-dvb-eit}%{?_without_dvb:--disable-dvb} \
	--enable-audio-oss \
	%{!?_without_alsa:--enable-audio-alsa}%{?_without_alsa:--disable-audio-alsa} \
	%{!?_without_arts:--enable-audio-arts}%{?_without_arts:--disable-audio-arts} \
	%{?_with_jack:--enable-audio-jack}%{!?_with_jack:--disable-audio-jack} \
	--enable-x11 \
	%{!?_without_xrandr:--enable-xrandr}%{?_without_xrandr:--disable-xrandr} \
	--enable-xv \
	%{?_with_xvmcnvidia:--enable-xvmc} %{!?_without_xvmcw:--enable-xvmc}%{!?_with_xvmcnvidia:%{?_without_xvmcw:--disable-xvmc}} \
	%{!?_without_xvmcvld:--enable-xvmc-vld}%{?_without_xvmcvld:--disable-xvmc-vld} \
	%{!?_without_opengl_vsync:--enable-opengl-vsync}%{?_without_opengl_vsync:--disable-opengl-vsync} \
	%{?_with_directfb:--enable-directfb}%{!?_with_directfb:--disable-directfb}

perl -pi -e"s|^OPTFLAGS=.*|OPTFLAGS=%{optflags}|" config.mak
perl -pi -e's|^ARCHFLAGS=.*|ARCHFLAGS=|' config.mak

# still needed for some plugins
cat >> settings.pro << EOF
PREFIX = %{_prefix}
CONFIG -= debug
CONFIG += %{?_with_debug:debug}{!?_with_debug:release}
QMAKE_CXXFLAGS_RELEASE -= -march=pentiumpro
QMAKE_CXXFLAGS_RELEASE -= %{optflags}
QMAKE_CXXFLAGS_RELEASE += %{optflags}
QMAKE_CFLAGS_RELEASE -= -march=pentiumpro
QMAKE_CFLAGS_RELEASE -= %{optflags}
QMAKE_CFLAGS_RELEASE += %{optflags}
EOF

qmake mythtv.pro
make

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}%{_initdir}
mkdir -p %{buildroot}%{_sysconfdir}

install -p mythbackend.init %{buildroot}%{_initdir}/mythbackend
install -p mythbackend.sysconfig %{buildroot}%{_sysconfdir}/mythbackend
install -p mythbackend.logrotate  %{buildroot}%{_logrotatedir}/mythbackend

# Desktop entries
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
for file in %{desktop_applications}; do
  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 settings.pro %{buildroot}%{_datadir}/mythtv/build/

%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,-)
%doc README* UPGRADING AUTHORS COPYING FAQ
%doc database keys.txt
%doc docs/*.html docs/*.png docs/*.txt contrib configfiles

%define ghostattr %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)

%files backend
%defattr(-,root,root,-)
#config(noreplace) %{_datadir}/mythtv/mysql.txt
%{_bindir}/mythbackend
%{_bindir}/mythfilldatabase
%{_bindir}/mythjobqueue
%attr(-,mythtv,mythtv) %dir %{_varlibdir}/mythtv
%attr(-,mythtv,mythtv) %dir %{_varcachedir}/mythtv
%{_initdir}/mythbackend
%config %{_sysconfdir}/mythbackend
%config %{_logrotatedir}/mythbackend
%attr(-,mythtv,mythtv) %dir %{_logdir}/mythtv
# Hm, somehow this doesn't work yet ... :(
#%ghostattr %{_logdir}/mythtv/mythbackend.log*
#%ghostattr %{_rundir}/mythbackend.pid
#%ghostattr %{_subsysdir}/mythbackend

%files setup
%defattr(-,root,root,-)
%{_bindir}/mythtv-setup
%{_bindir}/mythtvsetup

%files frontend
%defattr(-,root,root,-)
#config(noreplace) %{_datadir}/mythtv/mysql.txt
%{_datadir}/mythtv/*.xml
%{_bindir}/mythfrontend
%{_bindir}/mythtv
%{_bindir}/mythepg
%{_bindir}/mythprogfind
%{_bindir}/mythcommflag
%{_bindir}/mythtranscode
%{_bindir}/mythtvosd
%{_libdir}/mythtv/filters
%{_libdir}/mythtv/plugins
%{_datadir}/mythtv/*.ttf
%{_datadir}/mythtv/i18n
%{_datadir}/applications/*myth*.desktop
%{_datadir}/pixmaps/myth*.png

%files themes
%defattr(-,root,root,-)
%{_datadir}/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

%changelog
* Tue Oct 04 2005 Simon Crute <scrute at novell.com>
- Applied my hacks to the 114 version. and they seem to work. 

* Sat Sep 17 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Update to latest svn fixes.

* Sun Jul  4 2005 Simon Crute <scrute at novell.com>
- hack around with the spec file to get this to build on suse. 
  just about got there. Now. Build not fully tested yet. 

* Sat Jun  4 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Update cvsfixes (gcc4 support).
- More /lib vs %%{_lib} fixes. 

* Tue May 31 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Update cvsfixes, reenable opengl_vsync.

* Wed May 25 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- New stable cvs fixes.

* Mon May 16 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Update to 0.18.1.

* Thu May 12 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Update the cvs fixes.

* Sun Apr 24 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Use libXvMCw.

* Thu Apr 21 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Add cvsfixes for 0.18.

* Tue Apr 19 2005 Axel Thimm <Axel.Thimm at ATrpms.net>
- Remove MYOPTFLAGS hack.
- specfile cleanup by Chris Petersen <xris at forevermore.net>.

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

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

* Mon Apr 04 2005 Jarod Wilson <jarod at wilsonet.com>
- Rebuilt against nVidia 7174 XvMC
- Includes Qt 3.3.4 time change patch

* Thu Mar 03 2005 Jarod Wilson <jarod at 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 at wilsonet.com>
- Added FireWire support

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

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

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

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

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

* Tue Aug  21 2004 Ben Stanley <bds02 at 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 at ATrpms.net>
- Add patch for gcc < 3 (Edward Rudd <eddie at 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 at ATrpms.net>
- Updated to 0.15.

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

* Tue Feb 17 2004 Axel Thimm <Axel.Thimm at 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 at ATrpms.net>
- Update to 0.14.
- Disable directfb in default build.

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

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

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

* Tue Oct 21 2003 Axel Thimm <Axel.Thimm at 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 at 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 at ATrpms.net>
- Activate native alsa and lirc modes.

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

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

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

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

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

* Thu Jun 12 2003 Axel Thimm <Axel.Thimm at 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 at ATrpms.net>
- Update to 0.9 release.

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

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

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

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

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

* Wed Mar 19 2003 Axel Thimm <Axel.Thimm at ATrpms.net>
- Added start/stop scripts for mythbackend.

* Tue Mar 18 2003 Axel Thimm <Axel.Thimm at ATrpms.net>
- Removed unneeded 0.7 patches.

* Mon Mar 17 2003 Axel Thimm <Axel.Thimm at 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 at rogers.com>
- Added a patch that prevents a segmentation fault in mythfilldatabase.

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

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

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




More information about the Packman mailing list