a900f96944690afeba8e7a7b3dd4416bdf0e685f
[platform/core/api/http.git] / packaging / capi-network-http.spec
1 Name:           capi-network-http
2 Summary:        Http Framework
3 Version:        0.0.39
4 Release:        0
5 Group:          System/Network
6 License:        Apache-2.0
7 Source0:        %{name}-%{version}.tar.gz
8 BuildRequires:  pkgconfig(dlog)
9 BuildRequires:  pkgconfig(capi-base-common)
10 BuildRequires:  pkgconfig(glib-2.0)
11 BuildRequires:  pkgconfig(gio-2.0)
12 BuildRequires:  pkgconfig(capi-network-connection)
13 BuildRequires:  pkgconfig(libcurl)
14 BuildRequires:  pkgconfig(cynara-client)
15 BuildRequires:  pkgconfig(gmock)
16 BuildRequires:  cmake
17 %if 0%{?gcov:1}
18 BuildRequires: lcov
19 BuildRequires: tar
20 %endif
21 Requires(post):         /sbin/ldconfig
22 Requires(postun):       /sbin/ldconfig
23
24 %description
25 Http framework library for CAPI
26
27 %package devel
28 Summary:        Development package for Http framework library
29 Group:          Development/Libraries
30 Requires:       %{name} = %{version}-%{release}
31 %description devel
32 Development package for Http framework library
33
34 %if 0%{?gcov:1}
35 %package gcov
36 Summary:  HTTP library(gcov)
37 Group:    Network/Testing
38 %description gcov
39 gcov objects for coverage test
40 %endif
41
42 %prep
43 %setup -q
44
45 %build
46 %if 0%{?gcov:1}
47 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
48 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
49 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
50 export LDFLAGS+=" -lgcov"
51 %endif
52
53 %cmake -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} -DLIB_INSTALL_DIR=%{_libdir} \
54         -DUSE_LOCALHOST_SERVER=%{?gproxy:0}%{!?gproxy:1} \
55         .
56
57 make %{?_smp_mflags}
58
59 %install
60 %make_install
61
62 %if 0%{?gcov:1}
63 builddir=$(basename $PWD)
64 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
65 mkdir -p "$gcno_obj_dir"
66 find . -name '*.gcno' ! -path '*/tools/*' -exec cp --parents '{}' "$gcno_obj_dir" ';'
67 %endif
68
69 %check
70 %if 0%{?gcov:1}
71 %if 0%{?gproxy:1}
72 env all_proxy=%{gproxy} tests/http-gtest # http://[proxy addr]:[port]
73 %else
74 tests/http-gtest
75 %endif
76 %endif
77
78 %if 0%{?gcov:1}
79 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
80 genhtml %{name}.info -o out --legend --show-details
81 %endif
82
83 %post -p /sbin/ldconfig
84
85 %postun -p /sbin/ldconfig
86
87 %files
88 %manifest capi-network-http.manifest
89 %defattr(-,root,root,-)
90 %{_libdir}/*.so.*
91 %{_bindir}/http_test
92 %license LICENSE
93
94 %files devel
95 %defattr(-,root,root,-)
96 %{_includedir}/network/*.h
97 %{_libdir}/pkgconfig/*.pc
98 %{_libdir}/*.so
99 %license LICENSE
100
101 %if 0%{?gcov:1}
102 %files gcov
103 %{_datadir}/gcov/obj/*
104 %endif