Name: capi-system-system-settings
Summary: A System Settings library in Tizen Native API
-Version: 0.0.2
-Release: 3
-Group: System/API
+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: capi-system-system-settings.manifest
+Source1001: %{name}.manifest
+
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(ecore-x)
-BuildRequires: pkgconfig(ecore-file)
-BuildRequires: pkgconfig(appcore-efl)
-BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(gobject-2.0)
+BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(uuid)
+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
-A System Settings library in Tizen Native API.
+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: Development/System
-Requires: %{name} = %{version}-%{release}
+Group: System/System Info
+Requires: %{name} = %{version}
Requires: pkgconfig(capi-base-common)
%description devel
-%devel_desc
+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}.
+%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
%prep
%setup -q
-cp %{SOURCE1001} .
-
+cp %{SOURCE1001} ./%{name}.manifest
%build
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%if "%{?tizen_profile_name}" == "wearable"
+export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_WEARABLE"
+export FFLAGS="$FFLAGS -DTIZEN_WEARABLE"
+%else
+export CFLAGS="$CFLAGS -DTIZEN_MOBILE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_MOBILE"
+export FFLAGS="$FFLAGS -DTIZEN_MOBILE"
+%endif
+
+%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
-make %{?jobs:-j%jobs}
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%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} \
+ -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}
+%else
+ -DN_THREADS=1
+%endif
+
+make %{?_smp_mflags}
%install
%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*settings.so.*
+%license LICENSE.APLv2
+
+%files util-lib
+%manifest %{name}.manifest
+%{_libdir}/lib*settings-util.so
%license LICENSE.APLv2
-%manifest system-settings.manifest
-%{_libdir}/lib*.so.*
-/usr/bin/test_system_settings_gui
%files devel
%manifest %{name}.manifest
-%{_includedir}/system/*.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