Name: capi-ui-sticker
Summary: Sticker client library and daemon
-Version: 0.1.35
+Version: 0.1.80
Release: 1
Group: Graphics & UI Framework/Input
License: Apache-2.0
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(gmock)
%if 0%{?sec_product_feature_profile_wearable}
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(capi-appfw-service-application)
-BuildRequires: pkgconfig(capi-message-port)
BuildRequires: pkgconfig(capi-appfw-preference)
BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(sap-client-stub-api)
Requires(post): dbus
Requires(postun): /sbin/ldconfig
+%if 0%{?gcov:1}
+BuildRequires: lcov
+BuildRequires: zip
+%endif
+
%description
Sticker client library and daemon
Sticker client library and daemon (gcov)
%endif
+%package unittests
+Summary: Sticker tests
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description unittests
+GTest for sticker
+
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE2} .
-DCOMPANION_MODE=true \
%endif
-DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
- -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -DTZ_SYS_SHARE=%TZ_SYS_SHARE \
+ -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -DTZ_USER_SHARE=%TZ_USER_SHARE \
-DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES
+
make %{?jobs:-j%jobs}
%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+find . -name '*.gcno' | tar cf %{name}-gcov.tar -T -
%endif
%install
install -m 0644 %SOURCE3 %{buildroot}%{_sysconfdir}/dbus-1/system.d/capi-ui-sticker.conf
%if 0%{?gcov:1}
-mkdir -p %{buildroot}%{_datadir}/gcov/obj
-install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+install -d -m 755 %{buildroot}%{_datadir}/gcov/obj/%{name}
+tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj/%{name}
%endif
%if 0%{?sec_product_feature_profile_wearable}
%define tizen_dist_sign 1
%endif
+%check
+%if 0%{?gcov:1}
+ctest --output-on-failure %{?_smp_mflags}
+lcov -c --ignore-errors graph --no-external -q -d . -o capi-ui-sticker.info
+genhtml capi-ui-sticker.info -o capi-ui-sticker.out
+zip -r capi-ui-sticker.zip capi-ui-sticker.out capi-ui-sticker.info
+install -m 0644 capi-ui-sticker.zip %{buildroot}%{_datadir}/gcov
+%endif
+
%post
/sbin/ldconfig
-mkdir -p -m 0775 %{TZ_SYS_SHARE}/sticker-data
-chown -R ui_fw:ui_fw %{TZ_SYS_SHARE}/sticker-data
-chsmack -t %{TZ_SYS_SHARE}/sticker-data
-chsmack -a "System::Shared" %{TZ_SYS_SHARE}/sticker-data
+mkdir -p -m 0775 /opt/usr/share/sticker-data
+chown -R ui_fw:ui_fw /opt/usr/share/sticker-data
+chsmack -t /opt/usr/share/sticker-data
+chsmack -a "User::App::Shared" /opt/usr/share/sticker-data
%postun -p /sbin/ldconfig
%{TZ_SYS_RO_APP}/%{_companion_app_name}/*
%endif
+%files unittests
+%license LICENSE
+%{_bindir}/sticker_unittests
+
%if 0%{?gcov:1}
%files gcov
-%{_datadir}/gcov/obj/*
+%{_datadir}/gcov/*
%endif