%bcond_with x
%bcond_with wayland
-%define UTEST_PACKAGE 1
-%define UTEST_GCOV 0
+%define HALTESTS_PACKAGE 1
+%if 0%{?gcov:1}
+%define HALTESTS_GCOV 1
+%else
+%define HALTESTS_GCOV 0
+%endif
Name: libtbm
-Version: 2.11.1
+Version: 3.2.7
Release: 1
License: MIT
Summary: The library for Tizen Buffer Manager
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(pixman-1)
-BuildRequires: gtest-devel
+BuildRequires: gtest-devel
%description
Description: %{summary}
Development Files.
-%if "%{UTEST_PACKAGE}" == "1"
-%package utests
+%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
Group: System/Libraries
-%description utests
+%description haltests
Test module for testing libtbm APIs
%endif
cp %{SOURCE1001} .
%build
-UTEST="no"
+HALTESTS="no"
-%if "%{UTEST_PACKAGE}" == "1"
-UTEST="yes"
+%if "%{HALTESTS_PACKAGE}" == "1"
+HALTESTS="yes"
%endif
-%if "%{UTEST_GCOV}" == "1"
+%if "%{HALTESTS_GCOV}" == "1"
CFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
CXXFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
LDFLAGS+=" -lgcov"
%endif
%if %{with wayland}
-%reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND --with-utests=${UTEST} \
+%reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND --with-haltests=${HALTESTS} \
CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
%else
-%reconfigure --prefix=%{_prefix} --with-tbm-platform=X11 --with-utests=${UTEST} \
+%reconfigure --prefix=%{_prefix} --with-tbm-platform=X11 --with-haltests=${HALTESTS} \
CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
%endif
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
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}
%manifest %{name}.manifest
%defattr(-,root,root,-)
%dir %{_includedir}
-%{_includedir}/tbm_bufmgr.h
-%{_includedir}/tbm_surface.h
-%{_includedir}/tbm_surface_internal.h
-%{_includedir}/tbm_surface_queue.h
-%{_includedir}/tbm_bufmgr_backend.h
-%{_includedir}/tbm_type.h
-%{_includedir}/tbm_type_common.h
-%{_includedir}/tbm_drm_helper.h
-%{_includedir}/tbm_sync.h
-%{_includedir}/tbm_bo.h
-%{_includedir}/tbm_log.h
-%{_includedir}/tbm_backend.h
+%{_includedir}/tbm_*.h
%{_libdir}/libtbm.so
%{_libdir}/pkgconfig/libtbm.pc
-%if "%{UTEST_PACKAGE}" == "1"
-%files utests
+%if "%{HALTESTS_PACKAGE}" == "1"
+%files haltests
%defattr(-,root,root,-)
-%{_bindir}/tbm-utests
+%{_bindir}/tbm-haltests
+%endif
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
%endif