File mythtv.spec of Package mythtv
#
# spec file for package mythtv
#
# Helper macro for SONAME-based subpackages
# Usage: %shlib_pkg <package-name> <short-description> <so-name-pattern>
%{lua:
function soname(lib)
local _, _, name, ver = lib:find("^(.+)%.so%.(.+)$")
name = name:gsub("%.", "_")
local sep = (name:find("%d$") and "-" or "")
return (name .. sep .. ver)
end
function shlib_pkg(lib, desc)
local sn = soname(lib)
print("%package -n " .. sn .. "\n")
print("Summary: " .. desc .. "\n")
print("Group: System/Libraries\n")
print("%description -n " .. sn .. "\n")
print(desc .. "\n")
print("%files -n " .. sn .. "\n")
print(rpm.expand("%{_libdir}/" .. lib .. "*\n"))
print("%post -n " .. sn .. "\n")
print("/sbin/ldconfig\n")
print("%postun -n " .. sn .. "\n")
print("/sbin/ldconfig\n")
end
}
# We don't want to be forced to package every generated file
%define _unpackaged_files_terminate_build 0
%define use_gcc14 0
%define use_webkit 1
%if 0%{?suse_version} >= 1600
%define use_gcc14 1
%define use_webkit 0
%endif
# Package creates a service
%{?systemd_ordering}
Name: mythtv
Version: 35
Release: 0
Summary: Open Source DVR
License: GPL-2.0
Group: Productivity/Multimedia/Video/Players
URL: https://www.mythtv.org/
Source0: mythtv-fixes-35-2025-05-28.tar.gz
Source1: mythtv-user.conf
Source2: mythbackend.service
Source3: mythbackend.sysconfig
BuildRequires: git
%if %{use_gcc14}
BuildRequires: gcc14
BuildRequires: gcc14-c++
%else
BuildRequires: gcc13
BuildRequires: gcc13-c++
%endif
BuildRequires: make
BuildRequires: gdb
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: nasm
BuildRequires: ccache
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: alsa-devel
BuildRequires: avahi-compat-mDNSResponder-devel
BuildRequires: libexiv2-devel
BuildRequires: libbluray-devel
BuildRequires: lzo-devel
BuildRequires: libhdhomerun-devel
BuildRequires: libsamplerate-devel
BuildRequires: libXinerama-devel
BuildRequires: libXrandr-devel
BuildRequires: libXv-devel
BuildRequires: libXxf86vm-devel
BuildRequires: libva-devel
BuildRequires: libdrm-devel
BuildRequires: libva-gl-devel
BuildRequires: libvdpau-devel
BuildRequires: libcec-devel
BuildRequires: libass-devel
#BuildRequires: libcrystalhd-devel
BuildRequires: systemd-devel
BuildRequires: libvpx-devel
BuildRequires: libbluray-bdj
BuildRequires: libmp3lame-devel
BuildRequires: libzip-devel
BuildRequires: python311-devel
BuildRequires: python311-lxml
BuildRequires: python311-requests
BuildRequires: python311-simplejson
%if 0%{?suse_version} < 1600
BuildRequires: python311-future
%endif
BuildRequires: python311-mysqlclient
BuildRequires: python311-setuptools
BuildRequires: perl-ExtUtils-MakeMaker
BuildRequires: perl-DBI
BuildRequires: perl-DBD-mysql
BuildRequires: perl-HTTP-Message
BuildRequires: perl-libwww-perl
BuildRequires: perl-IO-Socket-INET6
BuildRequires: perl-Date-Manip
BuildRequires: perl-XML-Simple
BuildRequires: perl-XML-XPath
BuildRequires: perl-DateTime-Format-ISO8601
BuildRequires: perl-SOAP-Lite
BuildRequires: perl-JSON
BuildRequires: perl-Image-Size
BuildRequires: perl-Net-UPnP
BuildRequires: libvorbis-devel
BuildRequires: flac-devel
BuildRequires: libtag-devel
BuildRequires: libcdio-devel
BuildRequires: libcdio-paranoia-devel
BuildRequires: libmysqlclient-devel
BuildRequires: fftw3-threads-devel
BuildRequires: libexif-devel
BuildRequires: dcraw
BuildRequires: minizip-devel
BuildRequires: libqt5-qtbase-devel
%if %{use_webkit}
BuildRequires: libQt5WebKit5-devel
BuildRequires: libQt5WebKitWidgets-devel
%endif
BuildRequires: libqt5-qtscript-devel
BuildRequires: libQt5Sql5-mysql
BuildRequires: fdupes
BuildRequires: soundtouch-devel
BuildRequires: sysuser-tools
BuildRequires: openSUSE-release
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
MythTV is a Free Open Source software digital video recorder (DVR) project
distributed under the terms of the GNU GPL. It has been under heavy
development since 2002, and now contains most features one would expect
from a good DVR (and many new ones that you soon won't be able to live without).
%package devel
Summary: Development files for MythTV
Group: Development/Libraries/C and C++
%description devel
MythTV open source DVR
This package contains the header files and libraries for developing add-ons.
%package common
Summary: Components used in common by the MythTV apps
Group: Productivity/Multimedia/Video/Players
Requires: perl(DBD::mysql)
Requires: perl(Net::UPnP)
Requires: perl(Net::UPnP::ControlPoint)
%if 0%{?suse_version} < 1600
Requires: python311-future
%endif
Requires: python311-lxml
Requires: python311-mysqlclient
Requires: python311-requests
Requires: python3-requests-cache
Requires: python311-simplejson
Requires: liberation-fonts
Requires: google-droid-fonts
Requires: pciutils
Requires: libQt5Sql5-mysql
%perl_requires
%description common
MythTV open source DVR
This package contains the subcomponents that are required in
common by the other main components,
%package frontend
Summary: MythTV client
Group: Productivity/Multimedia/Video/Players
Requires: mythtv-common = %{version}
%description frontend
MythTV open source DVR
This package contains the client used for playback and some
configuration.
%package backend
Summary: MythTV server
Group: Productivity/Multimedia/Video/Players
%sysusers_requires
Requires: mythtv-common = %{version}
%description backend
MythTV open source DVR
This package contains the server, responsible for recording and
serving video to clients.
%prep
%setup -q -n mythtv-fixes-35-2025-05-28
%build
pushd mythtv
CFLAGS="%{optflags} -fno-lto";export CFLAGS;
CXXFLAGS="%{optflags} -fno-lto";export CXXFLAGS;
./configure \
%if %{use_gcc14}
--cc=gcc-14 \
--cxx=g++-14 \
%else
--cc=gcc-13 \
--cxx=g++-13 \
%endif
--enable-set-cc-default \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--libdir-name=%{_lib} \
--mandir=%{_mandir} \
--compile-type=release \
--enable-libmp3lame \
--python=python3.11 \
--perl-config-opts="INSTALLDIRS=vendor"
make %{?_smp_mflags}
popd
# Generate the pre script to install the user
%sysusers_generate_pre %{SOURCE1} mythtv
%install
pushd mythtv
%qmake5_install
popd
# Link any duplicate files
%fdupes %{buildroot}%{_includedir}/mythtv
%fdupes %{buildroot}%{_datadir}/mythtv
# Create the mythtv user home directory
mkdir -p %{buildroot}%{_sharedstatedir}/mythtv
# Create the log dir
mkdir -p %{buildroot}/var/log/mythtv
# Install the user conf file
mkdir -p %{buildroot}%{_sysusersdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}
# Install the service related files
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_fillupdir}
install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.mythbackend
# The plugins directory needs to be owned by a package
install -d %{buildroot}%{_libdir}/mythtv/plugins
# Use the generated pre script to create the user
%pre -n mythtv-backend -f mythtv.pre
%service_add_pre mythbackend.service
%post backend
%service_add_post mythbackend.service
%{fillup_and_insserv -i -n mythbackend}
%preun backend
%service_del_preun mythbackend.service
%postun backend
%service_del_postun mythbackend.service
# --- List of shared libs ---
%{lua:
shlib_pkg("libmyth-35.so.35", "Myth core library")
shlib_pkg("libmythbase-35.so.35", "Base support library for MythTV")
shlib_pkg("libmythfreemheg-35.so.35", "MHEG support for MythTV")
shlib_pkg("libmythmetadata-35.so.35", "Metadata handling for MythTV")
shlib_pkg("libmythprotoserver-35.so.35", "Protocol server support for MythTV")
shlib_pkg("libmythservicecontracts-35.so.35", "Service contracts for MythTV APIs")
shlib_pkg("libmythtv-35.so.35", "Main TV playback and recording library")
shlib_pkg("libmythui-35.so.35", "User interface components for MythTV")
shlib_pkg("libmythupnp-35.so.35", "UPNP support for MythTV")
}
%if 0%{?suse_version} < 1600
%{lua:
shlib_pkg("libmythexiv2-0.28.so.35", "Exiv2 support for MythTV")
}
%endif
%{lua:
shlib_pkg("libmythavcodec.so.61", "MythTV FFmpeg codec wrapper")
shlib_pkg("libmythavdevice.so.61", "MythTV FFmpeg device wrapper")
shlib_pkg("libmythavfilter.so.10", "MythTV FFmpeg filter wrapper")
shlib_pkg("libmythavformat.so.61", "MythTV FFmpeg format wrapper")
shlib_pkg("libmythavutil.so.59", "MythTV FFmpeg utility wrapper")
shlib_pkg("libmythpostproc.so.58", "MythTV FFmpeg postprocessing wrapper")
shlib_pkg("libmythswscale.so.8", "MythTV FFmpeg scaling wrapper")
shlib_pkg("libmythswresample.so.5", "MythTV FFmpeg resampling wrapper")
}
%files devel
%{_includedir}/mythtv
%{_libdir}/*.so
%files common
%exclude %{_bindir}/mythbackend
%exclude %{_bindir}/mythfilldatabase
%exclude %{_bindir}/mythjobqueue
%exclude %{_bindir}/mythmediaserver
%exclude %{_bindir}/mythtv-setup
%exclude %{_bindir}/mythavtest
%exclude %{_bindir}/mythfrontend
%exclude %{_bindir}/mythlcdserver
%exclude %{_bindir}/mythshutdown
%exclude %{_bindir}/mythwelcome
%dir %{_libdir}/mythtv
%dir %{_libdir}/mythtv/plugins
%{_bindir}/*
%{_datadir}/mythtv
%{python311_sitelib}/*
%{perl_vendorlib}/MythTV.pm
%{perl_vendorlib}/MythTV
%{perl_vendorlib}/IO
%files backend
%{_bindir}/mythbackend
%{_bindir}/mythfilldatabase
%{_bindir}/mythjobqueue
%{_bindir}/mythmediaserver
%{_bindir}/mythtv-setup
%{_sysusersdir}/*
%{_unitdir}/*
%{_fillupdir}/*
%dir %attr(0750,mythtv,video) %{_sharedstatedir}/mythtv
%dir %attr(0750,mythtv,root) /var/log/mythtv
%files frontend
%{_bindir}/mythavtest
%{_bindir}/mythfrontend
%{_bindir}/mythlcdserver
%{_bindir}/mythshutdown
%{_bindir}/mythwelcome
%changelog
* Wed May 28 2025 Paul Gardiner <pizza@glidos.net> - 35.1
- Fixes 35