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