eefdaa9b6d644d23adb0442d9a767503b01bdf44
[platform/core/security/privilege-info.git] / packaging / privilege-info.spec
1 Name:    privilege-info
2 Summary: Privilege Information
3 Version: 0.0.3
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(cynara-client)
17 BuildRequires: pkgconfig(cynara-session)
18 BuildRequires: pkgconfig(libsmack)
19 BuildRequires: pkgconfig(libtzplatform-config)
20 BuildRequires: pkgconfig(capi-system-info)
21 %if 0%{?gcov:1}
22 BuildRequires: lcov
23 %endif
24 Requires: tizen-locale
25
26 %description
27 Provides Privilege Information(Privilege Info) API
28
29 %package -n privilege-info-devel
30 Summary: Privilege Info API (Development)
31 Group:   Security/Development
32 Requires: %{name} = %{version}-%{release}
33
34 %description -n privilege-info-devel
35 The Privilege Info API provides functions to get privilege information (DEV)
36
37 %package -n tc-privilege-info
38 Summary: Privilege Info TC
39 Group:   Security/Testing
40 Requires: %{name} = %{version}-%{release}
41
42 %description -n tc-privilege-info
43 Privilege Info API Internal Test
44
45 %if 0%{?gcov:1}
46 %package gcov
47 Summary:  Privilege Info(gcov)
48 Group:    Security/Testing
49 %description gcov
50 New Privilege Info gcov objects
51 %endif
52
53
54 %prep
55 %setup -q
56
57 %build
58
59 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
60 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
61 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
62
63 %if 0%{?gcov:1}
64 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
65 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
66 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
67 export LDFLAGS+=" -lgcov"
68 %endif
69
70 echo cmake . -DPREFIX=%{_prefix} \
71         -DLIBDIR=%{_libdir} \
72         -DINCLUDEDIR=%{_includedir} \
73         -DCMAKE_BUILD_TYPE=%{build_type} \
74         -DVERSION=%{version} \
75         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
76         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
77         -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
78
79 cmake . -DPREFIX=%{_prefix} \
80         -DLIBDIR=%{_libdir} \
81         -DINCLUDEDIR=%{_includedir} \
82         -DCMAKE_BUILD_TYPE=%{build_type} \
83         -DVERSION=%{version} \
84         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
85         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
86         -DBUILD_GCOV={?gcov:1}%{!?gcov:0}
87
88 make %{?jobs:-j%jobs}
89
90 %if 0%{?gcov:1}
91 mkdir -p gcov-obj
92 find . \( -name '*.gcno' ! -name 'tc_*' \) -exec cp '{}' gcov-obj ';'
93 %endif
94
95 %install
96 rm -rf %{buildroot}
97
98 %make_install
99
100 %if 0%{?gcov:1}
101 mkdir -p %{buildroot}%{_datadir}/gcov/obj
102 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
103 %endif
104
105 %post -n privilege-info -p /sbin/ldconfig
106 %postun -n privilege-info -p /sbin/ldconfig
107
108 %post -n tc-privilege-info
109 tpk-backend -y org.tizen.test-privilege-info --preload
110 cyad -s -k MANIFESTS -c User::Pkg::org.tizen.test-privilege-info -u '*' -p http://tizen.org/privilege/contact.read -t DENY
111
112 %files -n privilege-info
113 %{_libdir}/libprivilege-info.so*
114 %license LICENSE.Apache-2.0
115 %manifest packaging/privilege-info.manifest
116
117 %files -n privilege-info-devel
118 %{_includedir}/privilege_information.h
119 %{_libdir}/pkgconfig/privilege-info.pc
120
121 %files -n tc-privilege-info
122 %manifest test/org.tizen.test-privilege-info.manifest
123 %{TZ_SYS_RO_APP}/org.tizen.test-privilege-info/bin/tc-privilege-info-app-privacy
124 %{TZ_SYS_RO_PACKAGES}/org.tizen.test-privilege-info.xml
125 %{_bindir}/tc-privilege-info
126
127 %if 0%{?gcov:1}
128 %files gcov
129 %{_datadir}/gcov/obj/*
130 %endif
131
132 %clean
133 rm -rf %{buildroot}
134