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 Nexus
60 Summary: Kodi is a free and open source media-player and entertainment hub
64 License: GPL v2+ and GPL v3+
65 Group: Applications/Multimedia
66 #Source0Download: https://github.com/xbmc/xbmc/releases
67 Source0: https://github.com/xbmc/xbmc/archive/%{version}-%{codename}.tar.gz
68 # Source0-md5: ed115f2fac4d425fdd4fd228065ef2c4
69 Source1: https://github.com/xbmc/libdvdread/archive/%{dvdread_ver}/libdvdread-%{dvdread_ver}.tar.gz
70 # Source1-md5: 0d24c950abfef9dc02e231dda56912ac
71 Source2: https://github.com/xbmc/libdvdcss/archive/%{dvdcss_ver}/libdvdcss-%{dvdcss_ver}.tar.gz
72 # Source2-md5: 42dc3770ae928103e8033a18b007e79d
73 Source3: https://github.com/xbmc/libdvdnav/archive/%{dvdnav_ver}/libdvdnav-%{dvdnav_ver}.tar.gz
74 # Source3-md5: 2349cde54d950af21fa4936371ad3349
75 Patch0: disable-static.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.12
95 BuildRequires: crossguid-devel
96 BuildRequires: curl-devel
97 %{!?with_system_ffmpeg:BuildRequires: dav1d-devel}
98 BuildRequires: dbus-devel
99 # libavcodec >= 58.91.100 libavfilter >= 7.85.100 libavformat >= 58.45.100 libavutil >= 56.51.100 libpostproc >= 55.7.100 libswscale >= 5.7.100 libswresample >= 3.7.100
100 %{?with_system_ffmpeg:BuildRequires: ffmpeg-devel >= 4.3}
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
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 >= 3.0.0
118 BuildRequires: libdrm-devel >= 2.4.95
119 BuildRequires: libfmt-devel >= 6.1.2
120 %{?with_gbm:BuildRequires: libinput-devel}
121 BuildRequires: libjpeg-devel
122 BuildRequires: libmicrohttpd-devel >= 0.9.40
123 BuildRequires: libnfs-devel
124 BuildRequires: libplist-devel >= 2.0
125 BuildRequires: libpng-devel
126 BuildRequires: libsmbclient-devel
127 BuildRequires: libstdc++-devel >= 6:5
128 BuildRequires: libtool
129 BuildRequires: libudfread-devel >= 1.0.0
130 BuildRequires: libuuid-devel
131 BuildRequires: libva-devel
132 BuildRequires: libva-drm-devel
133 %{?with_wayland:BuildRequires: libva-wayland-devel}
134 %{?with_x11:BuildRequires: libva-x11-devel}
135 %if %{with x11} && %{without gles}
136 BuildRequires: libvdpau-devel
138 BuildRequires: libxml2-devel >= 2.0
139 BuildRequires: libxslt-devel
140 BuildRequires: lirc-devel
141 BuildRequires: lzo-devel >= 2
142 BuildRequires: mysql-devel
143 BuildRequires: openssl-devel >= 1.1.0
144 BuildRequires: pcre-cxx-devel
145 BuildRequires: pipewire-devel
146 BuildRequires: pkgconfig
147 BuildRequires: pulseaudio-devel >= 11.0.0
148 BuildRequires: python3-devel >= 1:3.8
149 BuildRequires: rapidjson-devel >= 1.1.0
150 BuildRequires: rpm-build >= 4.6
151 BuildRequires: rpm-pythonprov
152 BuildRequires: rpmbuild(macros) >= 2.007
153 BuildRequires: sed >= 4.0
154 BuildRequires: spdlog-devel >= 1.5.0
155 BuildRequires: sqlite3-devel
157 BuildRequires: taglib-devel >= 1.9.0
158 BuildRequires: tinyxml-devel >= 2.6.2
159 BuildRequires: udev-devel
161 BuildRequires: wayland-protocols >= 1.7
162 BuildRequires: waylandpp-devel >= 0.2.2
165 BuildRequires: xorg-lib-libX11-devel
166 BuildRequires: xorg-lib-libXext-devel
167 BuildRequires: xorg-lib-libXrandr-devel
169 %if %{with gbm} || %{with wayland}
170 BuildRequires: xorg-lib-libxkbcommon-devel >= 0.4.1
172 BuildRequires: zlib-devel
173 Requires: %{name}-common = %{version}-%{release}
174 Requires: alsa-lib >= 1.0.27
175 Requires: desktop-file-utils
176 Requires: ffmpeg-libs >= 4.3
177 Requires: hicolor-icon-theme
178 Requires: libbluray >= 0.9.3
179 Requires: libcdio >= 2.1.0
180 Requires: libcdio-c++ >= 2.1.0
181 Requires: libcec >= 3.0.0
182 Requires: libdrm >= 2.4.95
183 Requires: libfmt >= 6.1.2
184 Requires: libmicrohttpd >= 0.9.40
185 Requires: libplist >= 2.0
186 Requires: libudfread >= 1.0.0
187 Requires: lsb-release
188 Requires: openssl >= 1.1.0
189 Requires: pulseaudio-libs >= 11.0.0
190 Requires: spdlog >= 1.5.0
191 Requires: taglib >= 1.9.0
192 Requires: tinyxml >= 2.6.2
193 %{?with_wayland:Requires: waylandpp >= 0.2.2}
194 %if %{with gbm} || %{with wayland}
195 Requires: xorg-lib-libxkbcommon >= 0.4.1
197 Obsoletes: xbmc < 14.0
198 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
200 # debug enabled causes oom on i686/x32
201 %define _enable_debug_packages 0
204 Kodi Entertainment Center (formerly XBMC) is a free and open-source
205 media player software developed by the XBMC Foundation, a non-profit
206 technology consortium. Kodi is available for multiple operating
207 systems and hardware platforms, with a software 10-foot user interface
208 for use with televisions and remote controls. It allows users to play
209 and view most videos, music, such as podcasts from the internet, and
210 all common digital media files from local and network storage media.
213 Summary: Common files for Kodi
216 Common files for Kodi.
219 Summary: Header files for Kodi
220 Group: Development/Libraries
221 Requires: %{name}-common = %{version}-%{release}
224 Header files for Kodi.
227 %setup -q -n xbmc-%{version}%{?subver}-%{codename} -a1 -a2 -a3
232 %if %{without system_ffmpeg}
233 #ln -s %{SOURCE1} tools/depends/target/ffmpeg/ffmpeg-2.4.4-%{codename}.tar.gz
237 grep -q '^VERSION=%{dvdread_ver}$' tools/depends/target/libdvdread/LIBDVDREAD-VERSION
238 grep -q '^VERSION=%{dvdcss_ver}$' tools/depends/target/libdvdcss/LIBDVDCSS-VERSION
239 grep -q '^VERSION=%{dvdnav_ver}$' tools/depends/target/libdvdnav/LIBDVDNAV-VERSION
242 -DLIBDVDREAD_SOURCE_DIR=$(pwd)/libdvdread-%{dvdread_ver} \
243 -DLIBDVDCSS_SOURCE_DIR=$(pwd)/libdvdcss-%{dvdcss_ver} \
244 -DLIBDVDNAV_SOURCE_DIR=$(pwd)/libdvdnav-%{dvdnav_ver} \
245 -DAPP_RENDER_SYSTEM=%{!?with_gles:gl}%{?with_gles:gles} \
246 -DCORE_PLATFORM_NAME="%{?with_gbm:GBM;}%{?with_x11:X11;}%{?with_wayland:WAYLAND;}" \
247 %{cmake_on_off airtunes ENABLE_AIRTUNES} \
248 %{cmake_on_off dvdcss ENABLE_DVDCSS} \
249 -DENABLE_INTERNAL_CROSSGUID:BOOL=OFF \
250 -DENABLE_INTERNAL_DAV1D:BOOL=OFF \
251 -DENABLE_INTERNAL_FFMPEG:BOOL=%{?with_system_ffmpeg:OFF}%{!?with_system_ffmpeg:ON} \
252 -DENABLE_INTERNAL_FLATBUFFERS:BOOL=OFF \
253 -DENABLE_INTERNAL_FMT:BOOL=OFF \
254 -DENABLE_INTERNAL_FSTRCMP:BOOL=OFF \
255 -DENABLE_INTERNAL_NFS:BOOL=OFF \
256 -DENABLE_INTERNAL_PCRE:BOOL=OFF \
257 -DENABLE_INTERNAL_RapidJSON:BOOL=OFF \
258 -DENABLE_INTERNAL_SPDLOG:BOOL=OFF \
259 -DENABLE_INTERNAL_TAGLIB:BOOL=OFF \
260 -DENABLE_INTERNAL_UDFREAD:BOOL=OFF \
261 %{cmake_on_off gold ENABLE_GOLD} \
262 -DENABLE_TESTING:BOOL=OFF \
263 %{cmake_on_off optical_drive ENABLE_OPTICAL} \
264 %{cmake_on_off upnp ENABLE_UPNP} \
265 %{cmake_on_off avx ENABLE_AVX} \
266 %{cmake_on_off avx2 ENABLE_AVX2} \
267 %{cmake_on_off neon ENABLE_NEON} \
268 %{cmake_on_off sse ENABLE_SSE} \
269 %{cmake_on_off sse2 ENABLE_SSE2} \
270 %{cmake_on_off sse3 ENABLE_SSE3} \
271 %{cmake_on_off ssse3 ENABLE_SSSE3} \
272 %{cmake_on_off sse41 ENABLE_SSE4_1} \
273 %{cmake_on_off sse42 ENABLE_SSE4_2} \
274 -DWITH_ARCH=%{kodi_arch} \
275 -DWITH_CPU=%{_target_cpu}
280 rm -rf $RPM_BUILD_ROOT
282 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/addons
284 %{__make} -C build install \
285 DESTDIR=$RPM_BUILD_ROOT
287 %{__rm} $RPM_BUILD_ROOT%{_docdir}/{version.txt,README.Linux.md,LICENSE.md}
290 %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/kodi-*.xml
293 rm -rf $RPM_BUILD_ROOT
296 %update_icon_cache hicolor
297 %update_desktop_database
300 %update_icon_cache hicolor
301 %update_desktop_database_postun
304 %defattr(644,root,root,755)
305 %doc README.md docs/README.Linux.md
306 %attr(755,root,root) %{_bindir}/JsonSchemaBuilder
307 %attr(755,root,root) %{_bindir}/kodi
308 %attr(755,root,root) %{_bindir}/kodi-TexturePacker
309 %attr(755,root,root) %{_bindir}/kodi-standalone
310 %{_datadir}/%{name}/addons
311 %{_datadir}/%{name}/media
312 %{_datadir}/%{name}/privacy-policy.txt
313 %{_datadir}/%{name}/system
314 %{_datadir}/%{name}/userdata
315 %attr(755,root,root) %{_libdir}/%{name}/%{name}.bin
316 %{?with_x11:%attr(755,root,root) %{_libdir}/%{name}/%{name}-xrandr}
317 %dir %{_libdir}/%{name}/addons
318 %dir %{_libdir}/%{name}/system
319 %dir %{_libdir}/%{name}/system/players
320 %dir %{_libdir}/%{name}/system/players/VideoPlayer
321 %attr(755,root,root) %{_libdir}/%{name}/system/players/VideoPlayer/libdvdnav-%{kodi_arch}.so
322 %{_desktopdir}/kodi.desktop
323 %{_iconsdir}/hicolor/*/apps/%{name}.png
324 %{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml
325 %{_datadir}/xsessions/kodi.desktop
328 %defattr(644,root,root,755)
329 %dir %{_libdir}/%{name}
330 %dir %{_datadir}/%{name}
333 %defattr(644,root,root,755)
335 %{_libdir}/%{name}/cmake
336 %{_datadir}/%{name}/cmake