Update package version to 0.9.1
[platform/core/api/inputmethod.git] / packaging / capi-ui-inputmethod.spec
1 Name:       capi-ui-inputmethod
2 Summary:    Input Method Library
3 Version:    0.9.1
4 Release:    1
5 Group:      Graphics & UI Framework/Input
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires:  cmake
9 BuildRequires:  pkgconfig(capi-base-common)
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(evas)
12 BuildRequires:  pkgconfig(eina)
13 BuildRequires:  pkgconfig(ecore-imf)
14 BuildRequires:  pkgconfig(ecore-wl2)
15 BuildRequires:  pkgconfig(libscl-core)
16 BuildRequires:  pkgconfig(isf)
17 BuildRequires:  pkgconfig(cynara-client)
18 BuildRequires:  pkgconfig(cynara-session)
19 BuildRequires:  pkgconfig(gmock)
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
22
23 %if 0%{?gcov:1}
24 BuildRequires:  lcov
25 BuildRequires:  zip
26 %endif
27
28 %description
29 Input Method Library
30
31 %package devel
32 Summary:  Input Method Library (Development)
33 Group:    Development/Libraries
34 Requires: %{name} = %{version}-%{release}
35
36 %description devel
37 Input Method Library (Development)
38
39 %package -n capi-ui-remote-input
40 Summary:    Remote Input Library
41 Group:      Graphics & UI Framework/Input
42 Requires: %{name} = %{version}-%{release}
43
44 %description -n capi-ui-remote-input
45 Remote Input Library
46
47 %package -n capi-ui-remote-input-devel
48 Summary:    Remote Input Library (Development)
49 Group:      Development/Libraries
50 Requires: %{name} = %{version}-%{release}
51
52 %description -n capi-ui-remote-input-devel
53 Remote Input Library (Development)
54
55 %if 0%{?gcov:1}
56 %package gcov
57 Summary:  Input Method (gcov)
58 Group:    Graphics & UI Framework/Input
59 %description gcov
60 Input Method gcov objects
61 %endif
62
63 %package unittests
64 Summary:    inputmethod tests
65 Group:      Development/Libraries
66 Requires:   %{name} = %{version}-%{release}
67
68 %description unittests
69 GTest for inputmethod manager
70
71 %prep
72 %setup -q
73
74
75 %build
76
77 export CFLAGS+=" -DTIZEN_DEBUG_ENABLE -fPIC -fvisibility=hidden -Werror"
78 export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE -fPIC -fvisibility=hidden -Werror"
79 export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fPIC -fvisibility=hidden"
80
81 %if 0%{?gcov:1}
82 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
83 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
84 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
85 export LDFLAGS+=" -lgcov"
86 %endif
87
88 rm -rf CMakeFiles
89 rm -rf CMakeCache.txt
90 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
91 %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIB_INSTALL_DIR:PATH=%{_libdir} \
92 %if %{defined _test_type}
93     -DTEST_TYPE="%{_test_type}" \
94 %else
95     -DTEST_TYPE="none" \
96 %endif
97
98 make %{?jobs:-j%jobs}
99
100 %install
101 rm -rf %{buildroot}
102 %make_install
103
104 %if 0%{?gcov:1}
105 builddir=$(basename $PWD)
106 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
107 mkdir -p "$gcno_obj_dir"
108 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
109 %endif
110
111 cat << EOF > run-unittest.sh
112 #!/bin/sh
113 setup() {
114         echo "setup start"
115 }
116
117 test_main() {
118         echo "test_main start"
119         /usr/bin/capi-ui-inputmethod_unittest
120 }
121
122 teardown() {
123         echo "teardown start"
124 }
125
126 main() {
127         setup
128         test_main
129         teardown
130 }
131
132 main "\$*"
133 EOF
134
135 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
136 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}
137
138 %check
139 %if 0%{?gcov:1}
140 ctest --output-on-failure %{?_smp_mflags}
141 lcov -c --ignore-errors graph --no-external -q -d . -o %{name}.info
142 genhtml %{name}.info -o %{name}.out
143 zip -r %{name}.zip %{name}.out %{name}.info
144 install -m 0644 %{name}.zip %{buildroot}%{_datadir}/gcov/
145 %endif
146
147 %post -p /sbin/ldconfig
148
149 %postun -p /sbin/ldconfig
150
151
152 %files
153 %manifest capi-ui-inputmethod.manifest
154 %{_libdir}/libcapi-ui-inputmethod.so.*
155 %license LICENSE
156
157 %files devel
158 %{_includedir}/inputmethod*.h
159 %{_libdir}/pkgconfig/capi-ui-inputmethod.pc
160 %{_libdir}/libcapi-ui-inputmethod.so
161
162 %files -n capi-ui-remote-input
163 %manifest capi-ui-inputmethod.manifest
164 %{_libdir}/libcapi-ui-remote-input.so.*
165 %license LICENSE
166
167 %files -n capi-ui-remote-input-devel
168 %{_includedir}/remote_input*.h
169 %{_libdir}/pkgconfig/capi-ui-remote-input.pc
170 %{_libdir}/libcapi-ui-remote-input.so
171
172 %if 0%{?gcov:1}
173 %files gcov
174 %{_datadir}/gcov/*
175 %endif
176
177 %files unittests
178 %{_bindir}/*
179 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh