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