1f2c5aeb4304a87b530a0a3524126e98bd9db58a
[platform/core/appfw/libslp-db-util.git] / packaging / libslp-db-util.spec
1 Name:           libslp-db-util
2 Version:        0.1.1
3 Release:        6
4 License:        Apache-2.0
5 Summary:        DB Utility
6 Group:          Application Framework/Database
7 Source0:        %{name}-%{version}.tar.gz
8 Source1001:     %{name}.manifest
9 Source1002:     %{name}-devel.manifest
10 BuildRequires:  cmake
11 BuildRequires:  pkgconfig(dlog)
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(icu-i18n)
14 BuildRequires:  pkgconfig(sqlite3)
15 BuildRequires:  pkgconfig(vconf)
16
17 %if 0%{?gcov:1}
18 BuildRequires:  gtest-devel
19 BuildRequires:  lcov
20 %endif
21
22 %description
23 DB Utility.
24
25 %package devel
26 Summary:        Devel package for libslp-db-util (devel)
27 Requires:       %{name} = %{version}
28 %description devel
29 Devel package for libslp-db-util (devel)
30
31 %if 0%{?gcov:1}
32 %package gcov
33 Summary:  DB Utility(gcov)
34 Group:    Application Framework/Database
35 %description gcov
36 libslp-db-util gcov objects
37 %endif
38
39 %prep
40 %setup -q
41 cp %{SOURCE1001} %{SOURCE1002} .
42
43 %build
44
45 %ifarch aarch64 x86_64
46 export CFLAGS+=" $CFLAGS -DDB_UTIL_ARCH_64 "
47 export CXXFLAGS+=" $CXXFLAGS -DDB_UTIL_ARCH_64 "
48 export FFLAGS+=" $FFLAGS -DDB_UTIL_ARCH_64 "
49 %endif
50
51 %if 0%{?gcov:1}
52 export CFLAGS+=" -O0 -fprofile-arcs -ftest-coverage"
53 export CXXFLAGS+=" -O0 -fprofile-arcs -ftest-coverage"
54 %define CMAKE_GCOV -DGCOV=1
55 %else
56 %define CMAKE_GCOV %{nil}
57 %endif
58
59 %cmake . %{CMAKE_GCOV}
60 make %{?_smp_mflags}
61
62 %if 0%{?gcov:1}
63 mkdir -p gcov-obj
64 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
65 %endif
66
67 %install
68 %make_install
69
70 %if 0%{?gcov:1}
71 mkdir -p %{buildroot}%{_datadir}/gcov/obj
72 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
73 %endif
74
75 %check
76 %if 0%{?gcov:1}
77 pushd unittest
78 ./run_coverage.sh
79 popd
80 %endif
81
82 %post -p /sbin/ldconfig
83
84 %postun -p /sbin/ldconfig
85
86 %files
87 %manifest %{name}.manifest
88 %license LICENSE
89 %defattr(-,root,root,-)
90 %{_libdir}/libSLP-db-util.so.0
91 %{_libdir}/libSLP-db-util.so.0.1.0
92
93 %files devel
94 %manifest %{name}-devel.manifest
95 %defattr(-,root,root,-)
96 %dir %{_includedir}/db-util
97 %{_includedir}/db-util/*.h
98 %{_libdir}/pkgconfig/db-util.pc
99 %{_libdir}/libSLP-db-util.so
100
101
102 %if 0%{?gcov:1}
103 %files gcov
104 %manifest %{name}-devel.manifest
105 %defattr(-,root,root,-)
106 %{_datadir}/gcov/obj/*
107 %endif