fix merge duplication
[platform/core/uifw/stt.git] / packaging / stt.spec
1 Name:       stt
2 Summary:    Speech To Text client library and daemon
3 Version:    1.90.0
4 Release:    1
5 Group:      Graphics & UI Framework/Voice Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9 Source1002: %{name}-devel.manifest
10 Requires(post): /sbin/ldconfig
11 Requires(post): /usr/bin/buxton2ctl
12 Requires(postun): /sbin/ldconfig
13 Requires:  gawk
14 BuildRequires:  pkgconfig(aul)
15 BuildRequires:  pkgconfig(capi-appfw-app-manager)
16 BuildRequires:  pkgconfig(buxton2)
17 BuildRequires:  pkgconfig(capi-base-common)
18 BuildRequires:  pkgconfig(capi-media-audio-io)
19 BuildRequires:  pkgconfig(capi-media-wav-player)
20 BuildRequires:  pkgconfig(capi-system-info)
21 BuildRequires:  pkgconfig(cynara-client)
22 BuildRequires:  pkgconfig(cynara-session)
23 BuildRequires:  pkgconfig(dbus-1)
24 BuildRequires:  pkgconfig(dlog)
25 BuildRequires:  pkgconfig(ecore)
26 BuildRequires:  pkgconfig(glib-2.0)
27 BuildRequires:  pkgconfig(libgum)
28 BuildRequires:  pkgconfig(libtzplatform-config)
29 BuildRequires:  pkgconfig(libxml-2.0)
30 BuildRequires:  pkgconfig(pkgmgr)
31 BuildRequires:  pkgconfig(pkgmgr-info)
32 BuildRequires:  pkgconfig(pkgmgr-installer)
33 BuildRequires:  pkgconfig(vconf)
34 BuildRequires:  pkgconfig(gmock)
35 %if "%{tizen_profile_name}" == "tv"
36 BuildRequires:  pkgconfig(capi-network-bluetooth)
37 BuildRequires:  pkgconfig(capi-network-bluetooth-tv)
38 BuildRequires:  pkgconfig(farfield-voice-api)
39 %endif
40
41 BuildRequires:  cmake
42
43 %if 0%{?gcov:1}
44 BuildRequires:  lcov
45 BuildRequires:  zip
46 %endif
47
48 %description
49 Speech To Text client library and daemon.
50
51
52 %package devel
53 Summary:    Speech To Text header files for STT development
54 Group:      Graphics & UI Framework/Development
55 Requires:   %{name} = %{version}-%{release}
56
57 %package file-devel
58 Summary:    File To Text header files for STT FILE development
59 Group:      Graphics & UI Framework/Development
60 Requires:   %{name} = %{version}-%{release}
61
62 %package setting-devel
63 Summary:    Speech To Text setting header files for STT development
64 Group:      Graphics & UI Framework/Development
65 Requires:   %{name} = %{version}-%{release}
66
67 %package engine-devel
68 Summary:    Speech To Text engine header files for STT development
69 Group:      Graphics & UI Framework/Development
70 Requires:   %{name} = %{version}-%{release}
71
72 %package unittests
73 Summary:    STT tests
74 Group:      Development/Libraries
75 Requires:   %{name} = %{version}-%{release}
76
77 %description unittests
78 GTest for STT
79
80 %description devel
81 Speech To Text header files for STT development.
82
83 %description file-devel
84 File To Text header files for STT FILE development.
85
86 %description setting-devel
87 Speech To Text setting header files for STT development.
88
89 %description engine-devel
90 Speech To Text engine header files for STT development.
91
92 %if 0%{?gcov:1}
93 %package gcov
94 Summary:        Speech To Text (gcov)
95 Group:          Graphics & UI Framework/Voice Framework
96 %description gcov
97 Speech To Text gcov objects
98 %endif
99
100
101 %prep
102 %setup -q -n %{name}-%{version}
103 cp %{SOURCE1001} %{SOURCE1002} .
104
105
106 %build
107 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
108 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
109 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
110
111 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
112 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
113 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
114
115 %if 0%{?gcov:1}
116 export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
117 export CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
118 export FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage"
119 export LDFLAGS="$LDFLAGS -lgcov"
120 %endif
121
122
123 %if "%{tizen_profile_name}" == "tv"
124 export CFLAGS="$CFLAGS -DTV_PRODUCT"
125 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
126         -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -D_TV_PRODUCT=TRUE \
127         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP
128 %else
129 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
130         -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN \
131         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP
132 %endif
133
134 make %{?jobs:-j%jobs}
135
136
137 %install
138 rm -rf %{buildroot}
139
140 %if "%{tizen_profile_name}" == "tv"
141 mv -f org.tizen.voice.sttserver.tv.service org.tizen.voice.sttserver.service
142 %endif
143
144 %make_install
145
146 %if 0%{?gcov:1}
147 builddir=$(basename $PWD)
148 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
149 mkdir -p "$gcno_obj_dir"
150 find ./server/ -name '*.gcno' -exec rm {} \;
151 find ./engine-parser/ -name '*.gcno' -exec rm {} \;
152 find ./test/ -name '*.gcno' -exec rm {} \;
153 find ./tests/ -name '*.gcno' -exec rm {} \;
154 find . -name '*_client.c.gcno' -exec rm {} \;
155 find . -name '*_dbus.c.gcno' -exec rm {} \;
156 find . -name 'stt_config*.gcno' -exec rm {} \;
157 find . -name '*_engine.c.gcno' -exec rm {} \;
158 find . -name 'sttd*.gcno' -exec rm {} \;
159 find . -name '*_file*.gcno' -exec rm {} \;
160 find . -name '*_network.c.gcno' -exec rm {} \;
161 find . -name '*_setting.c.gcno' -exec rm {} \;
162 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
163 %endif
164
165 cat << EOF > run-unittest.sh
166 #!/bin/sh
167 setup() {
168     echo "setup start"
169     touch /opt/share/askuser_disable
170     mount -o remount,rw /
171     tpk-backend --preload -y org.tizen.stt-unittests
172 }
173
174 test_main() {
175     echo "test_main start"
176     launch_app org.tizen.stt-unittests __AUL_SDK__ UNIT_TEST __LAUNCH_APP_MODE__ SYNC
177 }
178
179 teardown() {
180     echo "teardown start"
181 }
182
183 main() {
184     setup
185     test_main
186     teardown
187 }
188
189 main "\$*"
190 EOF
191
192 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
193 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}
194
195 %post
196 /sbin/ldconfig
197
198 mkdir -p %{_libdir}/voice/
199
200 mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
201
202 %postun -p /sbin/ldconfig
203
204
205 %files
206 %manifest %{name}.manifest
207 %license LICENSE.APLv2
208 %defattr(-,root,root,-)
209 %{_libdir}/lib*.so
210 /etc/dbus-1/session.d/stt-server.conf
211 %{TZ_SYS_RO_SHARE}/voice/stt/1.0/stt-config.xml
212 %{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.sttserver.service
213 %{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.sttservercustom.service
214 #%{TZ_SYS_RO_SHARE}/voice/test/stt-test
215 #%{TZ_SYS_BIN}/*
216 %{_bindir}/voice_getengine
217 %{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libstt-engine-parser.so*
218
219 %files devel
220 %manifest %{name}-devel.manifest
221 %defattr(-,root,root,-)
222 %{_libdir}/pkgconfig/stt.pc
223 %{_includedir}/stt.h
224 %{_includedir}/stt_internal.h
225
226 %files file-devel
227 %defattr(-,root,root,-)
228 %{_libdir}/pkgconfig/stt-file.pc
229 %{_includedir}/stt_file.h
230
231 %files setting-devel
232 %defattr(-,root,root,-)
233 %{_libdir}/pkgconfig/stt-setting.pc
234 %{_includedir}/stt_setting.h
235
236 %files engine-devel
237 %defattr(-,root,root,-)
238 %{_libdir}/pkgconfig/stt-engine.pc
239 %{_includedir}/stte.h
240 %{_includedir}/stte_internal.h
241
242 %if 0%{?gcov:1}
243 %files gcov
244 %{_datadir}/gcov/obj/*
245 %endif
246
247 %files unittests
248 %manifest tests/org.tizen.stt-unittests.manifest
249 %defattr(-,root,root,-)
250 %{TZ_SYS_RO_PACKAGES}/org.tizen.stt-unittests.xml
251 %{TZ_SYS_RO_APP}/org.tizen.stt-unittests/res/test_pcm.dat
252 %{TZ_SYS_RO_APP}/org.tizen.stt-unittests/res/ringtone.wav
253 %{TZ_SYS_RO_APP}/org.tizen.stt-unittests/bin/stt-unittests
254 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh