%global _enable_debug_package 0 %global debug_package %{nil} %define rel 7 %define codename Omega #define kodi_rc rc2 %define kodi_dir xbmc-%{version}%{?kodi_rc:%{kodi_rc}}-%{codename} %if "%distro_section" == "tainted" %define with_dvdcss 1 %else %define with_dvdcss 0 %endif # Use bundled ffmpeg(1) or system ffmpeg(0) %define with_bundled_ffmpeg 1 %define _firewalld %{_prefix}/lib/firewalld Name: kodi Version: 21.2 Release: %mkrel %{?kodi_rc: -c %{kodi_rc}} %{rel} Summary: Kodi - media player and home entertainment system Group: Video/Players License: GPLv2+ and GPLv2 and (LGPLv3+ with exceptions) URL: https://kodi.tv Source0: https://github.com/xbmc/xbmc/archive/%{version}%{?kodi_rc:%{kodi_rc}}-%{codename}.tar.gz#/%{name}-%{version}%{?kodi_rc:%{kodi_rc}}-%{codename}.tar.gz Source2: https://github.com/xbmc/libdvdcss/archive/1.4.3-Next-Nexus-Alpha2-2.tar.gz#/libdvdcss-1.4.3-Next-Nexus-Alpha2-2.tar.gz Source3: https://github.com/xbmc/libdvdnav/archive/6.1.1-Next-Nexus-Alpha2-2.tar.gz#/libdvdnav-6.1.1-Next-Nexus-Alpha2-2.tar.gz Source4: https://github.com/xbmc/libdvdread/archive/6.1.3-Next-Nexus-Alpha2-2.tar.gz#/libdvdread-6.1.3-Next-Nexus-Alpha2-2.tar.gz %if %with_bundled_ffmpeg Source5: https://ffmpeg.org/releases/ffmpeg-6.0.1.tar.gz %endif # Build dependency ONLY # wget -O apache-groovy-binary-4.0.16.zip http://mirrors.kodi.tv/build-deps/sources/apache-groovy-binary-4.0.16.zip Source6: apache-groovy-binary-4.0.16.zip Source10: cpuinfo Source11: VERSION Patch3: kodi-19.0-remove-git-string.patch Patch5: cheat-sse-build.patch Patch6: kodi-fix-cmake-config-files-dir.patch Patch7: kodi-20.0b1-Nexus-mga-find-correct-crossguid-include.patch Patch8: kodi-21.1-less-Werror.patch Patch9: kodi-ffmpeg-sha512.patch # Upstream patches since release Patch50: 0001-Fix-build-with-PipeWire-1.4.0.patch Source51: 0001-Update-to-ffmpeg-7.1.patch # debian patches #Patch103: 0003-pcre2.patch BuildRequires: autoconf BuildRequires: cmake BuildRequires: ninja BuildRequires: pkgconfig(expat) %if !%with_bundled_ffmpeg BuildRequires: ffmpeg-devel %endif BuildRequires: pkgconfig(cwiid) BuildRequires: pkgconfig(libass) BuildRequires: pkgconfig(libcdio) BuildRequires: crossguid-devel BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(flatbuffers) BuildRequires: cmake(fmt) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(dvdread) BuildRequires: pkgconfig(dvdnav) BuildRequires: pkgconfig(lzo2) BuildRequires: pkgconfig(openssl) #BuildRequires: pkgconfig(libpcre2-8) BuildRequires: pkgconfig(libpcrecpp) BuildRequires: rapidjson BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(taglib) >= 2 BuildRequires: pkgconfig(tinyxml) BuildRequires: pkgconfig(tinyxml2) BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(avahi-client) BuildRequires: pkgconfig(avahi-core) BuildRequires: pkgconfig(bluez) BuildRequires: pkgconfig(libbluray) BuildRequires: pkgconfig(libcap) BuildRequires: pkgconfig(libcec) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(liblircclient0) BuildRequires: pkgconfig(libmicrohttpd) BuildRequires: pkgconfig(libnfs) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(smbclient) BuildRequires: pkgconfig(sndio) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(libxslt) BuildRequires: graphviz BuildRequires: doxygen BuildRequires: mesaegl-devel BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(mariadb) BuildRequires: pkgconfig(libplist-2.0) BuildRequires: pkgconfig(libupnp) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(dvdnav) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(uuid) BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(zlib) BuildRequires: giflib-devel BuildRequires: git-core BuildRequires: glibc-devel # Build fails with java 21 #BuildRequires: java-openjdk-headless BuildRequires: java-17-openjdk-headless BuildRequires: apache-commons-lang3 BuildRequires: apache-commons-text BuildRequires: shairplay-devel BuildRequires: swig BuildRequires: yasm BuildRequires: pkgconfig(fstrcmp) BuildRequires: pkgconfig(spdlog) BuildRequires: pkgconfig(libudfread) BuildRequires: pkgconfig(vdpau) BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(wavpack) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-client++) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(libinput) BuildRequires: pkgconfig(libdisplay-info) BuildRequires: nasm Requires: lsb-release # TODO: FEH.py is useless nowadays, drop it here and upstream. # for FEH.py, to check current configuration is ok for xbmc: Requires: xdpyinfo Requires: glxinfo # for xbmc python scripts: Requires: python3dist(pillow) Provides: xbmc = %{version}-%{release} %description Kodi is an award-winning free and open source software media player and entertainment hub for digital media. While Kodi functions very well as a standard media player application for your computer, it has been designed to be the perfect companion for your HTPC. Supporting an almost endless range of remote controls, and combined with its beautiful interface and powerful skinning engine, Kodi feels very natural to use from the couch and is the ideal solution for your home theater. %if %with_dvdcss The tainted package contains support for DVDCSS. %endif %package firewalld-services Summary: Firewall services for Kodi Group: Video/Players License: GPLv2+ BuildArch: noarch Requires(pre): firewalld-filesystem Requires: %{name} >= %{version}-%{release} %description firewalld-services Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the firewall services for Kodi. %package addon-devel Summary: Development files for Kodi Group: Development/C License: GPLv2+ Provides: %{name}-devel = %{version}-%{release} %description addon-devel Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains files needed to build addons and eventclients. %package eventclients-common Summary: Common files for Kodi eventclients Group: Video/Players License: GPLv2+ Requires: %{name} = %{version}-%{release} Requires: %{name}-python = %{version}-%{release} %description eventclients-common Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains common files for eventclients. %package eventclient-ps3 Summary: PS3 eventclients for Kodi Group: Video/Players License: GPLv2+ Requires: python3dist(pybluez) Requires: %{name}-eventclients-common = %{version}-%{release} # requires via zeroconf.py, only used by xbmc-ps3d: Requires: python3-gobject Requires: python3dist(dbus-python) %description eventclient-ps3 Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the PS3 remote and sixaxis eventclients. %package eventclient-wiiremote Summary: Wii Remote eventclient for Kodi Group: Video/Players License: GPLv3+ Requires: %{name}-eventclients-common = %{version}-%{release} %description eventclient-wiiremote Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the Wii Remote eventclient. %package eventclient-%{name}-send Summary: PS3 eventclient for Kodi Group: Video/Players License: GPLv2+ Requires: %{name}-eventclients-common = %{version}-%{release} %description eventclient-%{name}-send Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the %{name}-send eventclient. %package python-bt Summary: Bluetooth Python scripts for Kodi Group: Video/Players License: GPLv2+ Requires: %{name} >= %{version}-%{release} BuildArch: noarch %description python-bt Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the bluetooth python scripts. %package python Summary: Common Python scripts for Kodi Group: Video/Players License: GPLv2+ Requires: %{name} >= %{version}-%{release} BuildArch: noarch %description python Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the common python scripts for Kodi. %package python-xbmcclient Summary: XBMCClient Python scripts for Kodi Group: Video/Players License: GPLv2+ Requires: %{name} >= %{version}-%{release} BuildArch: noarch %description python-xbmcclient Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the xbmcclient python scripts. %package python-zeroconf Summary: Zeroconf Python scripts for Kodi Group: Video/Players License: GPLv2+ Requires: %{name} >= %{version}-%{release} BuildArch: noarch %description python-zeroconf Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the zeroconf python scripts. %package texturepacker Summary: Zeroconf Python scripts for Kodi Group: Video/Players License: GPLv2+ Requires: %{name} = %{version}-%{release} %description texturepacker Kodi is an award-winning free and open source software media player and entertainment hub for digital media. This package contains the Texturepacker program for Kodi. %prep %autosetup -p1 -n %{kodi_dir} pushd .. unzip %{S:6} popd cp -a %{S:10} %{S:11} . %if %with_bundled_ffmpeg cp -a %{S:5} tools/depends/target/ffmpeg/ %endif # CPU flags %ifarch %{ix86} sed -i -e 's/@FLAGS@/sse sse2/' cpuinfo %else sed -i -e 's/@FLAGS@/sse sse2 pni ssse3 sse4_1 sse4_2 avx avx2/' cpuinfo %endif # otherwise backups end up in binary rpms find -type f \( -name '*.00??' -o -name '*.00??~' \) -print -delete # remove prebuilt libraries find -type f \( -iname '*.so' -o -iname '*.dll' -o -iname '*.exe' \) -print -delete %py3_shebang_fix \ addons lib tools # We don't want Kodi to check if a new version is available # because we want to control the updates rm -rf addons/service.xbmc.versioncheck %build export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 export PKGCONFIGPATH=${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_prefix}/lib export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_prefix}/lib export JAVA_HOME=%{_prefix} %ifarch %ix86 %global debugcflags -g1 %endif %global optflags %{optflags} -Wno-missing-field-initializers %cmake -GNinja \ -DENABLE_INTERNAL_CROSSGUID=OFF \ -DENABLE_INTERNAL_CEC=OFF \ -DENABLE_INTERNAL_FSTRCMP=OFF \ -DENABLE_INTERNAL_DAV1D=OFF \ -DENABLE_INTERNAL_UDFREAD=OFF \ -DENABLE_INTERNAL_GTEST=OFF \ -DENABLE_INTERNAL_RapidJSON=OFF \ -DENABLE_INTERNAL_FLATBUFFERS=OFF \ -DENABLE_INTERNAL_FMT=OFF \ -DENABLE_INTERNAL_GTEST=OFF \ -DENABLE_INTERNAL_TAGLIB=OFF \ -DENABLE_EVENTCLIENTS=ON \ -DENABLE_UDFREAD=ON \ -DENABLE_LIRCCLIENT=ON \ -DENABLE_CCACHE=OFF \ -DENABLE_TESTING=OFF \ -DVERBOSE=ON \ -DFREETYPE_INCLUDE_DIR=%{_includedir}/freetype2 \ -DLIBDVD_LIBRARIES=%{_libdir} \ %if %with_bundled_ffmpeg -DENABLE_INTERNAL_FFMPEG=ON \ -DFFMPEG_URL=%{S:5} \ %else -DENABLE_INTERNAL_FFMPEG=OFF \ -DFFMPEG_PATH=%{_bindir} \ -DWITH_FFMPEG=%{_bindir} \ %endif %if %with_dvdcss -DLIBDVDCSS_URL=%{SOURCE2} \ -DENABLE_DVDCSS=ON \ %else -DENABLE_DVDCSS=OFF \ %endif -Dgroovy_SOURCE_DIR=%{_builddir}/groovy-4.0.16 \ -Dapache-commons-lang_SOURCE_DIR=%{_javadir} \ -Dapache-commons-text_SOURCE_DIR=%{_javadir}/apache-commons-text \ -DAPP_RENDER_SYSTEM=gl \ -DKODI_DEPENDSBUILD=OFF \ -DLIBDVDREAD_URL=%{S:4} \ -DLIBDVDNAV_URL=%{S:3} \ -DPYTHON_EXECUTABLE=%{python3} %cmake_build %install %cmake_install rm -rf %{buildroot}%{_datadir}/kodi/system/certs/ # A hack to put the 'addons' dir in the place Kodi # looks for it pushd %{buildroot}%{_libdir}/%{name} ln -s ../../share/kodi/addons popd # Remove duplicate binary rm -f %{buildroot}%{_bindir}/TexturePacker %clean rm -f /tmp/cpuinfo %files texturepacker %{_bindir}/kodi-TexturePacker %files %{_bindir}/%{name} %{_bindir}/%{name}-standalone %{_libdir}/%{name}/ %exclude %{_datadir}/%{name}/cmake/ %exclude %{_libdir}/%{name}/cmake/ %{_datadir}/applications/%{name}.desktop %{_datadir}/wayland-sessions/kodi-gbm.desktop %{_datadir}/xsessions/%{name}.desktop %{_docdir}/%{name}/ %{_iconsdir}/hicolor/*/apps/%{name}.png %{_iconsdir}/hicolor/scalable/apps/%{name}.svg %{_datadir}/%{name}/ %{_metainfodir}/org.xbmc.kodi.metainfo.xml %files firewalld-services %{_firewalld}/services/%{name}-eventserver.xml %{_firewalld}/services/%{name}-http.xml %{_firewalld}/services/%{name}-jsonrpc.xml %files addon-devel %{_includedir}/%{name}/ %{_datadir}/cmake/%{name}/ %{_libdir}/cmake/%{name}/ %files eventclients-common %dir %{_datadir}/pixmaps/%{name} %{_datadir}/pixmaps/%{name}/*.png %files eventclient-ps3 %{_bindir}/%{name}-ps3remote %dir %{python3_sitearch}/%{name} %dir %{python3_sitearch}/%{name}/__pycache__ %{python3_sitearch}/%{name}/ps3/ %{python3_sitearch}/%{name}/ps3_remote.* %{python3_sitearch}/%{name}/__pycache__/ps3* %files eventclient-%{name}-send %{_bindir}/%{name}-send %files eventclient-wiiremote %{_bindir}/kodi-wiiremote %files python-bt %dir %{python3_sitearch}/%{name} %{python3_sitearch}/%{name}/bt/ %files python %dir %{python3_sitearch}/%{name} %dir %{python3_sitearch}/%{name}/__pycache__ %{python3_sitearch}/%{name}/defs.* %{python3_sitearch}/%{name}/__init__.* %{python3_sitearch}/%{name}/__pycache__/__init* %{python3_sitearch}/%{name}/__pycache__/defs* %files python-xbmcclient %dir %{python3_sitearch}/%{name} %dir %{python3_sitearch}/%{name}/__pycache__ %{python3_sitearch}/%{name}/xbmcclient.* %{python3_sitearch}/%{name}/__pycache__/xbmc* %files python-zeroconf %dir %{python3_sitearch}/%{name} %dir %{python3_sitearch}/%{name}/__pycache__ %{python3_sitearch}/%{name}/zeroconf.* %{python3_sitearch}/%{name}/__pycache__/zero*