]>
Commit | Line | Data |
---|---|---|
18b90c81 | 1 | # TODO: |
3a71016a | 2 | # - fix build flags - some files are compiled with -O3 and without rpm*flags |
92b96980 | 3 | # - add and/or fix users/groups permissions |
63ff963e | 4 | # - split to subpackages? |
928406b7 | 5 | # - bundled ffmpeg build (tools/depends/target/ffmpeg/autobuild.sh) enables nonfree & gpl! |
18b90c81 | 6 | # |
92b96980 | 7 | # Conditional build: |
ceb94d36 | 8 | # Features: |
c0d69361 | 9 | %bcond_with airtunes # AirTunes support |
ceb94d36 | 10 | %bcond_without dvdcss # DVDCSS support |
9ba2f18c | 11 | %bcond_without gbm # GBM platform |
ceb94d36 | 12 | %bcond_without optical_drive # optical drive |
e148a10d | 13 | %bcond_without upnp # UPnP support |
9ba2f18c | 14 | %bcond_without x11 # X11 platform |
3b778467 JP |
15 | %ifarch %{arm} aarch64 |
16 | %bcond_without gles # OpenGL rendering | |
17 | %else | |
e148a10d | 18 | %bcond_with gles # OpenGLES rendering |
3b778467 | 19 | %endif |
b99e5c75 | 20 | %bcond_with gold # Use gold linker |
9ba2f18c | 21 | %bcond_without wayland # Wayland platform |
ceb94d36 | 22 | # System libs: |
6e5f6f0e | 23 | %bcond_without system_ffmpeg # build with system ffmpeg |
9ba2f18c JP |
24 | # CPU instructions |
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 | |
92b96980 | 34 | |
9ba2f18c JP |
35 | %ifarch %{arm_with_neon} |
36 | %define with_neon 1 | |
37 | %endif | |
38 | %ifarch %{x86_with_sse} | |
39 | %define with_sse 1 | |
40 | %endif | |
41 | %ifarch %{x86_with_sse2} | |
42 | %define with_sse2 1 | |
43 | %endif | |
1653c9fe JP |
44 | %ifarch %{x8664} x32 |
45 | %define kodi_arch x86_64-linux | |
46 | %endif | |
47 | %ifarch %{x86} | |
48 | %define kodi_arch i486-linux | |
49 | %endif | |
50 | %ifnarch %{x8664} %{x86} x32 | |
51 | %define kodi_arch %{_target_base_arch} | |
52 | %endif | |
9ba2f18c | 53 | |
9a409828 JP |
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 | |
57 | ||
a06c8c4d JR |
58 | %define codename Omega |
59 | %define subver b1 | |
d61811e9 | 60 | Summary: Kodi is a free and open source media-player and entertainment hub |
92b53b2c | 61 | Name: kodi |
a06c8c4d | 62 | Version: 21.0 |
211379a9 | 63 | Release: 0.%{subver}.2 |
68612b1e | 64 | License: GPL v2+ and GPL v3+ |
18b90c81 | 65 | Group: Applications/Multimedia |
caf463a3 | 66 | #Source0Download: https://github.com/xbmc/xbmc/releases |
a06c8c4d JR |
67 | Source0: https://github.com/xbmc/xbmc/archive/%{version}%{subver}-%{codename}.tar.gz |
68 | # Source0-md5: cdd5ca2a3e81180a87996377f042978c | |
9a409828 JP |
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 | |
9ba2f18c | 75 | Patch0: disable-static.patch |
8a2a31f2 | 76 | Patch1: xbmc-libfmt.patch |
0ac32cd1 | 77 | URL: https://kodi.tv/ |
a983002d | 78 | BuildRequires: EGL-devel |
9ba2f18c JP |
79 | %{?with_gbm:BuildRequires: Mesa-libgbm-devel} |
80 | # for eglextchromium.h | |
81 | %{?with_x11:BuildRequires: Mesa-libEGL-devel} | |
82 | %if %{without gles} | |
8fa5c2e4 | 83 | BuildRequires: OpenGL-GLU-devel |
b85db44b | 84 | BuildRequires: OpenGL-devel |
9ba2f18c JP |
85 | %if %{with x11} |
86 | BuildRequires: OpenGL-GLX-devel | |
87 | %endif | |
88 | %endif | |
89 | %{?with_gles:BuildRequires: OpenGLES-devel} | |
90 | BuildRequires: alsa-lib-devel >= 1.0.27 | |
9a409828 JP |
91 | BuildRequires: autoconf |
92 | BuildRequires: automake | |
18b90c81 | 93 | BuildRequires: avahi-devel |
b85db44b | 94 | BuildRequires: bluez-libs-devel >= 4.99 |
9a409828 | 95 | BuildRequires: cmake >= 3.12 |
c3c3c480 | 96 | BuildRequires: crossguid-devel |
18b90c81 | 97 | BuildRequires: curl-devel |
9de0d888 | 98 | %{!?with_system_ffmpeg:BuildRequires: dav1d-devel} |
18b90c81 | 99 | BuildRequires: dbus-devel |
9ba2f18c JP |
100 | # 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 |
101 | %{?with_system_ffmpeg:BuildRequires: ffmpeg-devel >= 4.3} | |
60818254 | 102 | BuildRequires: flatbuffers-devel >= 1.9.0 |
18b90c81 SP |
103 | BuildRequires: fontconfig-devel |
104 | BuildRequires: freetype-devel | |
105 | BuildRequires: fribidi-devel | |
9ba2f18c | 106 | BuildRequires: fstrcmp-devel >= 0.7 |
0747666f | 107 | BuildRequires: gettext-tools |
9ba2f18c | 108 | BuildRequires: giflib-devel >= 5 |
9a409828 | 109 | BuildRequires: harfbuzz-devel |
d9a0b984 | 110 | BuildRequires: jre |
20c6d413 | 111 | BuildRequires: lcms2-devel |
b85db44b | 112 | BuildRequires: libass-devel |
a7c53f4c | 113 | BuildRequires: libatomic-devel |
9ba2f18c | 114 | BuildRequires: libbluray-devel >= 0.9.3 |
37fbe511 | 115 | BuildRequires: libcap-devel |
9ba2f18c JP |
116 | BuildRequires: libcdio-c++-devel >= 2.1.0 |
117 | BuildRequires: libcdio-devel >= 2.1.0 | |
118 | BuildRequires: libcec-devel >= 3.0.0 | |
a06c8c4d | 119 | BuildRequires: libdisplay-info-devel |
9ba2f18c | 120 | BuildRequires: libdrm-devel >= 2.4.95 |
9ba2f18c JP |
121 | BuildRequires: libfmt-devel >= 6.1.2 |
122 | %{?with_gbm:BuildRequires: libinput-devel} | |
18b90c81 | 123 | BuildRequires: libjpeg-devel |
88da6d7b | 124 | BuildRequires: libmicrohttpd-devel >= 0.9.40 |
9ba2f18c JP |
125 | BuildRequires: libnfs-devel |
126 | BuildRequires: libplist-devel >= 2.0 | |
5a2f2b01 | 127 | BuildRequires: libpng-devel |
18b90c81 | 128 | BuildRequires: libsmbclient-devel |
9ba2f18c | 129 | BuildRequires: libstdc++-devel >= 6:5 |
9a409828 | 130 | BuildRequires: libtool |
9ba2f18c | 131 | BuildRequires: libudfread-devel >= 1.0.0 |
f99f2533 | 132 | BuildRequires: libuuid-devel |
b85db44b | 133 | BuildRequires: libva-devel |
9ba2f18c JP |
134 | BuildRequires: libva-drm-devel |
135 | %{?with_wayland:BuildRequires: libva-wayland-devel} | |
136 | %{?with_x11:BuildRequires: libva-x11-devel} | |
137 | %if %{with x11} && %{without gles} | |
5a2f2b01 | 138 | BuildRequires: libvdpau-devel |
9ba2f18c | 139 | %endif |
8fa5c2e4 | 140 | BuildRequires: libxml2-devel >= 2.0 |
501e1d3e | 141 | BuildRequires: libxslt-devel |
9ba2f18c JP |
142 | BuildRequires: lirc-devel |
143 | BuildRequires: lzo-devel >= 2 | |
5a2f2b01 | 144 | BuildRequires: mysql-devel |
9a409828 | 145 | BuildRequires: openssl-devel >= 1.1.0 |
63ff963e | 146 | BuildRequires: pcre-cxx-devel |
9a409828 | 147 | BuildRequires: pipewire-devel |
5a2f2b01 | 148 | BuildRequires: pkgconfig |
9ba2f18c JP |
149 | BuildRequires: pulseaudio-devel >= 11.0.0 |
150 | BuildRequires: python3-devel >= 1:3.8 | |
151 | BuildRequires: rapidjson-devel >= 1.1.0 | |
400c2356 | 152 | BuildRequires: rpm-build >= 4.6 |
3a71016a | 153 | BuildRequires: rpm-pythonprov |
9ba2f18c | 154 | BuildRequires: rpmbuild(macros) >= 2.007 |
c462fd57 | 155 | BuildRequires: sed >= 4.0 |
9ba2f18c | 156 | BuildRequires: spdlog-devel >= 1.5.0 |
18b90c81 | 157 | BuildRequires: sqlite3-devel |
37fbe511 | 158 | BuildRequires: swig |
9ba2f18c | 159 | BuildRequires: taglib-devel >= 1.9.0 |
a06c8c4d | 160 | BuildRequires: tinyxml2-devel |
b85db44b | 161 | BuildRequires: udev-devel |
9ba2f18c JP |
162 | %if %{with wayland} |
163 | BuildRequires: wayland-protocols >= 1.7 | |
164 | BuildRequires: waylandpp-devel >= 0.2.2 | |
165 | %endif | |
166 | %if %{with x11} | |
b85db44b AF |
167 | BuildRequires: xorg-lib-libX11-devel |
168 | BuildRequires: xorg-lib-libXext-devel | |
18b90c81 | 169 | BuildRequires: xorg-lib-libXrandr-devel |
9ba2f18c JP |
170 | %endif |
171 | %if %{with gbm} || %{with wayland} | |
172 | BuildRequires: xorg-lib-libxkbcommon-devel >= 0.4.1 | |
173 | %endif | |
18b90c81 | 174 | BuildRequires: zlib-devel |
9ba2f18c | 175 | Requires: %{name}-common = %{version}-%{release} |
9ba2f18c JP |
176 | Requires: alsa-lib >= 1.0.27 |
177 | Requires: desktop-file-utils | |
178 | Requires: ffmpeg-libs >= 4.3 | |
9ba2f18c JP |
179 | Requires: hicolor-icon-theme |
180 | Requires: libbluray >= 0.9.3 | |
181 | Requires: libcdio >= 2.1.0 | |
182 | Requires: libcdio-c++ >= 2.1.0 | |
183 | Requires: libcec >= 3.0.0 | |
184 | Requires: libdrm >= 2.4.95 | |
9ba2f18c JP |
185 | Requires: libfmt >= 6.1.2 |
186 | Requires: libmicrohttpd >= 0.9.40 | |
187 | Requires: libplist >= 2.0 | |
188 | Requires: libudfread >= 1.0.0 | |
a58652d4 | 189 | Requires: lsb-release |
9a409828 | 190 | Requires: openssl >= 1.1.0 |
9ba2f18c JP |
191 | Requires: pulseaudio-libs >= 11.0.0 |
192 | Requires: spdlog >= 1.5.0 | |
193 | Requires: taglib >= 1.9.0 | |
194 | Requires: tinyxml >= 2.6.2 | |
195 | %{?with_wayland:Requires: waylandpp >= 0.2.2} | |
196 | %if %{with gbm} || %{with wayland} | |
197 | Requires: xorg-lib-libxkbcommon >= 0.4.1 | |
198 | %endif | |
92b53b2c | 199 | Obsoletes: xbmc < 14.0 |
18b90c81 SP |
200 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
201 | ||
021fb2ec JP |
202 | # debug enabled causes oom on i686/x32 |
203 | %define _enable_debug_packages 0 | |
204 | ||
18b90c81 | 205 | %description |
d61811e9 ER |
206 | Kodi Entertainment Center (formerly XBMC) is a free and open-source |
207 | media player software developed by the XBMC Foundation, a non-profit | |
208 | technology consortium. Kodi is available for multiple operating | |
209 | systems and hardware platforms, with a software 10-foot user interface | |
210 | for use with televisions and remote controls. It allows users to play | |
211 | and view most videos, music, such as podcasts from the internet, and | |
212 | all common digital media files from local and network storage media. | |
18b90c81 | 213 | |
9ba2f18c JP |
214 | %package common |
215 | Summary: Common files for Kodi | |
9ba2f18c JP |
216 | |
217 | %description common | |
218 | Common files for Kodi. | |
219 | ||
220 | %package devel | |
221 | Summary: Header files for Kodi | |
222 | Group: Development/Libraries | |
223 | Requires: %{name}-common = %{version}-%{release} | |
224 | ||
225 | %description devel | |
226 | Header files for Kodi. | |
227 | ||
18b90c81 | 228 | %prep |
9a409828 | 229 | %setup -q -n xbmc-%{version}%{?subver}-%{codename} -a1 -a2 -a3 |
a06c8c4d JR |
230 | #%patch0 -p1 |
231 | #%patch1 -p1 | |
18b90c81 | 232 | |
8fa5c2e4 | 233 | %{__rm} -r lib/win32 |
5d47de93 | 234 | |
72cf5436 | 235 | %if %{without system_ffmpeg} |
c3c3c480 | 236 | #ln -s %{SOURCE1} tools/depends/target/ffmpeg/ffmpeg-2.4.4-%{codename}.tar.gz |
928406b7 ER |
237 | %endif |
238 | ||
18b90c81 | 239 | %build |
9a409828 JP |
240 | grep -q '^VERSION=%{dvdread_ver}$' tools/depends/target/libdvdread/LIBDVDREAD-VERSION |
241 | grep -q '^VERSION=%{dvdcss_ver}$' tools/depends/target/libdvdcss/LIBDVDCSS-VERSION | |
242 | grep -q '^VERSION=%{dvdnav_ver}$' tools/depends/target/libdvdnav/LIBDVDNAV-VERSION | |
243 | ||
9ba2f18c | 244 | %cmake -B build \ |
13059bc3 | 245 | -DHOST_CAN_EXECUTE_TARGET:BOOL=TRUE \ |
9a409828 JP |
246 | -DLIBDVDREAD_SOURCE_DIR=$(pwd)/libdvdread-%{dvdread_ver} \ |
247 | -DLIBDVDCSS_SOURCE_DIR=$(pwd)/libdvdcss-%{dvdcss_ver} \ | |
248 | -DLIBDVDNAV_SOURCE_DIR=$(pwd)/libdvdnav-%{dvdnav_ver} \ | |
9ba2f18c JP |
249 | -DAPP_RENDER_SYSTEM=%{!?with_gles:gl}%{?with_gles:gles} \ |
250 | -DCORE_PLATFORM_NAME="%{?with_gbm:GBM;}%{?with_x11:X11;}%{?with_wayland:WAYLAND;}" \ | |
251 | %{cmake_on_off airtunes ENABLE_AIRTUNES} \ | |
252 | %{cmake_on_off dvdcss ENABLE_DVDCSS} \ | |
253 | -DENABLE_INTERNAL_CROSSGUID:BOOL=OFF \ | |
254 | -DENABLE_INTERNAL_DAV1D:BOOL=OFF \ | |
9b1af85b | 255 | -DENABLE_INTERNAL_FFMPEG:BOOL=%{?with_system_ffmpeg:OFF}%{!?with_system_ffmpeg:ON} \ |
9ba2f18c JP |
256 | -DENABLE_INTERNAL_FLATBUFFERS:BOOL=OFF \ |
257 | -DENABLE_INTERNAL_FMT:BOOL=OFF \ | |
258 | -DENABLE_INTERNAL_FSTRCMP:BOOL=OFF \ | |
9a409828 JP |
259 | -DENABLE_INTERNAL_NFS:BOOL=OFF \ |
260 | -DENABLE_INTERNAL_PCRE:BOOL=OFF \ | |
9ba2f18c JP |
261 | -DENABLE_INTERNAL_RapidJSON:BOOL=OFF \ |
262 | -DENABLE_INTERNAL_SPDLOG:BOOL=OFF \ | |
9a409828 | 263 | -DENABLE_INTERNAL_TAGLIB:BOOL=OFF \ |
9ba2f18c | 264 | -DENABLE_INTERNAL_UDFREAD:BOOL=OFF \ |
9a409828 | 265 | %{cmake_on_off gold ENABLE_GOLD} \ |
9ba2f18c JP |
266 | -DENABLE_TESTING:BOOL=OFF \ |
267 | %{cmake_on_off optical_drive ENABLE_OPTICAL} \ | |
268 | %{cmake_on_off upnp ENABLE_UPNP} \ | |
269 | %{cmake_on_off avx ENABLE_AVX} \ | |
270 | %{cmake_on_off avx2 ENABLE_AVX2} \ | |
271 | %{cmake_on_off neon ENABLE_NEON} \ | |
272 | %{cmake_on_off sse ENABLE_SSE} \ | |
273 | %{cmake_on_off sse2 ENABLE_SSE2} \ | |
274 | %{cmake_on_off sse3 ENABLE_SSE3} \ | |
275 | %{cmake_on_off ssse3 ENABLE_SSSE3} \ | |
276 | %{cmake_on_off sse41 ENABLE_SSE4_1} \ | |
e5419751 | 277 | %{cmake_on_off sse42 ENABLE_SSE4_2} \ |
1653c9fe | 278 | -DWITH_ARCH=%{kodi_arch} \ |
e5419751 | 279 | -DWITH_CPU=%{_target_cpu} |
68612b1e | 280 | |
9ba2f18c | 281 | %{__make} -C build |
18b90c81 SP |
282 | |
283 | %install | |
284 | rm -rf $RPM_BUILD_ROOT | |
9ba2f18c | 285 | |
f82242a8 JP |
286 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/addons |
287 | ||
be17bf9f | 288 | %{__make} -C build install \ |
92b96980 | 289 | DESTDIR=$RPM_BUILD_ROOT |
18b90c81 | 290 | |
005f83ba | 291 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/{version.txt,README.Linux.md,LICENSE.md} |
e36884e8 ER |
292 | |
293 | # not packaged | |
294 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/kodi-*.xml | |
25890c53 | 295 | |
bb922e70 JR |
296 | # same as kodi-TexturePacker |
297 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/TexturePacker | |
298 | ||
18b90c81 SP |
299 | %clean |
300 | rm -rf $RPM_BUILD_ROOT | |
301 | ||
9ba2f18c JP |
302 | %post |
303 | %update_icon_cache hicolor | |
304 | %update_desktop_database | |
305 | ||
306 | %postun | |
307 | %update_icon_cache hicolor | |
308 | %update_desktop_database_postun | |
309 | ||
18b90c81 SP |
310 | %files |
311 | %defattr(644,root,root,755) | |
005f83ba | 312 | %doc README.md docs/README.Linux.md |
25890c53 | 313 | %attr(755,root,root) %{_bindir}/kodi |
9a409828 | 314 | %attr(755,root,root) %{_bindir}/kodi-TexturePacker |
25890c53 | 315 | %attr(755,root,root) %{_bindir}/kodi-standalone |
9ba2f18c JP |
316 | %{_datadir}/%{name}/addons |
317 | %{_datadir}/%{name}/media | |
318 | %{_datadir}/%{name}/privacy-policy.txt | |
319 | %{_datadir}/%{name}/system | |
320 | %{_datadir}/%{name}/userdata | |
58a47115 JP |
321 | %attr(755,root,root) %{_libdir}/%{name}/%{name}.bin |
322 | %{?with_x11:%attr(755,root,root) %{_libdir}/%{name}/%{name}-xrandr} | |
323 | %dir %{_libdir}/%{name}/addons | |
324 | %dir %{_libdir}/%{name}/system | |
325 | %dir %{_libdir}/%{name}/system/players | |
326 | %dir %{_libdir}/%{name}/system/players/VideoPlayer | |
9a409828 | 327 | %attr(755,root,root) %{_libdir}/%{name}/system/players/VideoPlayer/libdvdnav-%{kodi_arch}.so |
25890c53 ER |
328 | %{_desktopdir}/kodi.desktop |
329 | %{_iconsdir}/hicolor/*/apps/%{name}.png | |
9ba2f18c | 330 | %{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml |
25890c53 | 331 | %{_datadir}/xsessions/kodi.desktop |
bb922e70 | 332 | %{_datadir}/wayland-sessions/kodi-gbm.desktop |
9ba2f18c JP |
333 | |
334 | %files common | |
335 | %defattr(644,root,root,755) | |
58a47115 | 336 | %dir %{_libdir}/%{name} |
9ba2f18c JP |
337 | %dir %{_datadir}/%{name} |
338 | ||
339 | %files devel | |
340 | %defattr(644,root,root,755) | |
341 | %{_includedir}/kodi | |
58a47115 | 342 | %{_libdir}/%{name}/cmake |
9ba2f18c | 343 | %{_datadir}/%{name}/cmake |