%bcond_with utest
Name: libtbm
-Version: 2.0.14
+Version: 2.1.7
Release: 1
License: MIT
Summary: The library for Tizen Buffer Manager
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(dlog)
-
-%if %{with utest}
-BuildRequires: gtest-devel
-%endif
+BuildRequires: pkgconfig(pixman-1)
%description
Description: %{summary}
Development Files.
+%if %{with utest}
+%package utests
+Summary: Tizen Buffer Manager unit tests package
+Group: System/Libraries
+
+%description utests
+Test module for testing libtbm APIs
+%endif
+
%global TZ_SYS_RO_SHARE %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
%prep
UTEST="no"
%if %{with utest}
+cd ut/gtest/googletest
+autoreconf --install
+./configure
+make
+cd ../../..
UTEST="yes"
%endif
make %{?_smp_mflags}
-%if %{with utest}
-make -C ut check
-%endif
-
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
-cp -af COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
%make_install
-
-%__mkdir_p %{buildroot}%{_unitdir}
-install -m 644 service/tbm-drm-auth.service %{buildroot}%{_unitdir}
-install -m 644 service/tbm-drm-auth.path %{buildroot}%{_unitdir}
%__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}
rm -rf %{buildroot}
%pre
-%__mkdir_p %{_unitdir}/graphical.target.wants
-ln -sf ../tbm-drm-auth.path %{_unitdir}/graphical.target.wants/
-
%__mkdir_p %{_unitdir_user}/basic.target.wants
ln -sf ../tbm-drm-auth-user.path %{_unitdir_user}/basic.target.wants/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-rm -f %{_unitdir}/graphical.target.wants/tbm-drm-auth.path
-
rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%{TZ_SYS_RO_SHARE}/license/%{name}
+%license COPYING
%{_libdir}/libtbm.so.*
-%{_unitdir}/tbm-drm-auth.path
-%{_unitdir}/tbm-drm-auth.service
%{_unitdir_user}/tbm-drm-auth-user.path
%{_unitdir_user}/tbm-drm-auth-user.service
-%if %{with utest}
-%{_bindir}/ut
-%endif
%files devel
%manifest %{name}.manifest
%{_includedir}/tbm_sync.h
%{_libdir}/libtbm.so
%{_libdir}/pkgconfig/libtbm.pc
+
+%if %{with utest}
+%files utests
+%defattr(-,root,root,-)
+%{_bindir}/tbm_utests
+%endif