summaryrefslogtreecommitdiff
path: root/packaging/capi-network-ua.spec
blob: 33f3edaf4a09c1a471c2ae127276b4f57b39b63d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Name: capi-network-ua
Summary: User Awareness Framework CAPI
Version: 0.13.5
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz

BuildRequires:	cmake
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(ua-api)

%if 0%{?ptest:1}
BuildRequires:  pkgconfig(deviced)
BuildRequires:  pkgconfig(power-defs)
%endif

%define _confdir /opt/data

%description
Activity API Library

%package devel
Summary: User Awareness Framework CAPI (devel)
Requires: %{name} = %{version}

%description devel
User Awareness Framework CAPI

%package test
Summary: User Awareness Framework test application
Group:   TO_BE/FILLED
Requires: %{name} = %{version}-%{release}

%description test
This package is for User Awareness Framework CAPI test application

%if 0%{?gcov:1}
%package gcov
Summary:    A User Awareness gcov Tool
Group:      Network & Connectivity/Development

%description gcov
User Awareness gcov objects
%endif

%prep
%setup -q

%build

%if 0%{?gcov:1}
export LDFLAGS+=" -lgcov"
%endif

MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DLIB_INSTALL_DIR=%{_libdir} \
	-DBIN_INSTALL_DIR=%{_bindir} \
	-DINCLUDE_INSTALL_DIR=%{_includedir} \
	-DLIB_PATH=%{_lib} \
	-DSUSPEND_RESUME_TEST=%{?ptest:1}%{!?ptest:0} \
	-DFULLVER=%{version} \
	-DMAJORVER=${MAJORVER} \
	-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}

make %{?jobs:-j%jobs}

%if 0%{?gcov:1}
mkdir -p gcov-obj
find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
%endif

%install
%make_install

%if 0%{?gcov:1}
mkdir -p %{buildroot}%{_datadir}/gcov/obj
install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
%endif

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%license LICENSE
%attr(644,-,-) %{_libdir}/lib%{name}.so
%attr(644,-,-) %{_libdir}/lib%{name}.so.*

%files devel
%manifest %{name}-devel.manifest
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/*

%files test
%manifest %{name}.manifest
%attr(777,network_fw,network_fw) %{_bindir}/ua-test

%if 0%{?gcov:1}
%files gcov
%{_datadir}/gcov/obj/*
%endif