Make gcov package when --define 'gcov ON' is given
[platform/core/security/privilege-info.git] / packaging / privilege-info.spec
old mode 100755 (executable)
new mode 100644 (file)
index ab06a4b..eefdaa9
@@ -1,8 +1,8 @@
 Name:    privilege-info
-Summary: Privilege Management
-Version: 0.0.1
+Summary: Privilege Information
+Version: 0.0.3
 Release: 1
-Group:   System/Libraries
+Group:   Security/API
 License: Apache-2.0
 Source0: %{name}-%{version}.tar.gz
 
@@ -13,82 +13,122 @@ BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(security-privilege-manager)
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-session)
+BuildRequires: pkgconfig(libsmack)
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(capi-system-info)
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
+Requires: tizen-locale
 
 %description
-Privilege Information
+Provides Privilege Information(Privilege Info) API
 
 %package -n privilege-info-devel
 Summary: Privilege Info API (Development)
-Group: TO_BE/FILLED_IN
+Group:   Security/Development
 Requires: %{name} = %{version}-%{release}
 
 %description -n privilege-info-devel
 The Privilege Info API provides functions to get privilege information (DEV)
 
 %package -n tc-privilege-info
-Summary: tc-privilege-info
-Group: TO_BE/FILLED_IN
+Summary: Privilege Info TC
+Group:   Security/Testing
 Requires: %{name} = %{version}-%{release}
 
 %description -n tc-privilege-info
-tc-privilege-info
+Privilege Info API Internal Test
+
+%if 0%{?gcov:1}
+%package gcov
+Summary:  Privilege Info(gcov)
+Group:    Security/Testing
+%description gcov
+New Privilege Info gcov objects
+%endif
+
 
 %prep
 %setup -q
 
 %build
 
-%if "%{?tizen_profile_name}" == "wearable"
-    __PROFILE_TYPE="WEARABLE"
-%else
-    __PROFILE_TYPE="MOBILE"
-%endif
-
 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 
+%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
+
 echo cmake . -DPREFIX=%{_prefix} \
-        -DEXEC_PREFIX=%{_exec_prefix} \
         -DLIBDIR=%{_libdir} \
         -DINCLUDEDIR=%{_includedir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
         -DVERSION=%{version} \
-        -DDPL_LOG="ON" \
-        -DDATADIR=%{_datadir} \
-        -DPROFILE_TYPE="${__PROFILE_TYPE}"
+        -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+        -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+        -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
 
 cmake . -DPREFIX=%{_prefix} \
-        -DEXEC_PREFIX=%{_exec_prefix} \
         -DLIBDIR=%{_libdir} \
         -DINCLUDEDIR=%{_includedir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
         -DVERSION=%{version} \
-        -DDPL_LOG="ON" \
-        -DDATADIR=%{_datadir} \
-        -DPROFILE_TYPE="${__PROFILE_TYPE}"
+        -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+        -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+        -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
 
 make %{?jobs:-j%jobs}
 
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . \( -name '*.gcno' ! -name 'tc_*' \) -exec cp '{}' gcov-obj ';'
+%endif
+
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE.Apache-2.0 %{buildroot}%{_datadir}/license/privilege-info
 
 %make_install
 
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
+%post -n privilege-info -p /sbin/ldconfig
+%postun -n privilege-info -p /sbin/ldconfig
+
+%post -n tc-privilege-info
+tpk-backend -y org.tizen.test-privilege-info --preload
+cyad -s -k MANIFESTS -c User::Pkg::org.tizen.test-privilege-info -u '*' -p http://tizen.org/privilege/contact.read -t DENY
+
 %files -n privilege-info
-%{_libdir}/libprivilege-info.so.*
-%{_datadir}/license/privilege-info
+%{_libdir}/libprivilege-info.so*
+%license LICENSE.Apache-2.0
+%manifest packaging/privilege-info.manifest
 
 %files -n privilege-info-devel
-%{_libdir}/libprivilege-info.so
-%{_includedir}/*.h
+%{_includedir}/privilege_information.h
 %{_libdir}/pkgconfig/privilege-info.pc
 
 %files -n tc-privilege-info
+%manifest test/org.tizen.test-privilege-info.manifest
+%{TZ_SYS_RO_APP}/org.tizen.test-privilege-info/bin/tc-privilege-info-app-privacy
+%{TZ_SYS_RO_PACKAGES}/org.tizen.test-privilege-info.xml
 %{_bindir}/tc-privilege-info
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+
 %clean
 rm -rf %{buildroot}