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