%bcond_with x
%bcond_with wayland
%define HALTESTS_PACKAGE 1
+%if 0%{?gcov:1}
+%define HALTESTS_GCOV 1
+%else
%define HALTESTS_GCOV 0
+%endif
+
+%define _tmpfilesdir %{_libdir}/tmpfiles.d
Name: libtbm
-Version: 3.0.2
+Version: 3.3.10
Release: 1
License: MIT
Summary: The library for Tizen Buffer Manager
Group: System/Libraries
Source0: %{name}-%{version}.tar.gz
Source1001: %name.manifest
+Source1002: sw_sync.conf
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(pixman-1)
-BuildRequires: gtest-devel
+BuildRequires: pkgconfig(gmock)
%description
Description: %{summary}
Development Files.
+%if 0%{?gcov:1}
+%package gcov
+Summary: Tizen Buffer Manager gcov data package
+Group: Development/Libraries
+
+%description gcov
+Tizen Buffer Manager gcno data for gcov
+%endif
+
%if "%{HALTESTS_PACKAGE}" == "1"
%package haltests
Summary: Tizen Buffer Manager unit tests package
make %{?_smp_mflags}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+rm gcov-obj/tbm_haltests-tc*
+%endif
+
%install
rm -rf %{buildroot}
%make_install
+%__mkdir_p %{buildroot}%{_tmpfilesdir}
+install -m 0644 %SOURCE1002 %{buildroot}%{_tmpfilesdir}/sw_sync.conf
+
%__mkdir_p %{buildroot}%{_unitdir_user}
install -m 644 service/tbm-drm-auth-user.service %{buildroot}%{_unitdir_user}
install -m 644 service/tbm-drm-auth-user.path %{buildroot}%{_unitdir_user}
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
%clean
rm -rf %{buildroot}
%{_libdir}/libtbm.so.*
%{_unitdir_user}/tbm-drm-auth-user.path
%{_unitdir_user}/tbm-drm-auth-user.service
+%{_tmpfilesdir}/sw_sync.conf
%files devel
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_bindir}/tbm-haltests
%endif
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif