Release version 0.3.2
[platform/core/base/bundle.git] / packaging / bundle.spec
1 Name:       bundle
2 Summary:    String key-val dictionary ADT
3 Version:    0.3.2
4 Release:    0
5 Group:      System/Libraries
6 License:    Apache-2.0
7 Source0:        bundle-%{version}.tar.gz
8 Source1001:     bundle.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(glib-2.0)
11 BuildRequires:  pkgconfig(dlog)
12 BuildRequires:  pkgconfig(capi-base-common)
13 BuildRequires:  pkgconfig(json-glib-1.0)
14 BuildRequires:  pkgconfig(gmock)
15
16 %if 0%{?gcov:1}
17 BuildRequires:  lcov
18 BuildRequires:  zip
19 %endif
20
21 %description
22 Simple string key-val dictionary ADT
23
24 %package devel
25 Summary:    String key-val dictionary ADT (devel)
26 Group:      Development/Libraries
27 Requires:   %{name} = %{version}-%{release}
28
29 %description devel
30 Simple string key-val dictionary ADT (devel)
31
32 #################################################
33 # unittests
34 #################################################
35 %package unittests
36 Summary:    GTest for bundle
37 Group:      Development/Libraries
38
39 %description unittests
40 GTest for bundle
41
42 #################################################
43 # gcov
44 #################################################
45 %if 0%{?gcov:1}
46 %package gcov
47 Summary:    Simple string key-val dictionary ADT (gcov)
48 Group:      Application Framework/Testing
49
50 %description gcov
51 Simple string key-val dictionary ADT gcov objects
52 %endif
53
54 %prep
55 %setup -q -n %{name}-%{version}
56 cp %{SOURCE1001} .
57
58 %build
59 %if 0%{?gcov:1}
60 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
61 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
62 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
63 export LDFLAGS+=" -lgcov"
64 %endif
65
66 %cmake -DVERSION=%{version} .
67 %__make %{?_smp_mflags}
68
69 %if 0%{?gcov:1}
70 mkdir -p gcov-obj
71 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
72 %endif
73
74 %install
75 %make_install
76
77 %if 0%{?gcov:1}
78 mkdir -p %{buildroot}%{_datadir}/gcov/obj
79 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
80 %endif
81
82 %check
83 ctest --output-on-failure %{?_smp_mflags}
84 %if 0%{?gcov:1}
85 lcov -c --ignore-errors graph --no-external -q -d . -o bundle.info
86 genhtml bundle.info -o bundle.out
87 zip -r bundle.zip bundle.out bundle.info
88 install -m 0644 bundle.zip %{buildroot}%{_datadir}/gcov/
89 %endif
90
91 %post -p /sbin/ldconfig
92
93 %postun -p /sbin/ldconfig
94
95 %post unittests
96 %if 0%{?gcov:1}
97 %{_bindir}/bundle_unittests
98 %endif
99
100 %files
101 %manifest %{name}.manifest
102 %defattr(-,root,root,-)
103 %{_libdir}/libbundle.so.*
104 %license LICENSE
105
106 %files devel
107 %manifest %{name}.manifest
108 %defattr(-,root,root,-)
109 %{_includedir}/*.h
110 %{_libdir}/pkgconfig/bundle.pc
111 %{_libdir}/libbundle.so
112
113 #################################################
114 # unittests
115 #################################################
116 %files unittests
117 %{_bindir}/bundle_unittests
118
119 #################################################
120 # bundle-gcov
121 #################################################
122 %if 0%{?gcov:1}
123 %files gcov
124 %{_datadir}/gcov/*
125 %endif