Files
rpms/fedora/SPECS/kodi.spec

603 lines
16 KiB
RPMSpec

%global PRERELEASE r
%global myRELEASE 1
#global GITCOMMIT Gotham_r2-ge988513
# use the line below for pre-releases
%global DIRVERSION %{version}
%global _hardened_build 1
# We support hte following options:
# --with,
# * dvdcss - Include DVD decryption support
#
# Default: Do not ship DVD decryption for legal reasons
%bcond_with dvdcss
# Optional deps (not in EPEL)
%if 0%{?fedora}
# (libbluray in EPEL 6 is too old.)
%global _with_libbluray 1
%global _with_cwiid 1
%global _with_libssh 1
%global _with_libcec 1
%global _with_wayland 1
# only enable it, if you have a nvidia gpu!
%global _with_nvidia_ffmpeg 0
%endif
%if 0%{?_with_wayland}
%global kodi_backends x11 wayland gbm
%else
%global kodi_backends x11 gbm
%endif
Name: kodi
Version: 18.6
Release: 101.%{myRELEASE}.%{PRERELEASE}%{?dist}
Summary: Media center
License: GPLv2+ and GPLv3+ and LGPLv2+ and BSD and MIT
# Main binary and all supporting files are GPLv2+/GPLv3+
# Some supporting libraries use the LGPL / BSD / MIT license
Group: Applications/Multimedia
URL: http://www.kodi.tv/
Source0: %{name}-%{DIRVERSION}-patched.tar.xz
# kodi contains code that we cannot ship, as well as redundant private
# copies of upstream libraries that we already distribute. Therefore
# we use this script to remove the code before shipping it.
# Invoke this script while in the directory where the tarball is located:
# ./kodi-generate-tarball-xz.sh
Source1: kodi-generate-tarball-xz.sh
# kodi uses modified libdvd{css,nav,read} source and downloads at build time
# wget -O kodi-libdvdnav-6.0.0-Leia-Alpha-3.tar.gz https://github.com/xbmc/libdvdnav/archive/6.0.0-Leia-Alpha-3.tar.gz
Source2: kodi-libdvdnav-6.0.0-Leia-Alpha-3.tar.gz
# wget -O kodi-libdvdread-6.0.0-Leia-Alpha-3.tar.gz https://github.com/xbmc/libdvdread/archive/6.0.0-Leia-Alpha-3.tar.gz
Source3: kodi-libdvdread-6.0.0-Leia-Alpha-3.tar.gz
%if %{with dvdcss}
# wget -O kodi-libdvdcss-1.4.2-Leia-Beta-5.tar.gz https://github.com/xbmc/libdvdcss/archive/1.4.2-Leia-Beta-5.tar.gz
Source4: kodi-libdvdcss-1.4.2-Leia-Beta-5.tar.gz
%endif
# Set program version parameters
Patch1: kodi-18.0-versioning.patch
# Prevent trousers from being linked, which breaks Samba
Patch2: kodi-18-trousers.patch
# Fix an annobin issue
Patch3: kodi-18-annobin-workaround.patch
# Python 3 support
# https://github.com/xbmc/xbmc/commits/feature_python3
# https://github.com/xbmc/xbmc/issues/16560
Patch4: kodi-18-python3-0001.patch
Patch5: kodi-18-python3-0002.patch
%ifarch x86_64 i686
%global _with_crystalhd 1
%endif
# Upstream does not support ppc64
ExcludeArch: %{power64}
BuildRequires: SDL2-devel
BuildRequires: SDL_image-devel
BuildRequires: a52dec-devel
BuildRequires: afpfs-ng-devel
BuildRequires: alsa-lib-devel
BuildRequires: avahi-devel
BuildRequires: bluez-libs-devel
BuildRequires: boost-devel
BuildRequires: bzip2-devel
BuildRequires: cmake3
BuildRequires: crossguid-devel
%if 0%{?_with_cwiid}
BuildRequires: cwiid-devel
%endif
BuildRequires: dbus-devel
BuildRequires: desktop-file-utils
BuildRequires: e2fsprogs-devel
BuildRequires: enca-devel
BuildRequires: expat-devel
BuildRequires: faad2-devel
BuildRequires: firewalld-filesystem
%if 0%{?_with_nvidia_ffmpeg}
BuildRequires: ffmpeg-nvidia-devel
%else
BuildRequires: ffmpeg-devel
%endif
BuildRequires: flac-devel
BuildRequires: flatbuffers-devel
BuildRequires: flex
BuildRequires: fmt-devel
BuildRequires: fontconfig-devel
BuildRequires: fontpackages-devel
BuildRequires: freetype-devel
BuildRequires: fribidi-devel
BuildRequires: fstrcmp-devel
%if 0%{?el6}
BuildRequires: gettext-devel
%else
BuildRequires: gettext-autopoint
%endif
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: giflib-devel
BuildRequires: glew-devel
BuildRequires: glib2-devel
BuildRequires: gperf
BuildRequires: jasper-devel
BuildRequires: java-devel
BuildRequires: lame-devel
BuildRequires: lcms2-devel
BuildRequires: libXinerama-devel
BuildRequires: libXmu-devel
BuildRequires: libXrandr-devel
BuildRequires: libXtst-devel
BuildRequires: libass-devel >= 0.9.7
%if 0%{?_with_libbluray}
BuildRequires: libbluray-devel
%endif
BuildRequires: libcap-devel
BuildRequires: libcdio-devel
%if 0%{?_with_libcec}
%if 0%{?fedora} > 24
BuildRequires: libcec-devel >= 4.0.0
%else
BuildRequires: libcec-devel < 4.0.0
%endif
%endif
%if 0%{?_with_crystalhd}
BuildRequires: libcrystalhd-devel
%endif
BuildRequires: libcurl-devel
BuildRequires: libdca-devel
BuildRequires: libidn2-devel
BuildRequires: libinput-devel
%if 0%{?el6}
BuildRequires: libjpeg-devel
%else
BuildRequires: libjpeg-turbo-devel
%endif
BuildRequires: libmad-devel
BuildRequires: libmicrohttpd-devel
BuildRequires: libmms-devel
BuildRequires: libmodplug-devel
BuildRequires: libmpcdec-devel
BuildRequires: libmpeg2-devel
BuildRequires: libnfs-devel
BuildRequires: libogg-devel
# for AirPlay support
BuildRequires: shairplay-devel
BuildRequires: libplist-devel
BuildRequires: libpng-devel
BuildRequires: librtmp-devel
BuildRequires: libsamplerate-devel
BuildRequires: libsmbclient-devel
%if 0%{?_with_libssh}
BuildRequires: libssh-devel
%endif
BuildRequires: libtiff-devel
BuildRequires: libtool
BuildRequires: libunistring-devel
BuildRequires: libuuid-devel
BuildRequires: libva-devel
BuildRequires: libvdpau-devel
BuildRequires: libvorbis-devel
%if 0%{?_with_wayland}
BuildRequires: libxkbcommon-devel
%endif
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: lirc-devel
BuildRequires: lzo-devel
BuildRequires: mariadb-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: mesa-libGLES-devel
BuildRequires: mesa-libgbm-devel
BuildRequires: nasm
BuildRequires: ninja-build
BuildRequires: pcre-devel
BuildRequires: pixman-devel
BuildRequires: pulseaudio-libs-devel
%if 0%{?fedora} > 31
BuildRequires: python3-devel
BuildRequires: python3-pillow
%else
BuildRequires: python2-devel
BuildRequires: python2-pillow
%endif
BuildRequires: /usr/bin/pathfix.py
BuildRequires: rapidjson-devel
BuildRequires: sqlite-devel
BuildRequires: swig
BuildRequires: systemd-devel
BuildRequires: taglib-devel >= 1.10
BuildRequires: tinyxml-devel
BuildRequires: tre-devel
BuildRequires: wavpack-devel
%if 0%{?_with_wayland}
BuildRequires: wayland-protocols-devel
BuildRequires: waylandpp-devel
%endif
BuildRequires: yajl-devel
BuildRequires: zlib-devel
# Install major backends, users can remove them individually
Requires: %{name}-common = %{version}-%{release}
Requires: (%{name}-wayland = %{version}-%{release} if libwayland-server)
Requires: (%{name}-x11 = %{version}-%{release} if xorg-x11-server-Xorg)
Requires: (%{name}-firewalld = %{version}-%{release} if firewalld)
%if 0%{?_with_nvidia_ffmpeg}
Requires: ffmpeg-nvidia
Requires: ffmpeg-nvidia-libs
%else
Requires: ffmpeg
Requires: ffmpeg-libs
%endif
%description
Kodi 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.
This is a meta package.
%package common
Summary: Common Kodi files and binaries
Requires: dejavu-sans-fonts
# need explicit requires for these packages
# as they are dynamically loaded via XBMC's arcane
# pseudo-DLL loading scheme (sigh)
%if 0%{?_with_libbluray}
Requires: libbluray%{?_isa}
%endif
%if 0%{?_with_libcec}
%if 0%{?fedora} > 24
Requires: libcec%{?_isa} >= 4.0.0
%else
Requires: libcec%{?_isa} < 4.0.0
%endif
%endif
%if 0%{?_with_crystalhd}
Requires: libcrystalhd%{?_isa}
%endif
Requires: libmad%{?_isa}
Requires: librtmp%{?_isa}
Requires: shairplay-libs%{?_isa}
# needed when doing a minimal install, see
# https://bugzilla.rpmfusion.org/show_bug.cgi?id=1844
Requires: glx-utils
Requires: xorg-x11-utils
# This is just symlinked to, but needed both at build-time
# and for installation
%if 0%{?fedora} > 31
Requires: python3-pillow%{?_isa}
%else
Requires: python2-pillow%{?_isa}
%endif
%description common
Common Kodi files and binaries
%package devel
Summary: Development files needed to compile C programs against kodi
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: xbmc-devel < 14.0
Provides: xbmc-devel = %{version}
%description devel
Kodi is a free cross-platform media-player jukebox and entertainment hub.
If you want to develop programs which use Kodi's libraries, you need to
install this package.
%package eventclients
Summary: Media center event client remotes
Obsoletes: xbmc-eventclients < 14.0
Provides: xbmc-eventclients = %{version}
%description eventclients
This package contains support for using Kodi with the PS3 Remote, the Wii
Remote, a J2ME based remote and the command line xbmc-send utility.
%package eventclients-devel
Summary: Media center event client remotes development files
Requires: %{name}-eventclients%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Obsoletes: xbmc-eventclients-devel < 14.0
Provides: xbmc-eventclients-devel = %{version}
%description eventclients-devel
This package contains the development header files for the eventclients
library.
%package firewalld
Summary: FirewallD metadata files for Kodi
Requires: firewalld-filesystem
Requires(post): firewalld-filesystem
%description firewalld
This package contains FirewallD files for Kodi.
%package gbm
Summary: Kodi binary for Generic Buffer Management
Requires: %{name}-common = %{version}-%{release}
%description gbm
This package contains the Kodi binary for Generic Buffer Management.
%package wayland
Summary: Kodi binary for Wayland compositors
Requires: %{name}-common = %{version}-%{release}
%description wayland
This package contains the Kodi binary for Wayland compositors.
%package x11
Summary: Kodi binary for X11 servers
Requires: %{name}-common = %{version}-%{release}
%description x11
This package contains the Kodi binary for X11 servers.
%prep
%setup -q -n %{name}-%{DIRVERSION}
%patch1 -p1 -b.versioning
%patch2 -p1 -b.trousers
%if 0%{?fedora} > 29
%patch3 -p1 -b.innobinfix
%endif
%if 0%{?fedora} > 31
%patch4 -p1 -b.python3-0001
%patch5 -p1 -b.python3-0002
%endif
# Fix up Python shebangs
%if 0%{?fedora} > 31
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" \
%else
pathfix.py -pni "%{__python2} %{py2_shbang_opts}" \
%endif
tools/EventClients/lib/python/zeroconf.py \
tools/EventClients/Clients/PS3BDRemote/ps3_remote.py \
tools/EventClients/lib/python/ps3/sixaxis.py \
tools/EventClients/lib/python/ps3/sixpair.py \
tools/EventClients/lib/python/ps3/sixwatch.py \
tools/EventClients/Clients/KodiSend/kodi-send.py \
tools/EventClients/lib/python/xbmcclient.py
%if 0%{?fedora} < 32
# Fix python binary search
sed -i 's/ pkg_check_modules(PC_PYTHON python>=2.7 QUIET)/ pkg_check_modules(PC_PYTHON python=2.7 QUIET)/' cmake/modules/FindPython.cmake
%endif
%build
mkdir {fedora-gbm,fedora-wayland,fedora-x11}
for BACKEND in %{kodi_backends}
do
pushd fedora-$BACKEND
%cmake3 \
%if %{with dvdcss}
-DLIBDVDCSS_URL=%{SOURCE4} \
%else
-DENABLE_DVDCSS=OFF \
%endif
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-GNinja \
-DENABLE_EVENTCLIENTS=ON \
-DENABLE_INTERNAL_CROSSGUID=OFF \
-DLIRC_DEVICE=/var/run/lirc/lircd \
-DLIBDVDNAV_URL=%{SOURCE2} \
-DLIBDVDREAD_URL=%{SOURCE3} \
%if 0%{?fedora} > 31
-DPYTHON_EXECUTABLE=%{__python3} \
%else
-DPYTHON_EXECUTABLE=%{__python2} \
%endif
-DCORE_PLATFORM_NAME=$BACKEND \
%ifarch x86_64 i686
-DWAYLAND_RENDER_SYSTEM=gl \
-DGBM_RENDER_SYSTEM=gl \
%else
-DWAYLAND_RENDER_SYSTEM=gles \
-DGBM_RENDER_SYSTEM=gles \
%endif
../
%ninja_build
popd
done
%install
for BACKEND in %{kodi_backends}
do
pushd fedora-$BACKEND
%ninja_install
popd
done
# remove the doc files from unversioned /usr/share/doc/xbmc, they should be in versioned docdir
rm -r $RPM_BUILD_ROOT/%{_datadir}/doc/
#rm -f ${RPM_BUILD_ROOT}%{_libdir}/debug/usr/bin/*.debug
#/usr/lib/debug/usr/bin/kodi-wiiremote-18.4-99.1.r.fc31.x86_64.debug
desktop-file-install \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/kodi.desktop
# Stop shipping the duplicate xsession file
rm -f $RPM_BUILD_ROOT/%{_datadir}/xsessions/xbmc.desktop
# Normally we are expected to build these manually. But since we are using
# the system Python interpreter, we also want to use the system libraries
install -d $RPM_BUILD_ROOT%{_libdir}/kodi/addons/script.module.pil/lib
%if 0%{?fedora} > 31
ln -s %{python3_sitearch}/PIL $RPM_BUILD_ROOT%{_libdir}/kodi/addons/script.module.pil/lib/PIL
%else
ln -s %{python2_sitearch}/PIL $RPM_BUILD_ROOT%{_libdir}/kodi/addons/script.module.pil/lib/PIL
%endif
# Use external font files instead of bundled ones
ln -sf %{_fontbasedir}/dejavu/DejaVuSans-Bold.ttf ${RPM_BUILD_ROOT}%{_datadir}/kodi/addons/skin.estouchy/fonts/
# Move man-pages into system dir
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/
mv docs/manpages ${RPM_BUILD_ROOT}%{_mandir}/man1/
# Remove wiiremote man page if support was disabled
%if ! 0%{?_with_cwiid}
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/kodi-wiiremote.1
%endif
%post firewalld
%firewalld_reload
%files
%files common
%license LICENSE.md LICENSES/
%doc README.md docs
%{_bindir}/kodi
%{_bindir}/kodi-standalone
%{_bindir}/TexturePacker
%dir %{_libdir}/kodi/
%{_libdir}/kodi/addons/
%{_libdir}/kodi/system/
%{_datadir}/kodi/
%{_datadir}/xsessions/kodi.desktop
%{_datadir}/applications/kodi.desktop
%{_datadir}/icons/hicolor/*/*/*.png
%{_mandir}/man1/kodi.1.gz
%{_mandir}/man1/kodi.bin.1.gz
%{_mandir}/man1/kodi-standalone.1.gz
%files devel
%{_includedir}/kodi
%files eventclients
%license LICENSE.md LICENSES/
%if 0%{?fedora} > 31
%{python3_sitelib}/kodi
%else
%{python2_sitelib}/kodi
%endif
%dir %{_datadir}/pixmaps/kodi
%{_datadir}/pixmaps/kodi/*.png
%{_bindir}/kodi-ps3remote
%{_bindir}/kodi-send
%if 0%{?_with_cwiid}
%{_bindir}/kodi-wiiremote
%endif
%{_mandir}/man1/kodi-ps3remote.1.gz
%{_mandir}/man1/kodi-send.1.gz
%if 0%{?_with_cwiid}
%{_mandir}/man1/kodi-wiiremote.1.gz
%endif
%files eventclients-devel
%{_includedir}/kodi/xbmcclient.h
%files firewalld
%license LICENSE.md LICENSES/
%{_prefix}/lib/firewalld/services/kodi-eventserver.xml
%{_prefix}/lib/firewalld/services/kodi-http.xml
%{_prefix}/lib/firewalld/services/kodi-jsonrpc.xml
%files gbm
%{_libdir}/kodi/kodi-gbm
%files wayland
%{_libdir}/kodi/kodi-wayland
%files x11
%{_libdir}/kodi/kodi-x11
%{_libdir}/kodi/kodi-xrandr
%changelog
* Sat Apr 11 2020 Daniel Steiner <daniel.steiner@greenmail.ch>
- Nvidia dependencies removed.
* Sun Mar 8 2020 Daniel Steiner <daniel.steiner@greenmail.ch>
- Nvidia depend build with ffmpeg-nvidia library.
* Fri Mar 6 2020 Daniel Steiner <daniel.steiner@greenmail.ch>
- Update to 18.6
* Sat Nov 16 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- Update to 18.5
* Fri Nov 1 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- Build for FC31.
* Sat Sep 14 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- Update to 18.4
* Wed Jun 19 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- Update to 18.3
- Release increase to 99, using myRELEASE.
* Fri May 10 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- Update 18.2 to commit 5c09e9d
- Release increase to 99, using myRELEASE.
* Fri Feb 22 2019 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.1-1.60.final
- Update to Final 18.2.
* Fri Feb 22 2019 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.1-1.60.final
- Update to Final 18.1.
* Thu Jan 31 2019 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-1.60.final
- Update to Final 18.
* Sun Jan 13 2019 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.50.rc5
- Update to RC5
* Fri Jan 4 2019 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.21.rc4
- Update to RC4
* Wed Dec 19 2018 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.21.rc3
- Update to RC3
* Sat Dec 8 2018 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.21.rc2
- fmt library updated.
* Fri Dec 7 2018 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.20.rc2
- Update to RC2
* Sat Nov 10 2018 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.10.rc0
- Update to RC0
* Sun Nov 4 2018 Daniel Steiner <daniel.steiner@greenmail.ch> - 18.0-0.10.b5
- Update to beta5