-#%if "%{run_tests}" == "1"
-# %define check %%check
-#%endif
-
Name: capi-system-system-settings
Summary: A System Settings library in Tizen Native API
-Version: 0.0.4
-Release: 5
+Version: 0.0.5
+Release: 0
+
Group: System/System Info
License: Apache-2.0
+URL : https://git.tizen.org/cgit/platform/core/api/system-settings
Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libsystemd)
-
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-package-manager)
-
+BuildRequires: pkgconfig(efl-extension)
+BuildRequires: pkgconfig(gmock)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: capi-system-info-test
+BuildRequires: default-fonts-sdk
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
%description
System setting api for get,set configuration
+%package util-lib
+Summary: Utility library for %{name}
+Group: System/System Info
+Requires: %{name} = %{version}
+
+%description util-lib
+The %{name}-utils pacakge contains an utility library for handling font and image
+
%package devel
Summary: A System Settings library in Tizen Native API (Development)
Group: System/System Info
-Requires: %{name} = %{version}-%{release}
+Requires: %{name} = %{version}
Requires: pkgconfig(capi-base-common)
%description devel
System setting api for get,set configuration
+%package unittests
+Summary: Test Programs for %{name}
+Group: System/Testing
+%description unittests
+The %{name}-unittests pacakge contains programs for checking the %{name}.
-%prep
-%setup -q
+%if 0%{?gcov:1}
+%package gcov
+Summary: A System Settings library in Tizen Native API
+Group: System/Testing
+
+%description gcov
+System Settings library gcov objects
+%endif
%define tizen_profile_name mobile
+%define sys_setting_test_dir %{_bindir}/sys-settings
-%build
+%prep
+%setup -q
+cp %{SOURCE1001} ./%{name}.manifest
+%build
%if "%{?tizen_profile_name}" == "wearable"
export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_WEARABLE"
export FFLAGS="$FFLAGS -DTIZEN_MOBILE"
%endif
-%if 0%{?sec_build_binary_debug_enable}
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
%endif
-%if 0%{?tizen_build_binary_release_type_eng}
-export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
-export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
-%endif
-
-
-%ifarch aarch64
-export CFLAGS+="$CFLAGS -DSETTING_ARCH_64"
-export CXXFLAGS+="$CXXFLAGS -DSETTING_ARCH_64"
-export FFLAGS+="$FFLAGS -DSETTING_ARCH_64"
-%endif
-
-%ifarch x86_64
-export CFLAGS+="$CFLAGS -DSETTING_ARCH_64"
-export CXXFLAGS+="$CXXFLAGS -DSETTING_ARCH_64"
-export FFLAGS+="$FFLAGS -DSETTING_ARCH_64"
-%endif
-
-
-
-VERSION=`echo %{version} | grep Version: | awk '{ print $2 }'`
-RELEASE=`echo %{version} | grep Version: | awk '{ print $2 }'`
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DCMAKE_LIBDIR=%{_libdir} \
- -DCMAKE_INCLUDEDIR=%{_includedir} \
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
+ -DCMAKE_VERBOSE_MAKEFILE=OFF \
-DTZ_SYS_DATA=%{TZ_SYS_DATA} \
-DTZ_SYS_ETC=%{TZ_SYS_ETC} \
-DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
-DTZ_SYS_SHARE=%{TZ_SYS_SHARE} \
- -DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
+ -DTEST_INSTALL_DIR:PATH=%{sys_setting_test_dir} \
+ -DSST_RES_DIR=%{TZ_SYS_GLOBALUSER_DATA}/settings \
+ -DSTDOUT_LOG=%{?stdlog:1}%{!?stdlog:0} \
%if 0%{?thread_number}
- -DN_THREADS=%{thread_number} \
-%endif
-%if "%{run_tests}" == "1"
- -DCMAKE_BUILD_TYPE=UNITTEST \
- -DUNIT_TEST=1 \
- -DGCOV_PREFIX="%{buildroot}" \
- -DGCOV_PREFIX_STRIP=1
+ -DN_THREADS=%{thread_number}
%else
-
-# add empty line
+ -DN_THREADS=1
%endif
-
-make %{?jobs:-j%jobs}
+make %{?_smp_mflags}
%install
-#rm -rf %{buildroot}
%make_install
+%if 0%{?gcov:1}
+find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
+install -d -m 755 %{buildroot}%{_datadir}/gcov/obj/%{name}
+tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj/%{name}
+%endif
+
+%check
+#bash tests/scripts/vconf_golden_master.sh
+LD_LIBRARY_PATH=.:tests:libutil tests/sst-unit-test-err-interface
+LD_LIBRARY_PATH=.:tests:libutil tests/sst-unit-test
+%if 0%{?gcov:1}
+lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
+genhtml %{name}.info -o out --legend --show-details
+%endif
+
%post -p /sbin/ldconfig
+%post util-lib -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
+%postun util-lib -p /sbin/ldconfig
%files
%manifest %{name}.manifest
-%{_libdir}/lib*.so.*
-%if "%{run_tests}" == "1"
-/usr/local/bin/system-setting-unittest
-
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_setting_platform.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_json.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_ringtones.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_vconf.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_multi_callback.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/system-settings-util/CMakeFiles/system-settings-util.dir/src/system_settings_util.c.gcno
-%endif
-%license LICENSE
-# /usr/local/bin/test_system_settings
-#/usr/local/bin/test_system_settings_gui
+%{_libdir}/lib*settings.so.*
+%license LICENSE.APLv2
+
+%files util-lib
+%manifest %{name}.manifest
+%{_libdir}/lib*settings-util.so
+%license LICENSE.APLv2
%files devel
%manifest %{name}.manifest
-%license LICENSE
-%{_includedir}/system/*.h
-%{_includedir}/system_settings_util.h
+%{_libdir}/lib*settings.so
%{_libdir}/pkgconfig/*.pc
-%{_libdir}/lib*.so
+%{_includedir}/system/*.h
+
+%files unittests
+%manifest %{name}.manifest
+%{sys_setting_test_dir}/*
+%license LICENSE.APLv2
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/*
+%endif