Change lib path for 64 bit
[platform/core/api/media-key.git] / packaging / capi-system-media-key.spec
1 Name:       capi-system-media-key
2 Summary:    A System Information library in SLP C API
3 Version:    0.2.3
4 Release:    6
5 Group:      System/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:     capi-system-media-key.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(capi-base-common)
12 BuildRequires:  pkgconfig(ecore)
13 BuildRequires:  pkgconfig(ecore-input)
14 BuildRequires:  pkgconfig(evas)
15 BuildRequires:  pkgconfig(ecore-wl2)
16 BuildRequires:  pkgconfig(gmock)
17
18 %if 0%{?gcov:1}
19 BuildRequires:  lcov
20 BuildRequires:  zip
21 %endif
22
23 %description
24 %{summary}.
25
26 %package devel
27 Summary:  A Media Key library in SLP C API (Development)
28 Group:    System/API
29 Requires: %{name} = %{version}
30
31 %description devel
32 %devel_desc
33
34 %if 0%{?gcov:1}
35 %package gcov
36 Summary:  A media key library(gcov)
37 Group:    System/API
38
39 %description gcov
40 gcov objects of an media key library
41 %endif
42
43 %prep
44 %setup -q
45 cp %{SOURCE1001} .
46
47 %build
48 %if 0%{?gcov:1}
49 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
50 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
51 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
52 export LDFLAGS+=" -lgcov"
53 %endif
54
55 export CFLAGS+=" -DEFL_BETA_API_SUPPORT "
56 export CXXFLAGS+=" -DEFL_BETA_API_SUPPORT "
57 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
58 %cmake -DFULLVER=%{version} -DLIB_INSTALL_DIR=%{_libdir} \
59         -DMAJORVER=${MAJORVER} \
60         .
61
62 make %{?jobs:-j%jobs}
63
64 %if 0%{?gcov:1}
65 mkdir -p gcov-obj
66 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
67 %endif
68
69 %install
70 %make_install
71
72 %if 0%{?gcov:1}
73 mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name}
74 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}
75 %endif
76
77 %check
78 (cd unittest && LD_LIBRARY_PATH=../ ctest -V)
79 %if 0%{?gcov:1}
80 lcov -c --ignore-errors graph --no-external -q -d . -o media_key.info
81 genhtml media_key.info -o media_key.out
82 zip -r media_key.zip media_key.out
83 install -m 0644 media_key.zip %{buildroot}%{_datadir}/gcov/
84 %endif
85
86 %post -p /sbin/ldconfig
87
88 %postun -p /sbin/ldconfig
89
90 %files
91 %manifest %{name}.manifest
92 %license LICENSE
93 %{_libdir}/libcapi-system-media-key.so.*
94
95 %files devel
96 %manifest %{name}.manifest
97 %{_includedir}/system/media_key.h
98 %{_libdir}/pkgconfig/*.pc
99 %{_libdir}/libcapi-system-media-key.so
100
101 %if 0%{?gcov:1}
102 %files gcov
103 %{_datadir}/gcov/*
104 %endif