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 codename Matrix
56 Summary: Kodi is a free and open source media-player and entertainment hub
60 License: GPL v2+ and GPL v3+
61 Group: Applications/Multimedia
62 #Source0Download: https://github.com/xbmc/xbmc/releases
63 Source0: https://github.com/xbmc/xbmc/archive/%{version}-%{codename}.tar.gz
64 # Source0-md5: 44f78712d1752af1c9c3d43dd5a56a17
65 Patch0: disable-static.patch
67 Patch2: mesa22.3.patch
69 BuildRequires: EGL-devel
70 %{?with_gbm:BuildRequires: Mesa-libgbm-devel}
71 # for eglextchromium.h
72 %{?with_x11:BuildRequires: Mesa-libEGL-devel}
74 BuildRequires: OpenGL-GLU-devel
75 BuildRequires: OpenGL-devel
77 BuildRequires: OpenGL-GLX-devel
80 %{?with_gles:BuildRequires: OpenGLES-devel}
81 BuildRequires: alsa-lib-devel >= 1.0.27
82 BuildRequires: avahi-devel
83 BuildRequires: bluez-libs-devel >= 4.99
84 BuildRequires: cmake >= 3.4
85 BuildRequires: crossguid-devel
86 BuildRequires: curl-devel
87 %{!?with_system_ffmpeg:BuildRequires: dav1d-devel}
88 BuildRequires: dbus-devel
89 # 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
90 %{?with_system_ffmpeg:BuildRequires: ffmpeg-devel >= 4.3}
91 BuildRequires: flatbuffers-devel >= 1.9.0
92 BuildRequires: fontconfig-devel
93 BuildRequires: freetype-devel
94 BuildRequires: fribidi-devel
95 BuildRequires: fstrcmp-devel >= 0.7
96 BuildRequires: gettext-tools
97 BuildRequires: giflib-devel >= 5
99 BuildRequires: lcms2-devel
100 BuildRequires: libass-devel
101 BuildRequires: libatomic-devel
102 BuildRequires: libbluray-devel >= 0.9.3
103 BuildRequires: libcap-devel
104 BuildRequires: libcdio-c++-devel >= 2.1.0
105 BuildRequires: libcdio-devel >= 2.1.0
106 BuildRequires: libcec-devel >= 3.0.0
107 BuildRequires: libdrm-devel >= 2.4.95
108 %{?with_dvdcss:BuildRequires: libdvdcss-devel >= 1.4.1}
109 BuildRequires: libdvdnav-devel
110 BuildRequires: libdvdread-devel
111 BuildRequires: libfmt-devel >= 6.1.2
112 %{?with_gbm:BuildRequires: libinput-devel}
113 BuildRequires: libjpeg-devel
114 BuildRequires: libmicrohttpd-devel >= 0.9.40
115 BuildRequires: libnfs-devel
116 BuildRequires: libplist-devel >= 2.0
117 BuildRequires: libpng-devel
118 BuildRequires: libsmbclient-devel
119 BuildRequires: libstdc++-devel >= 6:5
120 BuildRequires: libudfread-devel >= 1.0.0
121 BuildRequires: libuuid-devel
122 BuildRequires: libva-devel
123 BuildRequires: libva-drm-devel
124 %{?with_wayland:BuildRequires: libva-wayland-devel}
125 %{?with_x11:BuildRequires: libva-x11-devel}
126 %if %{with x11} && %{without gles}
127 BuildRequires: libvdpau-devel
129 BuildRequires: libxml2-devel >= 2.0
130 BuildRequires: libxslt-devel
131 BuildRequires: lirc-devel
132 BuildRequires: lzo-devel >= 2
133 BuildRequires: mysql-devel
134 BuildRequires: openssl-devel >= 1.0.2
135 BuildRequires: pcre-cxx-devel
136 BuildRequires: pkgconfig
137 BuildRequires: pulseaudio-devel >= 11.0.0
138 BuildRequires: python3-devel >= 1:3.8
139 BuildRequires: rapidjson-devel >= 1.1.0
140 BuildRequires: rpm-build >= 4.6
141 BuildRequires: rpm-pythonprov
142 BuildRequires: rpmbuild(macros) >= 2.007
143 BuildRequires: sed >= 4.0
144 BuildRequires: spdlog-devel >= 1.5.0
145 BuildRequires: sqlite3-devel
147 BuildRequires: taglib-devel >= 1.9.0
148 BuildRequires: tinyxml-devel >= 2.6.2
149 BuildRequires: udev-devel
151 BuildRequires: wayland-protocols >= 1.7
152 BuildRequires: waylandpp-devel >= 0.2.2
155 BuildRequires: xorg-lib-libX11-devel
156 BuildRequires: xorg-lib-libXext-devel
157 BuildRequires: xorg-lib-libXrandr-devel
159 %if %{with gbm} || %{with wayland}
160 BuildRequires: xorg-lib-libxkbcommon-devel >= 0.4.1
162 BuildRequires: zlib-devel
163 Requires: %{name}-common = %{version}-%{release}
164 Requires: alsa-lib >= 1.0.27
165 Requires: desktop-file-utils
166 Requires: ffmpeg-libs >= 4.3
167 Requires: hicolor-icon-theme
168 Requires: libbluray >= 0.9.3
169 Requires: libcdio >= 2.1.0
170 Requires: libcdio-c++ >= 2.1.0
171 Requires: libcec >= 3.0.0
172 Requires: libdrm >= 2.4.95
173 %{?with_dvdcss:Requires: libdvdcss >= 1.4.1}
174 Requires: libfmt >= 6.1.2
175 Requires: libmicrohttpd >= 0.9.40
176 Requires: libplist >= 2.0
177 Requires: libudfread >= 1.0.0
178 Requires: lsb-release
179 Requires: openssl >= 1.0.2
180 Requires: pulseaudio-libs >= 11.0.0
181 Requires: spdlog >= 1.5.0
182 Requires: taglib >= 1.9.0
183 Requires: tinyxml >= 2.6.2
184 %{?with_wayland:Requires: waylandpp >= 0.2.2}
185 %if %{with gbm} || %{with wayland}
186 Requires: xorg-lib-libxkbcommon >= 0.4.1
188 Obsoletes: xbmc < 14.0
189 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
191 # debug enabled causes oom on i686/x32
192 %define _enable_debug_packages 0
195 Kodi Entertainment Center (formerly XBMC) is a free and open-source
196 media player software developed by the XBMC Foundation, a non-profit
197 technology consortium. Kodi is available for multiple operating
198 systems and hardware platforms, with a software 10-foot user interface
199 for use with televisions and remote controls. It allows users to play
200 and view most videos, music, such as podcasts from the internet, and
201 all common digital media files from local and network storage media.
204 Summary: Common files for Kodi
207 Common files for Kodi.
210 Summary: Header files for Kodi
211 Group: Development/Libraries
212 Requires: %{name}-common = %{version}-%{release}
215 Header files for Kodi.
218 %setup -q -n xbmc-%{version}%{?subver}-%{codename}
225 %if %{without system_ffmpeg}
226 #ln -s %{SOURCE1} tools/depends/target/ffmpeg/ffmpeg-2.4.4-%{codename}.tar.gz
231 -DAPP_RENDER_SYSTEM=%{!?with_gles:gl}%{?with_gles:gles} \
232 -DCORE_PLATFORM_NAME="%{?with_gbm:GBM;}%{?with_x11:X11;}%{?with_wayland:WAYLAND;}" \
233 %{cmake_on_off airtunes ENABLE_AIRTUNES} \
234 %{cmake_on_off dvdcss ENABLE_DVDCSS} \
235 -DENABLE_INTERNAL_CROSSGUID:BOOL=OFF \
236 -DENABLE_INTERNAL_DAV1D:BOOL=OFF \
237 -DENABLE_INTERNAL_FFMPEG:BOOL=%{?with_system_ffmpeg:OFF}%{!?with_system_ffmpeg:ON} \
238 -DENABLE_INTERNAL_FLATBUFFERS:BOOL=OFF \
239 -DENABLE_INTERNAL_FMT:BOOL=OFF \
240 -DENABLE_INTERNAL_FSTRCMP:BOOL=OFF \
241 -DENABLE_INTERNAL_LIBDVD:BOOL=OFF \
242 -DENABLE_INTERNAL_RapidJSON:BOOL=OFF \
243 -DENABLE_INTERNAL_SPDLOG:BOOL=OFF \
244 -DENABLE_INTERNAL_UDFREAD:BOOL=OFF \
245 %{cmake_on_off gold ENABLE_LDGOLD} \
246 -DENABLE_TESTING:BOOL=OFF \
247 %{cmake_on_off optical_drive ENABLE_OPTICAL} \
248 %{cmake_on_off upnp ENABLE_UPNP} \
249 %{cmake_on_off avx ENABLE_AVX} \
250 %{cmake_on_off avx2 ENABLE_AVX2} \
251 %{cmake_on_off neon ENABLE_NEON} \
252 %{cmake_on_off sse ENABLE_SSE} \
253 %{cmake_on_off sse2 ENABLE_SSE2} \
254 %{cmake_on_off sse3 ENABLE_SSE3} \
255 %{cmake_on_off ssse3 ENABLE_SSSE3} \
256 %{cmake_on_off sse41 ENABLE_SSE4_1} \
257 %{cmake_on_off sse42 ENABLE_SSE4_2} \
258 -DWITH_ARCH=%{kodi_arch} \
259 -DWITH_CPU=%{_target_cpu}
264 rm -rf $RPM_BUILD_ROOT
266 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/addons
268 %{__make} -C build install \
269 DESTDIR=$RPM_BUILD_ROOT
271 %{__rm} $RPM_BUILD_ROOT%{_docdir}/{version.txt,README.Linux.md,LICENSE.md}
274 %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/kodi-*.xml
277 rm -rf $RPM_BUILD_ROOT
280 %update_icon_cache hicolor
281 %update_desktop_database
284 %update_icon_cache hicolor
285 %update_desktop_database_postun
288 %defattr(644,root,root,755)
289 %doc README.md docs/README.Linux.md
290 %attr(755,root,root) %{_bindir}/JsonSchemaBuilder
291 %attr(755,root,root) %{_bindir}/TexturePacker
292 %attr(755,root,root) %{_bindir}/kodi
293 %attr(755,root,root) %{_bindir}/kodi-standalone
294 %{_datadir}/%{name}/addons
295 %{_datadir}/%{name}/media
296 %{_datadir}/%{name}/privacy-policy.txt
297 %{_datadir}/%{name}/system
298 %{_datadir}/%{name}/userdata
299 %attr(755,root,root) %{_libdir}/%{name}/%{name}.bin
300 %{?with_x11:%attr(755,root,root) %{_libdir}/%{name}/%{name}-xrandr}
301 %dir %{_libdir}/%{name}/addons
302 %dir %{_libdir}/%{name}/system
303 %dir %{_libdir}/%{name}/system/players
304 %dir %{_libdir}/%{name}/system/players/VideoPlayer
305 %attr(755,root,root) %{_libdir}/%{name}/system/players/VideoPlayer/libdvdnav-*.so
306 %{_desktopdir}/kodi.desktop
307 %{_iconsdir}/hicolor/*/apps/%{name}.png
308 %{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml
309 %{_datadir}/xsessions/kodi.desktop
312 %defattr(644,root,root,755)
313 %dir %{_libdir}/%{name}
314 %dir %{_datadir}/%{name}
317 %defattr(644,root,root,755)
319 %{_libdir}/%{name}/cmake
320 %{_datadir}/%{name}/cmake