1 %{!?_with_debug:%{!?_without_debug:%define _with_debug 1}}
2 %{!?_with_sphinx:%{!?_without_sphinx:%define _with_sphinx 1}}
3 %{!?_with_festival:%{!?_without_festival:%define _with_festival 1}}
4 %{!?_with_wrt:%{!?_without_wrt:%define _with_wrt 1}}
5 %{!?_with_dbus:%{!?_without_dbus:%define _without_dbus 1}}
7 Summary: Speech recognition service for Tizen
8 Name: speech-recognition
13 URL: https://github.com/otcshare/speech-recognition
14 Source0: %{name}-%{version}.tar.gz
16 BuildRequires: pkgconfig(libpulse)
18 BuildRequires: pkgconfig(murphy-common)
19 BuildRequires: pkgconfig(murphy-pulse)
20 BuildRequires: pkgconfig(murphy-glib)
22 BuildRequires: pkgconfig(libudev)
23 BuildRequires: pkgconfig(json)
24 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
25 BuildRequires: pkgconfig(pocketsphinx)
26 BuildRequires: pkgconfig(sphinxbase)
28 %if %{?_with_festival:1}%{!?_with_festival:0}
29 BuildRequires: festival-devel
32 %if %{?_with_dbus:1}%{!?_with_dbus:0}
33 BuildRequires: pkgconfig(dbus-1)
36 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
38 Requires: pocketsphinx
40 BuildRequires: pkgconfig(libsystemd-daemon)
43 SRS/Winthorpe speech recognition system service.
46 Summary: The header files and libraries needed for SRS/Winthorpe clients
47 Group: Development/Libraries
48 Requires: %{name} = %{version}
51 This package contains header files and libraries necessary for development.
54 Summary: Various test binaries for SRS/Winthorpe
55 Group: Development/Debug
56 Requires: %{name} = %{version}
59 This package contains various test binaries for SRS/Winthorpe.
62 %setup -q -n %{name}-%{version}
65 %if %{?_with_debug:1}%{!?_with_debug:0}
66 export CFLAGS="-O0 -g3"
67 export CXXFLAGS="-O0 -g3"
73 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
74 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-sphinx"
76 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-sphinx"
79 %if %{?_with_festival:1}%{!?_with_festival:0}
80 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-festival"
82 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-festival"
85 %if %{?_with_wrt:1}%{!?_with_wrt:0}
86 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-wrt-client"
88 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-wrt-client"
91 %if %{?_with_dbus:1}%{!?_with_dbus:0}
92 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
94 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
97 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-w3c-speech"
98 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-systemd"
101 %configure $CONFIG_OPTIONS && \
105 rm -fr $RPM_BUILD_ROOT
109 # Install dictionaries, configuration and service files.
110 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} \
111 $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition \
112 $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition/w3c-grammars \
113 $RPM_BUILD_ROOT%{_unitdir_user} \
114 $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
115 $RPM_BUILD_ROOT%{_libdir}/srs/scripts \
116 $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
118 /usr/bin/install -m 644 packaging/speech-recognition.conf \
119 $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition
121 cat packaging/speech-recognition.conf.in | \
122 sed "s#@DATADIR@#%{_datadir}#g" \
123 > packaging/speech-recognition.conf
124 cat packaging/speech-recognition.service.in | \
125 sed "s#@LIBDIR@#%{_libdir}#g" \
126 > packaging/speech-recognition.service
128 /usr/bin/install -m 644 packaging/speech-recognition.service \
129 $RPM_BUILD_ROOT%{_unitdir_user}
131 /usr/bin/install -m 644 packaging/speech-recognition.socket \
132 $RPM_BUILD_ROOT%{_unitdir_user}
133 /usr/bin/install -m 644 \
134 -t $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
135 dictionaries/demo/demo.*
136 /usr/bin/install -m 755 packaging/start-speech-service.sh \
137 $RPM_BUILD_ROOT%{_libdir}/srs/scripts
139 /usr/bin/install -m 755 packaging/org.tizen.srs.service \
140 $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
142 mkdir -p $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/w3c-speech
144 %install_service ../user/weston.target.wants speech-recognition.socket
147 rm -rf $RPM_BUILD_ROOT
151 %systemd_post speech-recognition.service
154 %systemd_preun speech-recognition.service
158 %systemd_postun speech-recognition.service
161 %defattr(-,root,root,-)
162 %{_sbindir}/srs-daemon
164 %{_libdir}/libsrs*.so.*
165 %{_sysconfdir}/speech-recognition/speech-recognition.conf
166 %dir %{_sysconfdir}/speech-recognition/w3c-grammars
167 %{_datadir}/speech-recognition/dictionaries
168 %dir %{_datadir}/speech-recognition/w3c-speech
169 %{_unitdir_user}/speech-recognition.service
170 %{_unitdir_user}/speech-recognition.socket
171 %{_unitdir_user}/weston.target.wants/speech-recognition.socket
173 %{_datadir}/dbus-1/services/org.tizen.srs.service
176 %defattr(-,root,root,-)
178 %{_libdir}/libsrs*.so
179 %{_libdir}/pkgconfig/srs*.pc
182 %defattr(-,root,root,-)
183 %{_bindir}/srs-native-client
184 %{_bindir}/srs-w3c-client
185 %if %{?_with_dbus:1}%{!?_with_dbus:0}
186 %{_bindir}/srs-client