File kodi.spec of Package kodi

#
# spec file for package kodi
#
# Copyright (c) 2015-2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


# Please edit kodi.spec and kodi.changes only. *-noX.* files are generated from
# kodi.* files with the pre_checkin.sh script
%define kodi_version Omega
%define _kodi_addons_dir %{_datadir}/kodi/addons
# set this parameter to enable building Kodi with ccache, debug information, etc.
%define dev_build 0

# WARNING: Build with bundled ffmpeg until version 18.0 is reached
# INFO: We are on version 21.0 in the meantime, so let's live with
#  the system provided ffmpeg packages; if this won't work at some
#  point in time in the future, uncomment the "sysffmpeg" stuff. In
#  order to reduce downloading it every time, this is now commented!
%bcond_without sysffmpeg
## %if 0%{without sysffmpeg}
## %define ffmpeg_version 5.1.2-Nexus-Alpha3
## %endif

# kodi can be built without X support when openGL ES is used (mainly used on ARM boards used as media center)
%bcond_without kodi_with_X11
# Enable or disable Wayland depending on whether the stack is usable or not:
%if 0%{?suse_version} >= 1550
%bcond_without kodi_with_wayland
%else
%bcond_with kodi_with_wayland
%endif

%if 0%{?suse_version} < 1550
# Pipewire currently creates more issues than benefits; disable it for now:
%bcond_without kodi_without_pipewire
%else
# Leave PW enabled on Tumbleweed:
%bcond_with kodi_without_pipewire
%endif

%define kodi_platform none
%define kodi_player none

%if %{with kodi_with_X11}
%bcond_without enable_opengl
%bcond_with enable_opengles
%else
# no X build needs openGL ES
%bcond_with enable_opengl
%bcond_without enable_opengles
%endif
#
%bcond_without kodi_libbluray
# 
%bcond_without systemd

ExclusiveArch: %ix86 x86_64 %arm aarch64

Name:           kodi
Version:        21.1
Release:        0
Summary:        Media center (formerly known as XBMC)
License:        GPL-2.0+ and GPL-3.0+
Group:          Productivity/Multimedia/Video/Players
Url:            https://kodi.tv/
Source0:        https://github.com/xbmc/xbmc/archive/%{version}-%{kodi_version}.tar.gz
Source1:        kodi.SuSEFirewall2
# AUTO-GENERATED using get_version.sh
Source3:        kodi.VERSION
Source10:       kodi.service
Source11:       kodi-noX.service

# The following sources will be downloaded via _service's download_files:
Source20:       https://mirrors.kodi.tv/build-deps/sources/crossguid-ca1bf4b810e2d188d04cb6286f957008ee1b7681.tar.gz
Source21:	https://github.com/xbmc/libdvdnav/archive/refs/tags/6.1.1-Next-Nexus-Alpha2-2.tar.gz
Source22:	https://github.com/xbmc/libdvdcss/archive/refs/tags/1.4.3-Next-Nexus-Alpha2-2.tar.gz
Source23:       https://github.com/xbmc/libdvdread/archive/refs/tags/6.1.3-Next-Nexus-Alpha2-2.tar.gz
Source24:       https://mirrors.kodi.tv/build-deps/sources/libudfread-1.1.2.tar.gz
Source25:       https://mirrors.kodi.tv/build-deps/sources/apache-groovy-binary-4.0.16.zip

## %if 0%{without sysffmpeg}
## Source30:       https://github.com/xbmc/FFmpeg/archive/refs/tags/%{ffmpeg_version}.tar.gz
## %endif
Patch1:         0001-crossguid-dgb.patch
Patch2:         0002-kodi-install.patch
%if %{without kodi_with_wayland}
Patch3:         0003-kodi-disable-wayland.patch
%endif
%if %{without kodi_without_pipewire}
Patch4:         0004-kodi-workaround-pipewire-bug.patch
%endif

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  binutils-gold
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gawk
%if 0%{?suse_version} >= 1550 && 0%{?sle_version} == 0
# Use the default compiler on Tumbleweed
BuildRequires:	gcc
BuildRequires:  gcc-c++
%else
%if 0%{?suse_version} > 1320 && 0%{?sle_version} == 0
BuildRequires:	gcc9
BuildRequires:  gcc9-c++
%else
BuildRequires:  gcc8
BuildRequires:  gcc8-c++
%endif
%endif
BuildRequires:  ghostscript
BuildRequires:  graphviz
BuildRequires:  groff-full
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  flatbuffers-devel
BuildRequires:  pkgconfig(dav1d)
BuildRequires:  pkgconfig(fmt)
BuildRequires:  pkgconfig(fstrcmp)
BuildRequires:  pkgconfig(RapidJSON) >= 1.0.2
BuildRequires:  python(abi) >= 3.11
BuildRequires:  pkgconfig(python-3.11)
BuildRequires:  libmysqlclient-devel
BuildRequires:  pkgconfig(libass) >= 0.17.0
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  libgcrypt-devel
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  lzo-devel
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  tinyxml-devel
BuildRequires:  tinyxml2-devel
BuildRequires:  pkgconfig(uuid)
BuildRequires:  libyajl-devel >= 2
BuildRequires:  pkgconfig(libidn2)
BuildRequires:  pkgconfig(libinput)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libxslt)
BuildRequires:  pkgconfig(fribidi)
BuildRequires:  pkgconfig(sqlite3) 
BuildRequires:  pkgconfig(libpcrecpp)
BuildRequires:  pkgconfig(libpcre)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(taglib) >= 1.9
BuildRequires:  pkgconfig(libcdio) >= 2.1.0
BuildRequires:  pkgconfig(lirc)
BuildRequires:  pkgconfig(RapidJSON)
%if %{with kodi_libbluray}
BuildRequires:  pkgconfig(libbluray)  >= 0.9.3
%endif
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(dbus-1)
# libmicrohttpd > 0.9.30
BuildRequires:  pkgconfig(libmicrohttpd)
BuildRequires:  pkgconfig(libpulse) >= 1.0
BuildRequires:  pkgconfig(avahi-client)
BuildRequires:  pkgconfig(gbm)
%if %{with kodi_with_X11}
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(xkbcommon)
%endif
BuildRequires:  pkgconfig(libssh)
BuildRequires:  pkgconfig(smbclient)
BuildRequires:  pkgconfig(libnfs) >= 4.0.0
%if 0%{?suse_version} >= 1550 || ( 0%{?sle_version} >= 150400 && 0%{?is_opensuse} )
BuildRequires:  pkgconfig(libplist-2.0)
%else
BuildRequires:  pkgconfig(libplist)
%endif
BuildRequires:  shairplay-devel
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libcec) >= 4.0.0
BuildRequires:  pkgconfig(lcms2)
%if 0%{?suse_version} > 1315
BuildRequires:  pkgconfig(bluez)
%endif
BuildRequires:  libcap-devel
%if %{with sysffmpeg}
BuildRequires:  (pkgconfig(libavcodec) >= 60 with pkgconfig(libavcodec) < 61)
BuildRequires:  (pkgconfig(libavfilter) >= 9 with pkgconfig(libavfilter) < 10)
BuildRequires:  (pkgconfig(libavformat) >= 60 with pkgconfig(libavformat) < 61)
BuildRequires:  (pkgconfig(libavutil) >= 58 with pkgconfig(libavutil) < 59)
BuildRequires:  (pkgconfig(libpostproc) >= 57 with pkgconfig(libpostproc) < 58)
BuildRequires:  (pkgconfig(libswresample) >= 4 with pkgconfig(libswresample) < 5)
BuildRequires:  (pkgconfig(libswscale) >= 7 with pkgconfig(libswscale) < 8)
%else
BuildRequires:  ladspa-devel
BuildRequires:  libgsm-devel
BuildRequires:  pkg-config
BuildRequires:  yasm
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(celt) >= 0.11.0
BuildRequires:  pkgconfig(enca)
BuildRequires:  pkgconfig(fontconfig) >= 2.4.2
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(fribidi) >= 0.19.0
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libbluray)
BuildRequires:  pkgconfig(libcdio_paranoia)
BuildRequires:  pkgconfig(libdc1394-2)
BuildRequires:  pkgconfig(liboil-0.3) >= 0.3.15
BuildRequires:  pkgconfig(libopenjpeg)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libraw1394)
BuildRequires:  pkgconfig(libwebp) >= 0.4
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(opus)
BuildRequires:  pkgconfig(schroedinger-1.0)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(speex)
BuildRequires:  pkgconfig(theora) >= 1.1
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vpx) >= 1.3.0
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcb)
BuildRequires:  pkgconfig(xcb-render)
BuildRequires:  pkgconfig(xcb-shape)
BuildRequires:  pkgconfig(xcb-shm)
BuildRequires:  pkgconfig(xcb-xfixes)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(librtmp)
BuildRequires:  libmp3lame-devel
BuildRequires:  libxvidcore-devel
BuildRequires:  pkgconfig(opencore-amrnb)
BuildRequires:  pkgconfig(twolame)
BuildRequires:  pkgconfig(x264)
BuildRequires:  pkgconfig(x265)
%endif
BuildRequires:  swig
BuildRequires:  java
BuildRequires:  apache-commons-lang3
BuildRequires:  apache-commons-text
BuildRequires:  doxygen
%if %{with enable_opengl}
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(vdpau)
%if 0%{?suse_version} < 1500
BuildRequires:  pkgconfig(libva) >= 0.38
BuildRequires:  pkgconfig(libva-x11) >= 0.38
%else
BuildRequires:  pkgconfig(libva) >= 1.0.0
BuildRequires:  pkgconfig(libva-x11) >= 1.0.0
%endif
%endif
BuildRequires:  pkgconfig(libdisplay-info)
%if %{with kodi_with_wayland}
BuildRequires:  pkgconfig(libva-wayland)
BuildRequires:  pkgconfig(wayland-scanner)
BuildRequires:  pkgconfig(wayland-scanner++)
BuildRequires:  pkgconfig(wayland-protocols)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-client++)
BuildRequires:  pkgconfig(wayland-cursor++)
BuildRequires:  pkgconfig(wayland-egl++)
%endif
%if %{with enable_opengles}
%if "%{kodi_platform}" == "none"
BuildRequires:  Mesa-libEGL-devel
BuildRequires:  Mesa-libGLESv2-devel
%else
%if ("%{kodi_platform}" == "raspberry-pi") || ("%{kodi_platform}" == "raspberry-pi2")
BuildRequires:  raspberrypi-userland-devel
%endif
%endif
%endif
%if "%{kodi_player}" == "omxplayer"
Requires:       omxplayer
%endif
BuildRequires:  cmake
BuildRequires:  gperf
BuildRequires:  unzip
BuildRequires:  zip
BuildRequires:  nasm
%if %{dev_build}
BuildRequires:  ccache
%endif

# cpluff
BuildRequires:  pkgconfig(expat)

# TexturePacker
BuildRequires:  pkgconfig(libpng)
BuildRequires:  giflib-devel
BuildRequires:  libjpeg8-devel
BuildRequires:  lzo-devel
#
BuildRequires:  pkgconfig(spdlog) > 1.8.0
BuildRequires:  libunistring-devel

%if 0%{?suse_version} > 1510
BuildRequires:  pkgconfig(gtest)
%else
BuildRequires: googletest-devel
%endif

%if %{without kodi_without_pipewire}
# pipewire
BuildRequires: pkgconfig(libpipewire-0.3)
BuildRequires: pkgconfig(libspa-0.2)
%endif
#
%{?systemd_requires}

# kodi needs libnfs to access nfs sources, it is not automatically required
Requires:       libnfs
#
Obsoletes:      xbmc < %{version}
Provides:       xbmc = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{with kodi_with_X11}
Conflicts:      kodi
%else
Conflicts:      kodi-noX
%endif


%description
KODI media center is a free cross-platform media-player jukebox and
entertainment hub.  KODI can play a spectrum of of multimedia formats,
and featuring playlist, audio visualizations, slideshow, and weather
forecast functions, together third-party plugins.

%package devel
Summary:        Kodi Media center devel files
Group:          Development/Languages/C and C++
Requires:       %{name}
BuildArch:      noarch
%if %{with kodi_with_X11}
Conflicts:      kodi-devel
%else
Conflicts:      kodi-noX-devel
%endif

%description devel
Development files for Kodi Media Center

%prep
%setup -q -n xbmc-%{version}-%{kodi_version}
%autopatch -p1

%build

# Remove build time references so build-compare can do its work
date -u -r version.txt +%%Y%%m%%d | tee BUILDDATE 
FAKE_BUILDDATETIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes)
for file in xbmc/interfaces/python/PythonSwig.cpp.template ; do
  sed -i -e "/PyModule_AddStringConstant.*__date__/ s/\${new Date()\.toString()}/$FAKE_BUILDDATETIME/"  $file
done

# Set the final version string
cp %{SOURCE3} VERSION

# avoid long delays when powerkit isn't running
sed -i \
    -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
    xbmc/platform/linux/*.cpp

%if "%{kodi_platform}" == "raspberry-pi" || "%{kodi_platform}" == "raspberry-pi2"
export CXXFLAGS="$CXXFLAGS -I%{_includedir}/interface/vcos/pthreads -I%{_includedir}/interface/vmcs_host/linux"
%endif

%if 0%{?suse_version} >= 1550 && 0%{?sle_version} == 0
 export CC=gcc
 export CXX=g++
%else
%if 0%{?suse_version} > 1320 && 0%{?sle_version} == 0
 export CC=gcc-9
 export CXX=g++-9
%else
 export CC=gcc-8
 export CXX=g++-8
%endif
%endif

# Extract the groovy files to a proper place:
mkdir -p %{_builddir}/groovy
unzip %{SOURCE25} -d %{_builddir}/groovy
mv %{_builddir}/groovy/groovy-*/lib %{_builddir}/groovy
rm -rf %{_builddir}/groovy/groovy-* || true

%cmake \
%ifarch i586
    -DCMAKE_C_FLAGS='-msse' \
%endif
%if %{dev_build}
    -DVERBOSE=ON \
%endif
%if %{with kodi_with_wayland}
    -DWAYLANDPP_INCLUDE_DIR="$(pkg-config --cflags-only-I wayland-client++ | sed -e 's/^-I//;s/ -I/;/g;s/ $//')" \
%endif
    -DCMAKE_C_COMPILER=$CC \
    -DCMAKE_CXX_COMPILER=$CXX \
    -DENABLE_INTERNAL_FMT=OFF \
%if %{without sysffmpeg}
    -DENABLE_INTERNAL_FFMPEG=ON \
    -DFFMPEG_URL=%{SOURCE30} \
%else
    -DENABLE_INTERNAL_FFMPEG=OFF \
%endif
    -DENABLE_INTERNAL_CDIO=OFF \
    -DENABLE_INTERNAL_SPDLOG=OFF \
    -DCROSSGUID_URL=%{SOURCE20} \
    -DLIBDVDNAV_URL=%{SOURCE21} \
    -DLIBDVDCSS_URL=%{SOURCE22} \
    -DLIBDVDREAD_URL=%{SOURCE23} \
    -DENABLE_INTERNAL_RapidJSON=OFF \
    -DENABLE_INTERNAL_FLATBUFFERS=OFF \
    -DENABLE_INTERNAL_FSTRCMP=OFF \
    -DENABLE_INTERNAL_UDFREAD=ON \
    -DUDFREAD_URL=%{SOURCE24} \
    -Dgroovy_SOURCE_DIR=%{_builddir}/groovy \
    -Dapache-commons-lang_SOURCE_DIR=%{_datadir}/java \
    -Dapache-commons-text_SOURCE_DIR=%{_datadir}/java/apache-commons-text \
    -DAPP_RENDER_SYSTEM=gl \
    -DX11_RENDER_SYSTEM=gl \
    -DBUILD_SHARED_LIBS=1 \
    -DPYTHON_VER=3.11 \
%if %{with kodi_without_pipewire}
    -DENABLE_PIPEWIRE=OFF \
%endif
    ${NULL}

make -O %{?_smp_mflags} V=1 CC=$CC CXX=$CXX || l
rm -rf %{_builddir}/groovy

%install
pushd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
#make -C tools/EventClients DESTDIR=%%{buildroot} install %%{?_smp_mflags}

# Tumbleweed does not have SuSEfirewall anymore:
%if 0%{?is_opensuse} == 0 || 0%{?suse_version} < 1550
# SuSEfirewall service description
install -D -m 644 %{_sourcedir}/kodi.SuSEFirewall2 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/kodi
%endif

# Systemd service file
%if %{without kodi_with_X11}
install -m 0644 -D %{SOURCE11} %{buildroot}/%{_unitdir}/kodi-noX.service
%else
install -m 0644 -D %{SOURCE10} %{buildroot}/%{_unitdir}/kodi.service
%endif

# remove the doc files from unversioned /usr/share/doc/kodi, they should be in versioned docdir
rm -r %{buildroot}/%{_datadir}/doc/

# remove win32 source files
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.addon/dlfcn-win32.cpp
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.addon/dlfcn-win32.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.addon/dlfcn-win32.cpp
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.addon/dlfcn-win32.h

# remove duplicate header files
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.addon/libXBMC_addon.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.addon/libXBMC_addon.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.codec/libXBMC_codec.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.codec/libXBMC_codec.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.gui/libXBMC_gui.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.gui/libXBMC_gui.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.pvr/libXBMC_pvr.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.xbmc.pvr/libXBMC_pvr.h
rm -f %{buildroot}%{_kodi_addons_dir}/library.kodi.guilib/libKODI_guilib.h

# copy manpages
popd
install -m 644 -D docs/manpages/kodi-standalone.1 %{buildroot}%{_mandir}/man1/kodi-standalone.1
install -m 644 -D docs/manpages/kodi.bin.1 %{buildroot}%{_mandir}/man1/kodi.1

desktop-file-install \
 --dir=%{buildroot}%{_datadir}/applications \
 %{buildroot}%{_datadir}/applications/kodi.desktop

%if %{without kodi_with_wayland}
rm -f %{buildroot}%{_datadir}/wayland-sessions/kodi-gbm.desktop
rmdir -p %{buildroot}%{_datadir}/wayland-sessions || true
%endif

# TexturePacker likes to be installed as kodi-TexturePacker, too.
if [ -f %{buildroot}%{_bindir}/kodi-TexturePacker ] && [ -f %{buildroot}%{_bindir}/TexturePacker ]; then
    rm -f %{buildroot}%{_bindir}/TexturePacker
elif [ -f %{buildroot}%{_bindir}/TexturePacker ]; then
    mv %{buildroot}%{_bindir}/TexturePacker %{buildroot}%{_bindir}/kodi-TexturePacker
fi
%fdupes %{buildroot}

%pre
%service_add_pre kodi.service

%post
%service_add_post kodi.service

%preun
%service_del_preun kodi.service

%postun
%service_del_postun kodi.service

%files
%defattr(-,root,root)
%doc version.txt 
%if 0%{?is_opensuse} == 0 || 0%{?suse_version} < 1550
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/kodi
%endif
%{_bindir}/kodi
%{_bindir}/kodi-standalone
%{_bindir}/kodi-TexturePacker
%dir %{_libdir}/kodi
%if %{with kodi_with_X11}
%{_libdir}/kodi/kodi-xrandr
%{_libdir}/kodi/kodi.bin
%endif
%{_datadir}/xsessions/kodi.desktop
%if %{with kodi_with_wayland}
%dir %{_datadir}/wayland-sessions
%{_datadir}/wayland-sessions/kodi-gbm.desktop
%endif
%{_datadir}/applications/kodi.desktop
%{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml
%{_datadir}/icons/*
%dir %{_datadir}/kodi
%dir %{_datadir}/kodi/media
%dir %{_datadir}/kodi/system
%dir %{_libdir}/kodi/system
%dir %{_datadir}/kodi/userdata
%{_datadir}/kodi/media/*
%{_datadir}/kodi/system/*
%{_datadir}/kodi/privacy-policy.txt
%{_libdir}/kodi/system/*
%{_datadir}/kodi/userdata/*
%{_mandir}/man1/kodi.1.gz
%{_mandir}/man1/kodi-standalone.1.gz
%dir %{_kodi_addons_dir}
%dir %{_kodi_addons_dir}/game.controller.default
%{_kodi_addons_dir}/game.controller.default/*
%dir %{_kodi_addons_dir}/game.controller.keyboard
%{_kodi_addons_dir}/game.controller.keyboard/*
%dir %{_kodi_addons_dir}/game.controller.mouse
%{_kodi_addons_dir}/game.controller.mouse/*
%dir %{_kodi_addons_dir}/game.controller.snes
%{_kodi_addons_dir}/game.controller.snes/*
%dir %{_kodi_addons_dir}/metadata.album.universal/
%{_kodi_addons_dir}/metadata.album.universal/*
%dir %{_kodi_addons_dir}/metadata.artists.universal/
%{_kodi_addons_dir}/metadata.artists.universal/*
%dir %{_kodi_addons_dir}/metadata.common.allmusic.com/
%{_kodi_addons_dir}/metadata.common.allmusic.com/*
%dir %{_kodi_addons_dir}/metadata.common.fanart.tv/
%{_kodi_addons_dir}/metadata.common.fanart.tv/*
%dir %{_kodi_addons_dir}/metadata.common.musicbrainz.org/
%{_kodi_addons_dir}/metadata.common.musicbrainz.org/*
%dir %{_kodi_addons_dir}/metadata.common.theaudiodb.com/
%{_kodi_addons_dir}/metadata.common.theaudiodb.com/*
%dir %{_kodi_addons_dir}/metadata.local/
%{_kodi_addons_dir}/metadata.local/*
%dir %{_kodi_addons_dir}/metadata.themoviedb.org.python/
%{_kodi_addons_dir}/metadata.themoviedb.org.python/*
%dir %{_kodi_addons_dir}/metadata.tvshows.themoviedb.org.python/
%{_kodi_addons_dir}/metadata.tvshows.themoviedb.org.python/*
%dir %{_kodi_addons_dir}/repository.xbmc.org/
%{_kodi_addons_dir}/repository.xbmc.org/*
%dir %{_kodi_addons_dir}/resource.uisounds.kodi/
%{_kodi_addons_dir}/resource.uisounds.kodi/*
%dir %{_kodi_addons_dir}/screensaver.xbmc.builtin.black/
%{_kodi_addons_dir}/screensaver.xbmc.builtin.black/*
%dir %{_kodi_addons_dir}/screensaver.xbmc.builtin.dim/
%{_kodi_addons_dir}/screensaver.xbmc.builtin.dim/*
%dir %{_kodi_addons_dir}/script.module.pil/
%{_kodi_addons_dir}/script.module.pil/*
%dir %{_kodi_addons_dir}/service.xbmc.versioncheck/
%{_kodi_addons_dir}/service.xbmc.versioncheck/*
%dir %{_kodi_addons_dir}/webinterface.default/
%{_kodi_addons_dir}/webinterface.default/*
%dir %{_kodi_addons_dir}/xbmc.addon/
%{_kodi_addons_dir}/xbmc.addon/*
%dir %{_kodi_addons_dir}/xbmc.core/
%{_kodi_addons_dir}/xbmc.core/*
%dir %{_kodi_addons_dir}/xbmc.gui/
%{_kodi_addons_dir}/xbmc.gui/*
%dir %{_kodi_addons_dir}/xbmc.json/
%{_kodi_addons_dir}/xbmc.json/*
%dir %{_kodi_addons_dir}/xbmc.metadata/
%{_kodi_addons_dir}/xbmc.metadata/*
%dir %{_kodi_addons_dir}/xbmc.python/
%{_kodi_addons_dir}/xbmc.python/*
%dir %{_kodi_addons_dir}/audioencoder.kodi.builtin.aac/
%{_kodi_addons_dir}/audioencoder.kodi.builtin.aac/*
%dir %{_kodi_addons_dir}/audioencoder.kodi.builtin.wma/
%{_kodi_addons_dir}/audioencoder.kodi.builtin.wma/*
%dir %{_kodi_addons_dir}/kodi.resource/
%{_kodi_addons_dir}/kodi.resource/*
%dir %{_kodi_addons_dir}/resource.language.en_gb/
%{_kodi_addons_dir}/resource.language.en_gb/*
%dir %{_kodi_addons_dir}/xbmc.webinterface/
%{_kodi_addons_dir}/xbmc.webinterface/*
%dir %{_kodi_addons_dir}/resource.images.weathericons.default
%{_kodi_addons_dir}/resource.images.weathericons.default/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.inputstream/
%{_kodi_addons_dir}/kodi.binary.instance.inputstream/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.audioencoder/
%{_kodi_addons_dir}/kodi.binary.instance.audioencoder/*
%dir %{_kodi_addons_dir}/skin.estuary
%{_kodi_addons_dir}/skin.estuary/*
%dir %{_kodi_addons_dir}/kodi.binary.global.audioengine
%{_kodi_addons_dir}/kodi.binary.global.audioengine/*
%dir %{_kodi_addons_dir}/kodi.binary.global.filesystem
%{_kodi_addons_dir}/kodi.binary.global.filesystem/*
%dir %{_kodi_addons_dir}/kodi.binary.global.general
%{_kodi_addons_dir}/kodi.binary.global.general/*
%dir %{_kodi_addons_dir}/kodi.binary.global.gui
%{_kodi_addons_dir}/kodi.binary.global.gui/*
%dir %{_kodi_addons_dir}/kodi.binary.global.main
%{_kodi_addons_dir}/kodi.binary.global.main/*
%dir %{_kodi_addons_dir}/kodi.binary.global.network
%{_kodi_addons_dir}/kodi.binary.global.network/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.audiodecoder
%{_kodi_addons_dir}/kodi.binary.instance.audiodecoder/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.game
%{_kodi_addons_dir}/kodi.binary.instance.game/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.imagedecoder
%{_kodi_addons_dir}/kodi.binary.instance.imagedecoder/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.peripheral
%{_kodi_addons_dir}/kodi.binary.instance.peripheral/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.pvr
%{_kodi_addons_dir}/kodi.binary.instance.pvr/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.screensaver
%{_kodi_addons_dir}/kodi.binary.instance.screensaver/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.vfs
%{_kodi_addons_dir}/kodi.binary.instance.vfs/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.videocodec
%{_kodi_addons_dir}/kodi.binary.instance.videocodec/*
%dir %{_kodi_addons_dir}/kodi.binary.instance.visualization
%{_kodi_addons_dir}/kodi.binary.instance.visualization/*
%dir %{_kodi_addons_dir}/script.module.pycryptodome
%{_kodi_addons_dir}/script.module.pycryptodome/*
%dir %{_kodi_addons_dir}/metadata.generic.albums
%{_kodi_addons_dir}/metadata.generic.albums/*
%dir %{_kodi_addons_dir}/metadata.generic.artists
%{_kodi_addons_dir}/metadata.generic.artists/*
%dir %{_kodi_addons_dir}/kodi.binary.global.tools
%{_kodi_addons_dir}/kodi.binary.global.tools/*

%dir %{_libdir}/firewalld
%dir %{_libdir}/firewalld/services
%{_libdir}/firewalld/services/kodi-eventserver.xml
%{_libdir}/firewalld/services/kodi-http.xml
%{_libdir}/firewalld/services/kodi-jsonrpc.xml

%if %{without kodi_with_X11}
%{_unitdir}/kodi-noX.service
%else
%{_unitdir}/kodi.service
%endif

%dir %{_datadir}/kodi/cmake
%{_datadir}/kodi/cmake/AddonHelpers.cmake
%{_datadir}/kodi/cmake/AddOptions.cmake
%{_datadir}/kodi/cmake/ArchSetup.cmake
%{_datadir}/kodi/cmake/CheckCommits.cmake
%{_datadir}/kodi/cmake/CheckTargetPlatform.cmake
%{_datadir}/kodi/cmake/GenerateCompileInfo.cmake
%{_datadir}/kodi/cmake/GeneratorSetup.cmake
%{_datadir}/kodi/cmake/HandleDepends.cmake
%{_datadir}/kodi/cmake/Macros.cmake
%{_datadir}/kodi/cmake/PrepareEnv.cmake
%{_datadir}/kodi/cmake/ProjectMacros.cmake
%{_datadir}/kodi/cmake/PathSetup.cmake
%dir %{_libdir}/kodi/cmake
%{_libdir}/kodi/cmake/KodiConfig.cmake

%{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml

%files devel
%defattr(-,root,root)
%dir %{_includedir}/kodi
%dir %{_includedir}/kodi/tools
%{_includedir}/kodi/tools/DllHelper.h
%{_includedir}/kodi/AddonBase.h
%{_includedir}/kodi/AudioEngine.h
%{_includedir}/kodi/Filesystem.h
%{_includedir}/kodi/General.h
%{_includedir}/kodi/Network.h
%{_includedir}/kodi/versions.h
%dir %{_includedir}/kodi/addon-instance
%{_includedir}/kodi/addon-instance/*
%dir %{_includedir}/kodi/addon-instance/inputstream
%{_includedir}/kodi/addon-instance/inputstream/*
%dir %{_includedir}/kodi/addon-instance/peripheral
%{_includedir}/kodi/addon-instance/peripheral/*
%dir %{_includedir}/kodi/addon-instance/pvr
%{_includedir}/kodi/addon-instance/pvr/*
%dir %{_includedir}/kodi/c-api
%{_includedir}/kodi/c-api/*
%dir %{_includedir}/kodi/c-api/addon-instance
%{_includedir}/kodi/c-api/addon-instance/*
%dir %{_includedir}/kodi/c-api/addon-instance/inputstream
%{_includedir}/kodi/c-api/addon-instance/inputstream/*
%dir %{_includedir}/kodi/c-api/addon-instance/pvr
%{_includedir}/kodi/c-api/addon-instance/pvr/*
%dir %{_includedir}/kodi/c-api/gui
%{_includedir}/kodi/c-api/gui/*
%dir %{_includedir}/kodi/c-api/gui/controls
%{_includedir}/kodi/c-api/gui/controls/*
%dir %{_includedir}/kodi/c-api/gui/dialogs
%{_includedir}/kodi/c-api/gui/dialogs/*
%dir %{_includedir}/kodi/c-api/gui/input
%{_includedir}/kodi/c-api/gui/input/*
%dir %{_includedir}/kodi/c-api/platform
%dir %{_includedir}/kodi/c-api/platform/android
%{_includedir}/kodi/c-api/platform/android/*
%dir %{_includedir}/kodi/gui
%{_includedir}/kodi/gui/*
%dir %{_includedir}/kodi/gui/controls
%{_includedir}/kodi/gui/controls/*
%dir %{_includedir}/kodi/gui/dialogs
%{_includedir}/kodi/gui/dialogs/*
%dir %{_includedir}/kodi/gui/gl
%{_includedir}/kodi/gui/gl/*
%dir %{_includedir}/kodi/gui/input
%{_includedir}/kodi/gui/input/*
%dir %{_includedir}/kodi/platform
%dir %{_includedir}/kodi/platform/android
%{_includedir}/kodi/platform/android/System.h
%dir %{_includedir}/kodi/tools
%{_includedir}/kodi/tools/*

%changelog