Rearrange folder
[platform/core/api/uwb.git] / packaging / capi-network-uwb.spec
1 Name:       capi-network-uwb
2 Summary:    UWB CAPI
3 Version:    0.1.1
4 Release:    0
5 Group:      Network & Connectivity/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    %{name}.manifest
9
10 BuildRequires: cmake
11 BuildRequires: pkgconfig(dlog)
12 BuildRequires: pkgconfig(gio-2.0)
13 BuildRequires: pkgconfig(glib-2.0)
14 BuildRequires: pkgconfig(gio-unix-2.0)
15 BuildRequires: pkgconfig(capi-system-info)
16
17 Requires(post): /sbin/ldconfig
18 Requires(postun): /sbin/ldconfig
19
20 %if 0%{?gcov:1}
21 BuildRequires:  lcov
22 BuildRequires:  tar
23 %endif
24 BuildRequires:  pkgconfig(gmock)
25
26 %description
27 UWB API library
28
29 %package devel
30 Summary:  UWB API library (development library)
31 Group:    Development/Libraries
32 Requires: %{name} = %{version}-%{release}
33
34 %description devel
35 This package contains the development files for %{name} API library.
36
37 %package tests
38 Summary:  Test Application UWB
39 Group:    Network & Connectivity/Testing
40 Requires: %{name} = %{version}-%{release}
41
42 %description tests
43 Test Application for UWB Framework
44
45 %if 0%{?gcov:1}
46 %package gcov
47 Summary:    A UWB gcov Tool
48 Group:      Network & Connectivity/Development
49
50 %description gcov
51 UWB gcov objects
52 %endif
53
54 %prep
55 %setup -q
56 chmod 644 %{SOURCE0}
57 cp %{SOURCE1} ./%{name}.manifest
58
59 %build
60
61 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
62 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
63 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
64
65 %if 0%{?gcov:1}
66 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
67 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
68 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
69 export LDFLAGS+=" -lgcov"
70 %endif
71
72 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
73
74 cmake . \
75         -DCMAKE_VERBOSE_MAKEFILE=ON \
76         -DLIB_DIR:PATH=%{_libdir} \
77         -DBIN_DIR:PATH=%{_bindir} \
78         -DINCLUDE_DIR:PATH=%{_includedir} \
79         -DFULLVER=%{version} \
80         -DMAJORVER=${MAJORVER}
81
82 make %{?_smp_mflags}
83
84 %install
85
86 %make_install
87
88 %if 0%{?gcov:1}
89 find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
90 install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
91 tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
92 %endif
93
94 %check
95 #tests/%{name}-gtest
96 %if 0%{?gcov:1}
97 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
98 genhtml %{name}.info -o out --legend --show-details
99 %endif
100
101 %post -p /sbin/ldconfig
102
103 %postun -p /sbin/ldconfig
104
105
106 %files
107 %manifest %{name}.manifest
108 %license LICENSE.APLv2
109 %defattr(-,root,root,-)
110 %attr(644,-,-) %{_libdir}/lib%{name}.so.*
111
112 %files devel
113 %defattr(-,root,root,-)
114 %attr(644,-,-) %{_libdir}/lib%{name}.so
115 %{_libdir}/pkgconfig/%{name}.pc
116 %{_includedir}/*.h
117
118 %files tests
119 #%{_bindir}/%{name}-test
120 #%{_bindir}/%{name}-gtest
121
122 %if 0%{?gcov:1}
123 %files gcov
124 %{_datadir}/gcov/obj/*
125 %endif