+%{!?build_type:%global build_type RELEASE}
+
Name: privilege-info
-Summary: Privilege Management
-Version: 0.0.1
+Summary: Privilege Information
+Version: 0.0.8
Release: 1
-Group: System/Libraries
+Group: Security/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
+
BuildRequires: cmake
+BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(capi-security-privilege-manager)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(security-privilege-manager)
+%if "%{build_type}" == "COVERAGE"
+BuildRequires: lcov
+%endif
%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)
+The Privilege Info API provides functions to get privilege information (Development)
-%package -n tc-privilege-info
-Summary: tc-privilege-info
-Group: TO_BE/FILLED_IN
+%package -n privilege-info-tests
+Summary: Privilege Info TC
+Group: Security/Testing
Requires: %{name} = %{version}-%{release}
-%description -n tc-privilege-info
-tc-privilege-info
+%description -n privilege-info-tests
+Privilege Info API Internal Test
+
+%if "%{build_type}" == "COVERAGE"
+
+%package -n privilege-info-coverage
+Summary: Privilege Info code coverage data
+Group: Security/Testing
+Requires: privilege-info-tests = %{version}-%{release}
+Requires: privilege-info-debugsource = %{version}-%{release}
+Requires: lcov
+Requires: gcc
+
+%description -n privilege-info-coverage
+Privilege Info code coverage data
+
+%endif
%prep
%setup -q
%build
-%if "%{?tizen_profile_name}" == "wearable"
- __PROFILE_TYPE="WEARABLE"
-%else
- __PROFILE_TYPE="MOBILE"
-%endif
+%global coverage_dir %{_datadir}/privilege-info-coverage
-export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
-export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
-
-echo cmake . -DPREFIX=%{_prefix} \
- -DEXEC_PREFIX=%{_exec_prefix} \
- -DLIBDIR=%{_libdir} \
- -DINCLUDEDIR=%{_includedir} \
- -DCMAKE_BUILD_TYPE=%{build_type} \
- -DVERSION=%{version} \
- -DDPL_LOG="ON" \
- -DPROFILE_TYPE="${__PROFILE_TYPE}"
-
-cmake . -DPREFIX=%{_prefix} \
- -DEXEC_PREFIX=%{_exec_prefix} \
- -DLIBDIR=%{_libdir} \
- -DINCLUDEDIR=%{_includedir} \
- -DCMAKE_BUILD_TYPE=%{build_type} \
- -DVERSION=%{version} \
- -DDPL_LOG="ON" \
- -DPROFILE_TYPE="${__PROFILE_TYPE}"
+%cmake . -DCMAKE_BUILD_TYPE=%{build_type} -DCOVERAGE_DIR=%{coverage_dir}
make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE.Apache-2.0 %{buildroot}/usr/share/license/privilege-info
-
%make_install
+%clean
+rm -rf %{buildroot}
+
+%post -n privilege-info -p /sbin/ldconfig
+%postun -n privilege-info -p /sbin/ldconfig
+
%files -n privilege-info
+%license LICENSE.Apache-2.0
+%manifest packaging/privilege-info.manifest
%{_libdir}/libprivilege-info.so.*
-/usr/share/license/privilege-info
%files -n privilege-info-devel
+%manifest packaging/privilege-info.manifest
%{_libdir}/libprivilege-info.so
-%{_includedir}/*.h
+%{_includedir}/privilege_information.h
%{_libdir}/pkgconfig/privilege-info.pc
-%files -n tc-privilege-info
-%{_bindir}/tc-privilege-info
+%files -n privilege-info-tests
+%manifest packaging/privilege-info.manifest
+%{_bindir}/privilege-info-tests
-%clean
-rm -rf %{buildroot}
+%if "%{build_type}" == "COVERAGE"
+%files -n privilege-info-coverage
+%manifest packaging/privilege-info.manifest
+%{_bindir}/privilege-info-coverage.sh
+%coverage_dir
+
+%endif