Release version 0.0.7
[platform/core/security/privilege-info.git] / packaging / privilege-info.spec
1 Name:    privilege-info
2 Summary: Privilege Information
3 Version: 0.0.7
4 Release: 1
5 Group:   Security/API
6 License: Apache-2.0
7 Source0: %{name}-%{version}.tar.gz
8
9 Requires(post):   /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11 BuildRequires: cmake
12 BuildRequires: pkgconfig(glib-2.0)
13 BuildRequires: pkgconfig(dlog)
14 BuildRequires: pkgconfig(capi-base-common)
15 BuildRequires: pkgconfig(security-privilege-manager)
16 BuildRequires: pkgconfig(libtzplatform-config)
17 BuildRequires: pkgconfig(capi-system-info)
18 %if 0%{?gcov:1}
19 BuildRequires: lcov
20 %endif
21 Requires: tizen-locale
22
23 %description
24 Provides Privilege Information(Privilege Info) API
25
26 %package -n privilege-info-devel
27 Summary: Privilege Info API (Development)
28 Group:   Security/Development
29 Requires: %{name} = %{version}-%{release}
30
31 %description -n privilege-info-devel
32 The Privilege Info API provides functions to get privilege information (DEV)
33
34 %package -n tc-privilege-info
35 Summary: Privilege Info TC
36 Group:   Security/Testing
37 Requires: %{name} = %{version}-%{release}
38
39 %description -n tc-privilege-info
40 Privilege Info API Internal Test
41
42 %if 0%{?gcov:1}
43 %package gcov
44 Summary:  Privilege Info(gcov)
45 Group:    Security/Testing
46 %description gcov
47 New Privilege Info gcov objects
48 %endif
49
50
51 %prep
52 %setup -q
53
54 %build
55
56 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
57 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
58 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
59
60 %if 0%{?gcov:1}
61 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
62 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
63 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
64 export LDFLAGS+=" -lgcov"
65 %endif
66
67 echo cmake . -DPREFIX=%{_prefix} \
68         -DLIBDIR=%{_libdir} \
69         -DINCLUDEDIR=%{_includedir} \
70         -DCMAKE_BUILD_TYPE=%{build_type} \
71         -DVERSION=%{version} \
72         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
73         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
74         -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
75
76 cmake . -DPREFIX=%{_prefix} \
77         -DLIBDIR=%{_libdir} \
78         -DINCLUDEDIR=%{_includedir} \
79         -DCMAKE_BUILD_TYPE=%{build_type} \
80         -DVERSION=%{version} \
81         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
82         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
83         -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
84
85 make %{?jobs:-j%jobs}
86
87 %if 0%{?gcov:1}
88 mkdir -p gcov-obj
89 find . \( -name '*.gcno' ! -name 'tc_*' \) -exec cp '{}' gcov-obj ';'
90 %endif
91
92 %install
93 rm -rf %{buildroot}
94
95 %make_install
96
97 %if 0%{?gcov:1}
98 mkdir -p %{buildroot}%{_datadir}/gcov/obj
99 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
100 %endif
101
102 %post -n privilege-info -p /sbin/ldconfig
103 %postun -n privilege-info -p /sbin/ldconfig
104
105 %files -n privilege-info
106 %{_libdir}/libprivilege-info.so*
107 %license LICENSE.Apache-2.0
108 %manifest packaging/privilege-info.manifest
109
110 %files -n privilege-info-devel
111 %{_includedir}/privilege_information.h
112 %{_libdir}/pkgconfig/privilege-info.pc
113
114 %files -n tc-privilege-info
115 %{_bindir}/tc-privilege-info
116
117 %if 0%{?gcov:1}
118 %files gcov
119 %{_datadir}/gcov/obj/*
120 %endif
121
122 %clean
123 rm -rf %{buildroot}
124