df89bbfbe64a0f7355c74d4dda510539826e7a12
[platform/core/uifw/stt.git] / packaging / stt.spec
1 Name:       stt
2 Summary:    Speech To Text client library and daemon
3 Version:    1.70.5
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 %description
44 Speech To Text client library and daemon.
45
46
47 %package devel
48 Summary:    Speech To Text header files for STT development
49 Group:      Graphics & UI Framework/Development
50 Requires:   %{name} = %{version}-%{release}
51
52 %package file-devel
53 Summary:    File To Text header files for STT FILE development
54 Group:      Graphics & UI Framework/Development
55 Requires:   %{name} = %{version}-%{release}
56
57 %package setting-devel
58 Summary:    Speech To Text setting header files for STT development
59 Group:      Graphics & UI Framework/Development
60 Requires:   %{name} = %{version}-%{release}
61
62 %package engine-devel
63 Summary:    Speech To Text engine header files for STT development
64 Group:      Graphics & UI Framework/Development
65 Requires:   %{name} = %{version}-%{release}
66
67 %package unittests
68 Summary:    STT tests
69 Group:      Development/Libraries
70 Requires:   %{name} = %{version}-%{release}
71
72 %description unittests
73 GTest for STT
74
75 %description devel
76 Speech To Text header files for STT development.
77
78 %description file-devel
79 File To Text header files for STT FILE development.
80
81 %description setting-devel
82 Speech To Text setting header files for STT development.
83
84 %description engine-devel
85 Speech To Text engine header files for STT development.
86
87 %if 0%{?gcov:1}
88 %package gcov
89 Summary:        Speech To Text (gcov)
90 Group:          Graphics & UI Framework/Voice Framework
91 %description gcov
92 Speech To Text gcov objects
93 %endif
94
95
96 %prep
97 %setup -q -n %{name}-%{version}
98 cp %{SOURCE1001} %{SOURCE1002} .
99
100
101 %build
102 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
103 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
104 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
105
106 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
107 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
108 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
109
110 %if 0%{?gcov:1}
111 export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
112 export CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
113 export FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage"
114 export LDFLAGS="$LDFLAGS -lgcov"
115 %endif
116
117
118 %if "%{tizen_profile_name}" == "tv"
119 export CFLAGS="$CFLAGS -DTV_PRODUCT"
120 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
121         -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -D_TV_PRODUCT=TRUE \
122         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP
123 %else
124 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
125         -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN \
126         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP
127 %endif
128
129 make %{?jobs:-j%jobs}
130
131
132 %install
133 rm -rf %{buildroot}
134
135 %if "%{tizen_profile_name}" == "tv"
136 mv -f org.tizen.voice.sttserver.tv.service org.tizen.voice.sttserver.service
137 %endif
138
139 %make_install
140
141 %if 0%{?gcov:1}
142 builddir=$(basename $PWD)
143 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
144 mkdir -p "$gcno_obj_dir"
145 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
146 %endif
147
148 cat << EOF > run-unittest.sh
149 #!/bin/sh
150 setup() {
151     echo "setup start"
152     touch /opt/share/askuser_disable
153     mount -o remount,rw /
154     tpk-backend --preload -y org.tizen.stt-unittests
155 }
156
157 test_main() {
158     echo "test_main start"
159     launch_app org.tizen.stt-unittests
160 }
161
162 teardown() {
163     echo "teardown start"
164 }
165
166 main() {
167     setup
168     test_main
169     teardown
170 }
171
172 main "\$*"
173 EOF
174
175 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
176 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}
177
178 %post
179 /sbin/ldconfig
180
181 mkdir -p %{_libdir}/voice/
182
183 mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
184
185 %postun -p /sbin/ldconfig
186
187
188 %files
189 %manifest %{name}.manifest
190 %license LICENSE.APLv2
191 %defattr(-,root,root,-)
192 %{_libdir}/lib*.so
193 /etc/dbus-1/session.d/stt-server.conf
194 %{TZ_SYS_RO_SHARE}/voice/stt/1.0/stt-config.xml
195 %{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.sttserver.service
196 %{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.sttservercustom.service
197 #%{TZ_SYS_RO_SHARE}/voice/test/stt-test
198 #%{TZ_SYS_BIN}/*
199 %{_bindir}/voice_getengine
200 %{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libstt-engine-parser.so*
201
202 %files devel
203 %manifest %{name}-devel.manifest
204 %defattr(-,root,root,-)
205 %{_libdir}/pkgconfig/stt.pc
206 %{_includedir}/stt.h
207 %{_includedir}/stt_internal.h
208
209 %files file-devel
210 %defattr(-,root,root,-)
211 %{_libdir}/pkgconfig/stt-file.pc
212 %{_includedir}/stt_file.h
213
214 %files setting-devel
215 %defattr(-,root,root,-)
216 %{_libdir}/pkgconfig/stt-setting.pc
217 %{_includedir}/stt_setting.h
218
219 %files engine-devel
220 %defattr(-,root,root,-)
221 %{_libdir}/pkgconfig/stt-engine.pc
222 %{_includedir}/stte.h
223 %{_includedir}/stte_internal.h
224
225 %if 0%{?gcov:1}
226 %files gcov
227 %{_datadir}/gcov/obj/*
228 %endif
229
230 %files unittests
231 %manifest tests/org.tizen.stt-unittests.manifest
232 %defattr(-,root,root,-)
233 %{TZ_SYS_RO_PACKAGES}/org.tizen.stt-unittests.xml
234 %{TZ_SYS_RO_APP}/org.tizen.stt-unittests/bin/stt-unittests
235 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh