Change library path for 64-bit errors
[platform/core/api/tethering.git] / packaging / capi-network-tethering.spec
1 Name:           capi-network-tethering
2 Summary:        Tethering Framework
3 Version:        1.2.0
4 Release:        1
5 Group:          System/Network
6 License:        Apache-2.0
7 Source0:        %{name}-%{version}.tar.gz
8 BuildRequires:  pkgconfig(dlog)
9 BuildRequires:  pkgconfig(dbus-1)
10 BuildRequires:  pkgconfig(capi-base-common)
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(gio-2.0)
13 BuildRequires:  pkgconfig(vconf)
14 BuildRequires:  pkgconfig(key-manager)
15 BuildRequires:  pkgconfig(capi-system-info)
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 BuildRequires:  pkgconfig(gmock)
18 BuildRequires:  cmake
19 %if 0%{?gcov:1}
20 BuildRequires: lcov
21 BuildRequires: tar
22 %endif
23 Requires(post):         /sbin/ldconfig
24 Requires(postun):       /sbin/ldconfig
25
26 %description
27 Tethering framework library for CAPI
28
29 %package devel
30 Summary:        Development package for Tethering framework library
31 Group:          Development/Libraries
32 Requires:       %{name} = %{version}-%{release}
33 %description devel
34 Development package for Tethering framework library
35
36 %package tool
37 Summary:        Test application for Tethering
38 %description tool
39 Test application for Tethering
40
41 %if 0%{?gcov:1}
42 %package gcov
43 Summary:  Tethering Library(gcov)
44 Group:    Network/Testing
45 %description gcov
46 gcov objects for coverage test
47 %endif
48
49 %prep
50 %setup -q
51
52
53 %build
54 %if 0%{?gcov:1}
55 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
56 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
57 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
58 export LDFLAGS+=" -lgcov"
59 %endif
60
61 %if "%{?tizen_profile_name}" == "tv"
62 export CFLAGS+=" -DTIZEN_TV_EXT"
63 export CXXFLAGS+=" -DTIZEN_TV_EXT"
64 %endif
65
66 %cmake -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} -DLIB_INSTALL_DIR=%{_libdir} \
67         .
68 make %{?_smp_mflags}
69
70 %install
71 %make_install
72
73 %if 0%{?gcov:1}
74 find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
75 install -d -m 755 %{buildroot}%{_datadir}/gcov/obj/%{name}
76 tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj/%{name}
77 %endif
78
79 %check
80 %if 0%{?gcov:1}
81 tests/tethering-gtest
82 %endif
83
84 %if 0%{?gcov:1}
85 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
86 genhtml %{name}.info -o out --legend --show-details
87 %endif
88
89 %post -p /sbin/ldconfig
90
91 %postun -p /sbin/ldconfig
92
93 %files
94 %manifest capi-network-tethering.manifest
95 %defattr(-,root,root,-)
96 %{_libdir}/*.so.*
97 %license LICENSE
98
99 %files devel
100 %defattr(-,root,root,-)
101 %{_includedir}/network/*.h
102 %{_libdir}/pkgconfig/*.pc
103 %{_libdir}/*.so
104 %license LICENSE
105
106 %files tool
107 %{_bindir}/tethering_test
108
109 %if 0%{?gcov:1}
110 %files gcov
111 %{_datadir}/gcov/obj/%{name}/*
112 %endif