2 # - fix build flags - some files are compiled with -O3 and without rpm*flags
3 # - add and/or fix users/groups permissions
4 # - split to subpackages?
5 # - bundled ffmpeg build (tools/depends/target/ffmpeg/autobuild.sh) enables nonfree & gpl!
9 %bcond_with airtunes # AirTunes support
10 %bcond_without dvdcss # DVDCSS support
11 %bcond_without gbm # GBM platform
12 %bcond_without optical_drive # optical drive
13 %bcond_without upnp # UPnP support
14 %bcond_without x11 # X11 platform
15 %ifarch %{arm} aarch64
16 %bcond_without gles # OpenGL rendering
18 %bcond_with gles # OpenGLES rendering
20 %bcond_with gold # Use gold linker
21 %bcond_without wayland # Wayland platform
23 %bcond_without system_ffmpeg # build with system ffmpeg
25 %bcond_with avx # use AVX instructions
26 %bcond_with avx2 # use AVX2 instructions
27 %bcond_with neon # use NEON instructions
28 %bcond_with sse # use SSE instructions
29 %bcond_with sse2 # use SSE2 instructions
30 %bcond_with sse3 # use SSE3 instructions
31 %bcond_with ssse3 # use SSSE3 instructions
32 %bcond_with sse41 # use SSE4.1 instructions
33 %bcond_with sse42 # use SSE4.2 instructions
35 %ifarch %{arm_with_neon}
38 %ifarch %{x86_with_sse}
41 %ifarch %{x86_with_sse2}
45 %define kodi_arch x86_64-linux
48 %define kodi_arch i486-linux
50 %ifnarch %{x8664} %{x86} x32
51 %define kodi_arch %{_target_base_arch}
54 %define dvdread_ver 6.1.3-Next-Nexus-Alpha2-2
55 %define dvdcss_ver 1.4.3-Next-Nexus-Alpha2-2
56 %define dvdnav_ver 6.1.1-Next-Nexus-Alpha2-2
58 %define codename Omega
59 Summary: Kodi is a free and open source media-player and entertainment hub
63 License: GPL v2+ and GPL v3+
64 Group: Applications/Multimedia
65 #Source0Download: https://github.com/xbmc/xbmc/releases
66 Source0: https://github.com/xbmc/xbmc/archive/%{version}-%{codename}.tar.gz
67 # Source0-md5: 74501a89f0ea23d2908a9b983ab3d6f8
68 Source1: https://github.com/xbmc/libdvdread/archive/%{dvdread_ver}/libdvdread-%{dvdread_ver}.tar.gz
69 # Source1-md5: 0d24c950abfef9dc02e231dda56912ac
70 Source2: https://github.com/xbmc/libdvdcss/archive/%{dvdcss_ver}/libdvdcss-%{dvdcss_ver}.tar.gz
71 # Source2-md5: 42dc3770ae928103e8033a18b007e79d
72 Source3: https://github.com/xbmc/libdvdnav/archive/%{dvdnav_ver}/libdvdnav-%{dvdnav_ver}.tar.gz
73 # Source3-md5: 2349cde54d950af21fa4936371ad3349
74 Patch0: disable-static.patch
75 Patch1: xbmc-libfmt.patch
77 BuildRequires: EGL-devel
78 %{?with_gbm:BuildRequires: Mesa-libgbm-devel}
79 # for eglextchromium.h
80 %{?with_x11:BuildRequires: Mesa-libEGL-devel}
82 BuildRequires: OpenGL-GLU-devel
83 BuildRequires: OpenGL-devel
85 BuildRequires: OpenGL-GLX-devel
88 %{?with_gles:BuildRequires: OpenGLES-devel}
89 BuildRequires: alsa-lib-devel >= 1.0.27
90 BuildRequires: autoconf
91 BuildRequires: automake
92 BuildRequires: avahi-devel
93 BuildRequires: bluez-libs-devel >= 4.99
94 BuildRequires: cmake >= 3.15
95 BuildRequires: crossguid-devel
96 BuildRequires: curl-devel
97 %{!?with_system_ffmpeg:BuildRequires: dav1d-devel}
98 BuildRequires: dbus-devel
99 # libavcodec >= 60.2.100 libavfilter >= 9.3.100 libavformat >= 60.3.100 libavutil >= 58.2.100 libpostproc >= 57.1.100 libswscale >= 7.1.100 libswresample >= 4.10.100
100 %{?with_system_ffmpeg:BuildRequires: ffmpeg-devel >= 6.0.0}
101 BuildRequires: flatbuffers-devel >= 1.9.0
102 BuildRequires: fontconfig-devel
103 BuildRequires: freetype-devel
104 BuildRequires: fribidi-devel
105 BuildRequires: fstrcmp-devel >= 0.7
106 BuildRequires: gettext-tools
107 BuildRequires: giflib-devel >= 5
108 BuildRequires: harfbuzz-devel
110 BuildRequires: lcms2-devel
111 BuildRequires: libass-devel >= 0.15.0
112 BuildRequires: libatomic-devel
113 BuildRequires: libbluray-devel >= 0.9.3
114 BuildRequires: libcap-devel
115 BuildRequires: libcdio-c++-devel >= 2.1.0
116 BuildRequires: libcdio-devel >= 2.1.0
117 BuildRequires: libcec-devel >= 4.0.0
118 BuildRequires: libdisplay-info-devel
119 BuildRequires: libdrm-devel >= 2.4.95
120 BuildRequires: libfmt-devel >= 6.1.2
121 %{?with_gbm:BuildRequires: libinput-devel}
122 BuildRequires: libjpeg-devel
123 BuildRequires: libmicrohttpd-devel >= 0.9.40
124 BuildRequires: libnfs-devel
125 BuildRequires: libplist-devel >= 2.0
126 BuildRequires: libpng-devel
127 BuildRequires: libsmbclient-devel
128 BuildRequires: libstdc++-devel >= 6:5
129 BuildRequires: libtool
130 BuildRequires: libudfread-devel >= 1.0.0
131 BuildRequires: libuuid-devel
132 BuildRequires: libva-devel
133 BuildRequires: libva-drm-devel
134 %{?with_wayland:BuildRequires: libva-wayland-devel}
135 %{?with_x11:BuildRequires: libva-x11-devel}
136 %if %{with x11} && %{without gles}
137 BuildRequires: libvdpau-devel
139 BuildRequires: libxml2-devel >= 2.0
140 BuildRequires: libxslt-devel
141 BuildRequires: lirc-devel
142 BuildRequires: lzo-devel >= 2
143 BuildRequires: mysql-devel
144 BuildRequires: openssl-devel >= 1.1.0
145 BuildRequires: pcre-cxx-devel
146 BuildRequires: pipewire-devel >= 0.3.50
147 BuildRequires: pkgconfig
148 BuildRequires: pulseaudio-devel >= 11.0.0
149 BuildRequires: python3-devel >= 1:3.8
150 BuildRequires: rapidjson-devel >= 1.1.0
151 BuildRequires: rpm-build >= 4.6
152 BuildRequires: rpm-pythonprov
153 BuildRequires: rpmbuild(macros) >= 2.007
154 BuildRequires: sed >= 4.0
155 BuildRequires: spdlog-devel >= 1.5.0
156 BuildRequires: sqlite3-devel
158 BuildRequires: taglib-devel >= 1.9.0
159 BuildRequires: tinyxml-devel
160 BuildRequires: tinyxml2-devel
161 BuildRequires: udev-devel
163 BuildRequires: wayland-protocols >= 1.7
164 BuildRequires: waylandpp-devel >= 0.2.2
167 BuildRequires: xorg-lib-libX11-devel
168 BuildRequires: xorg-lib-libXext-devel
169 BuildRequires: xorg-lib-libXrandr-devel
171 %if %{with gbm} || %{with wayland}
172 BuildRequires: xorg-lib-libxkbcommon-devel >= 0.4.1
174 BuildRequires: zlib-devel
175 Requires: %{name}-common = %{version}-%{release}
176 Requires: alsa-lib >= 1.0.27
177 Requires: desktop-file-utils
178 Requires: ffmpeg-libs >= 6.0.0
179 Requires: hicolor-icon-theme
180 Requires: libass >= 0.15.0
181 Requires: libbluray >= 0.9.3
182 Requires: libcdio >= 2.1.0
183 Requires: libcdio-c++ >= 2.1.0
184 Requires: libcec >= 4.0.0
185 Requires: libdrm >= 2.4.95
186 Requires: libfmt >= 6.1.2
187 Requires: libmicrohttpd >= 0.9.40
188 Requires: libplist >= 2.0
189 Requires: libudfread >= 1.0.0
190 Requires: lsb-release
191 Requires: openssl >= 1.1.0
192 Requires: pipewire-libs >= 0.3.50
193 Requires: pulseaudio-libs >= 11.0.0
194 Requires: spdlog >= 1.5.0
195 Requires: taglib >= 1.9.0
196 Requires: tinyxml >= 2.6.2
197 %{?with_wayland:Requires: waylandpp >= 0.2.2}
198 %if %{with gbm} || %{with wayland}
199 Requires: xorg-lib-libxkbcommon >= 0.4.1
201 Obsoletes: xbmc < 14.0
202 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
204 # debug enabled causes oom on i686/x32
205 %define _enable_debug_packages 0
208 Kodi Entertainment Center (formerly XBMC) is a free and open-source
209 media player software developed by the XBMC Foundation, a non-profit
210 technology consortium. Kodi is available for multiple operating
211 systems and hardware platforms, with a software 10-foot user interface
212 for use with televisions and remote controls. It allows users to play
213 and view most videos, music, such as podcasts from the internet, and
214 all common digital media files from local and network storage media.
217 Summary: Common files for Kodi
220 Common files for Kodi.
223 Summary: Header files for Kodi
224 Group: Development/Libraries
225 Requires: %{name}-common = %{version}-%{release}
228 Header files for Kodi.
231 %setup -q -n xbmc-%{version}-%{codename} -a1 -a2 -a3
237 %if %{without system_ffmpeg}
238 #ln -s %{SOURCE1} tools/depends/target/ffmpeg/ffmpeg-2.4.4-%{codename}.tar.gz
242 grep -q '^VERSION=%{dvdread_ver}$' tools/depends/target/libdvdread/LIBDVDREAD-VERSION
243 grep -q '^VERSION=%{dvdcss_ver}$' tools/depends/target/libdvdcss/LIBDVDCSS-VERSION
244 grep -q '^VERSION=%{dvdnav_ver}$' tools/depends/target/libdvdnav/LIBDVDNAV-VERSION
247 -DHOST_CAN_EXECUTE_TARGET:BOOL=TRUE \
248 -DLIBDVDREAD_SOURCE_DIR=$(pwd)/libdvdread-%{dvdread_ver} \
249 -DLIBDVDCSS_SOURCE_DIR=$(pwd)/libdvdcss-%{dvdcss_ver} \
250 -DLIBDVDNAV_SOURCE_DIR=$(pwd)/libdvdnav-%{dvdnav_ver} \
251 -DAPP_RENDER_SYSTEM=%{!?with_gles:gl}%{?with_gles:gles} \
252 -DCORE_PLATFORM_NAME="%{?with_gbm:GBM;}%{?with_x11:X11;}%{?with_wayland:WAYLAND;}" \
253 %{cmake_on_off airtunes ENABLE_AIRTUNES} \
254 %{cmake_on_off dvdcss ENABLE_DVDCSS} \
255 -DENABLE_INTERNAL_CEC:BOOL=OFF \
256 -DENABLE_INTERNAL_CROSSGUID:BOOL=OFF \
257 -DENABLE_INTERNAL_DAV1D:BOOL=OFF \
258 -DENABLE_INTERNAL_FFMPEG:BOOL=%{?with_system_ffmpeg:OFF}%{!?with_system_ffmpeg:ON} \
259 -DENABLE_INTERNAL_FLATBUFFERS:BOOL=OFF \
260 -DENABLE_INTERNAL_FMT:BOOL=OFF \
261 -DENABLE_INTERNAL_FSTRCMP:BOOL=OFF \
262 -DENABLE_INTERNAL_NFS:BOOL=OFF \
263 -DENABLE_INTERNAL_PCRE:BOOL=OFF \
264 -DENABLE_INTERNAL_RapidJSON:BOOL=OFF \
265 -DENABLE_INTERNAL_SPDLOG:BOOL=OFF \
266 -DENABLE_INTERNAL_TAGLIB:BOOL=OFF \
267 -DENABLE_INTERNAL_UDFREAD:BOOL=OFF \
268 %{cmake_on_off gold ENABLE_GOLD} \
269 -DENABLE_TESTING:BOOL=OFF \
270 %{cmake_on_off optical_drive ENABLE_OPTICAL} \
271 %{cmake_on_off upnp ENABLE_UPNP} \
272 %{cmake_on_off avx ENABLE_AVX} \
273 %{cmake_on_off avx2 ENABLE_AVX2} \
274 %{cmake_on_off neon ENABLE_NEON} \
275 %{cmake_on_off sse ENABLE_SSE} \
276 %{cmake_on_off sse2 ENABLE_SSE2} \
277 %{cmake_on_off sse3 ENABLE_SSE3} \
278 %{cmake_on_off ssse3 ENABLE_SSSE3} \
279 %{cmake_on_off sse41 ENABLE_SSE4_1} \
280 %{cmake_on_off sse42 ENABLE_SSE4_2} \
281 -DWITH_ARCH=%{kodi_arch} \
282 -DWITH_CPU=%{_target_cpu}
287 rm -rf $RPM_BUILD_ROOT
289 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/addons
291 %{__make} -C build install \
292 DESTDIR=$RPM_BUILD_ROOT
294 %{__rm} $RPM_BUILD_ROOT%{_docdir}/{version.txt,README.Linux.md,LICENSE.md}
297 %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/kodi-*.xml
299 # same as kodi-TexturePacker
300 %{__rm} $RPM_BUILD_ROOT%{_bindir}/TexturePacker
303 rm -rf $RPM_BUILD_ROOT
306 %update_icon_cache hicolor
307 %update_desktop_database
310 %update_icon_cache hicolor
311 %update_desktop_database_postun
314 %defattr(644,root,root,755)
315 %doc README.md docs/README.Linux.md
316 %attr(755,root,root) %{_bindir}/kodi
317 %attr(755,root,root) %{_bindir}/kodi-TexturePacker
318 %attr(755,root,root) %{_bindir}/kodi-standalone
319 %{_datadir}/%{name}/addons
320 %{_datadir}/%{name}/media
321 %{_datadir}/%{name}/privacy-policy.txt
322 %{_datadir}/%{name}/system
323 %{_datadir}/%{name}/userdata
324 %attr(755,root,root) %{_libdir}/%{name}/%{name}.bin
325 %{?with_x11:%attr(755,root,root) %{_libdir}/%{name}/%{name}-xrandr}
326 %dir %{_libdir}/%{name}/addons
327 %dir %{_libdir}/%{name}/system
328 %dir %{_libdir}/%{name}/system/players
329 %dir %{_libdir}/%{name}/system/players/VideoPlayer
330 %attr(755,root,root) %{_libdir}/%{name}/system/players/VideoPlayer/libdvdnav-%{kodi_arch}.so
331 %{_desktopdir}/kodi.desktop
332 %{_iconsdir}/hicolor/*/apps/%{name}.png
333 %{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml
334 %{_datadir}/xsessions/kodi.desktop
335 %{_datadir}/wayland-sessions/kodi-gbm.desktop
338 %defattr(644,root,root,755)
339 %dir %{_libdir}/%{name}
340 %dir %{_datadir}/%{name}
343 %defattr(644,root,root,755)
345 %{_libdir}/%{name}/cmake
346 %{_datadir}/%{name}/cmake