File rlottie.spec of Package rlottie

Name: rlottie
Version: 0.2

%global feurl https://github.com/Samsung/%{name}
#%global commit d40008707addacb636ff435236d31c694ce2b6cf
%define sonum 0
Release: 10.2
Epoch: 1

# Main source: MIT
# rapidjson (base) - MIT
# rapidjson (msinttypes) - BSD-3-Clause
# freetype rasterizer - FTL
# vector (vinterpolator) - MPL-1.1
License: MIT AND FTL AND BSD-3-Clause AND MPL-1.1
Summary: Platform independent standalone library that plays Lottie Animation

URL: %{feurl}
Source0: %{name}-%{version}.tar.gz
# https://github.com/Samsung/rlottie/pull/553.patch
# Use GNUInstallDirs
#Patch0: 0001-cmake-fix.patch
# https://github.com/Samsung/rlottie/pull/549.patch
#Patch1: 0002-fix-keyframe-end-time.patch
# https://github.com/Samsung/rlottie/pull/554.patch
# Required for unit tests to pass
#Patch2: 0003-fix-tests.patch

BuildRequires: gcc
BuildRequires: gcc-c++

BuildRequires: cmake
BuildRequires: cmake(GTest)

%description
rlottie is a platform independent standalone c++ library for rendering
vector based animations and art in realtime.

Lottie loads and renders animations and vectors exported in the bodymovin
JSON format. Bodymovin JSON can be created and exported from After Effects
with bodymovin, Sketch with Lottie Sketch Export, and from Haiku.

For the first time, designers can create and ship beautiful animations
without an engineer painstakingly recreating it by hand. Since the animation
is backed by JSON they are extremely small in size but can be large in
complexity!


%if %{defined suse_version}
%define libname lib%{name}%{sonum}
%define devlibname lib%{name}-devel
%package -n %{libname}
Summary: %{summary}
%description -n %{libname}
This package contains runtime library files for %{name}.
%else
%define libname %{name}
%define devlibname %{name}-devel
%endif

%package -n %{devlibname}
Provides: rlottie-devel = %{version}-%{release}
Summary: Development files for %{name}
Requires: %{libname}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description -n %{devlibname}
This package contains headers and development files for %{name}.

%prep
%autosetup -p1

%build
%cmake -DBUILD_TESTING:BOOL=ON -DLOTTIE_MODULE:BOOL=OFF
%cmake_build

%install
%cmake_install

%check
#ctest
%if %{defined suse_version}
%files -n %{libname}
%else
%files
%endif
%doc AUTHORS README.md
%license COPYING licenses/*
%{_libdir}/lib%{name}.so.0*

%files -n %{devlibname}
%{_includedir}/%{name}*.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/cmake/%{name}/

openSUSE Build Service is sponsored by