Release version 1.3.19
[platform/core/appfw/rpc-port.git] / packaging / rpc-port.spec
1 Name:       rpc-port
2 Summary:    RPC Port library
3 Version:        1.3.19
4 Release:    0
5 Group:          Application Framework/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:     %{name}.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(bundle)
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(aul)
14 BuildRequires:  pkgconfig(pkgmgr)
15 BuildRequires:  pkgconfig(pkgmgr-info)
16 BuildRequires:  pkgconfig(gmock)
17 BuildRequires:  pkgconfig(cynara-client)
18 BuildRequires:  pkgconfig(cynara-creds-gdbus)
19 BuildRequires:  pkgconfig(uuid)
20
21 %if 0%{?gcov:1}
22 BuildRequires:  lcov
23 BuildRequires:  zip
24 %endif
25
26 Requires(post): /sbin/ldconfig
27 Requires(post): coreutils
28 Requires(postun): /sbin/ldconfig
29
30 Recommends: amd-mod-rpc-port
31
32 %description
33 RPC Port library package.
34
35 %package devel
36 Summary:  RPC Port library (Development)
37 Group:    Application Framework/Development
38 Requires: %{name} = %{version}-%{release}
39
40 %description devel
41 RPC Port library (Development) package.
42
43 #################################################
44 # rpc-port-unittests
45 #################################################
46 %package -n rpc-port-unittests
47 Summary:    GTest for rpc-port
48 Group:      Development/Libraries
49 Requires:   %{name}
50
51 %description -n rpc-port-unittests
52 GTest for rpc-port
53
54 #################################################
55 # rpc-port-gcov
56 #################################################
57 %if 0%{?gcov:1}
58 %package gcov
59 Summary:    RPC Port(gcov)
60 Group:      Application Framework/Testing
61
62 %description gcov
63 RPC Port gcov objects
64 %endif
65
66 %prep
67 %setup -q
68 cp %{SOURCE1001} .
69
70 %build
71 %if 0%{?gcov:1}
72 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
73 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
74 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
75 export LDFLAGS+=" -lgcov"
76 %endif
77
78 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
79 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
80 # Call make instruction with smp support
81 %__make %{?jobs:-j%jobs}
82
83 %if 0%{?gcov:1}
84 mkdir -p gcov-obj
85 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
86 %endif
87
88 %check
89 ctest --output-on-failure %{?_smp_mflags}
90 %if 0%{?gcov:1}
91 lcov -c --ignore-errors graph --no-external -q -d . -o rpc-port.info
92 genhtml rpc-port.info -o rpc-port.out
93 zip -r rpc-port.zip rpc-port.out rpc-port.info
94 install -m 0644 rpc-port.zip %{buildroot}%{_datadir}/gcov/
95 %endif
96
97 %install
98 rm -rf %{buildroot}
99
100 %make_install
101
102 %if 0%{?gcov:1}
103 mkdir -p %{buildroot}%{_datadir}/gcov/obj
104 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
105 %endif
106
107 %post -p /sbin/ldconfig
108
109 %postun -p /sbin/ldconfig
110
111 %post -n rpc-port-unittests
112 %if 0%{?gcov:1}
113 %{_bindir}/rpc-port_unittests
114 %endif
115
116 %files
117 %manifest %{name}.manifest
118 %attr(0644,root,root) %{_libdir}/lib%{name}.so.*
119 %license LICENSE.APLv2
120
121 %files devel
122 %{_includedir}/rpc-port/*.h
123 %{_libdir}/pkgconfig/*.pc
124 %{_libdir}/lib%{name}.so
125
126 #################################################
127 # rpc-port-unittests
128 #################################################
129 %files -n rpc-port-unittests
130 %{_bindir}/rpc-port_unittests
131
132 #################################################
133 # rpc-port-gcov
134 #################################################
135 %if 0%{?gcov:1}
136 %files gcov
137 %{_datadir}/gcov/*
138 %endif