File kodi.spec of Package kodi

Name:           kodi
Version:        0
%define codename	Leia
Release:        0
Summary:        The Media Center formerly known as XBMC
License:        GPL-3.0+
Group:          Productivity/Multimedia/Video/Players
Url:            http://www.kodi.tv
#Source0:        http://mirrors.kodi.tv/releases/source/%%{version}-%%{codename}.tar.gz
#Source0:        https://github.com/xbmc/xbmc/archive/%%{version}-%%{codename}.tar.gz
Source0:	%{name}-%{version}.tar.xz
NoSource:       0
Source1:	FindSSE.cmake
Patch1:		python-no-intl.patch

BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkg-config
# TexturePacker
BuildRequires: pkgconfig(libpng)
BuildRequires: giflib-devel
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(lzo2)
#
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(avahi-client)
BuildRequires: pkgconfig(bluez)
BuildRequires: pkgconfig(libbluray)
BuildRequires: pkgconfig(libcap)
BuildRequires: pkgconfig(libcec)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(lirc)
BuildRequires: pkgconfig(avahi-compat-libdns_sd)
BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.40
BuildRequires: pkgconfig(libnfs)
BuildRequires: pkgconfig(libpulse) >= 2.0.0
BuildRequires: pkgconfig(python2)
BuildRequires: pkgconfig(smbclient)
BuildRequires: sndio-devel
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(libva-drm)
BuildRequires: pkgconfig(libva-wayland)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: pkgconfig(vdpau)
#uildRequires: pkgconfig(glx)
BuildRequires: pkgconfig(libplist)
BuildRequires: pkgconfig(libass)
BuildRequires: pkgconfig(libcdio)
BuildRequires: pkgconfig(libiso9660)
BuildRequires: pkgconfig(expat)
BuildRequires:	crossguid
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libavcodec) >= 58.18.100
BuildRequires: pkgconfig(libavfilter) >= 7.16.100
BuildRequires: pkgconfig(libavformat) >= 58.12.100
BuildRequires: pkgconfig(libavutil) >= 56.14.100
BuildRequires: pkgconfig(libswscale) >= 5.1.100
BuildRequires: pkgconfig(libswresample) >= 3.1.100
BuildRequires: pkgconfig(libpostproc) >= 55.1.100
BuildRequires:	flatbuffers-devel
BuildRequires: pkgconfig(fmt)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(fribidi)
BuildRequires:  fstrcmp-devel
BuildRequires: pkgconfig(dvdnav)
BuildRequires: pkgconfig(dvdread)
BuildRequires: pkgconfig(lzo2)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(libpcrecpp)
BuildRequires: pkgconfig(RapidJSON) >= 1.0.2
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(taglib) >= 1.9.0
BuildRequires: tinyxml-devel
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(libdrm) >= 2.4.74
BuildRequires: pkgconfig(zlib)
BuildRequires: libmysqlclient-devel
BuildRequires: swig
BuildRequires: java-11-openjdk-devel
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: pkgconfig(libffi)
%if 0
BuildRequires:  boost-devel ccache doxygen gcc
BuildRequires:  git glew-devel gperf
BuildRequires:  libSDL_image-devel libXmu-devel libXpm-devel libXrender-devel
BuildRequires:  libXt-devel
BuildRequires:  libbz2-devel 
BuildRequires:  libexpat-devel
BuildRequires:  libgcrypt-devel libjasper-devel libjson-devel libmad-devel
BuildRequires:  libmodplug-devel libmpeg2-devel
BuildRequires:  libogg-devel liboldX-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libssh-devel libssh2-devel libtiff-devel 
BuildRequires:  libvorbis-devel libxkbfile-devel
BuildRequires:  libyajl-devel nasm
BuildRequires:  python3-xcb-proto-devel readline-devel
BuildRequires:  xz-devel zip unzip
BuildRequires:	pkgconfig(libusb-1.0) >= 1.0.18

%ifarch x86_64 %ix86
BuildRequires:  libcrystalhd-devel
%endif

# new for Gotham
BuildRequires:	libXrandr-devel

# shairplay-devel

BuildRequires:	  libgnutls-devel

## Wayland support (>= oS 13.1)
BuildRequires:	wayland-devel libwayland-egl-devel wayland-protocols-devel
BuildRequires:	Mesa-libGLESv2-devel Mesa-libEGL-devel libxkbcommon-devel

BuildRequires:	Mesa-libEGL-devel libxkbcommon-devel

# Recommends:	libdvdcss


BuildRequires:	gettext-runtime gettext-tools
%endif

Requires: /usr/bin/glxinfo
# dlopen()ed, needed for DVD still frames
Recommends: libmpeg2
Recommends: libcrystalhd3
# Streaming
Recommends: librtmp1

Recommends: libbluray1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Kodi media center is a free cross-platform media-player jukebox and
entertainment hub.  Kodi can play a spectrum of of multimedia formats,
and featuring playlist, audio visualizations, slideshow, and weather
forecast functions, together third-party plugins.

%package devel
Summary: Header files to build Kodi add-ons
Group:          Development/Libraries/C and C++

%description devel
Header files to build Kodi add-ons

%debug_package

%prep
%setup -q
%ifarch x86_64 %ix86
cp -p %SOURCE1 cmake/modules/.
%endif
%patch1 -p1


%build
export NATIVEPREFIX=`pwd`
mkdir -p bin

for tool in TexturePacker JsonSchemaBuilder; do
  (cd tools/depends/native/$tool/src &&
    autoreconf -vif &&
    ./configure --prefix=/usr &&
    make %{_smp_mflags} && ln $tool $NATIVEPREFIX/bin)
done

%cmake \
      -DGIT_EXECUTABLE:STRING=$(type -P false) \
      -DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS" \
      -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
      -DWITH_ARCH="%{_arch}-linux" \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DNATIVEPREFIX=$NATIVEPREFIX \
      -DKODI_DEPENDSBUILD=TRUE \
      -DENABLE_INTERNAL_CROSSGUID=OFF \
      -DENABLE_INTERNAL_RapidJSON=OFF \
      -DENABLE_INTERNAL_FMT=OFF \
      -DENABLE_INTERNAL_FSTRCMP=OFF \
      -DENABLE_INTERNAL_FLATBUFFERS=OFF \
      -DENABLE_AIRTUNES=OFF \
      -DENABLE_DVDCSS=OFF

## Wayland requires C++ bindings (not yet here)
#	-DCORE_PLATFORM_NAME=wayland -DWAYLAND_RENDER_SYSTEM=gles

#      -DENABLE_OPTICAL=OFF -DENABLE_INTERNAL_CROSSGUID=OFF -DVERBOSE=ON 

%make_jobs


%install
%cmake_install
mkdir -p %buildroot/%_libdir/%name/addons
# %find_lang %{name}
# %fdupes %buildroot%{_bindir}

%files
# -f %%{source_dir}/%%{name}.lang
%defattr(-,root,root,-)
%_bindir/%{name}*
%_bindir/TexturePacker
%dir %_libdir/%name
%dir %_libdir/%name/addons
%_libdir/%name/system
%_libdir/%name/%{name}-x*
%dir %_datadir/%name
%_datadir/%name/[^c]*
%_datadir/doc/%name
%_datadir/icons/hicolor/*/apps/%name.png
%_datadir/applications/kodi.desktop
%_datadir/xsessions/kodi.desktop
%dir /usr/lib/firewalld/services
%dir /usr/lib/firewalld
%dir /usr/lib
/usr/lib/firewalld/services/%{name}-*.xml
%dir %_datadir/icons/hicolor/*/apps
%dir %_datadir/icons/hicolor/*

%files devel
%defattr(-,root,root,-)
%_includedir/%name
%_datadir/%name/cmake


%changelog