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}}
6 %{!?_with_systemd:%{!?_without_systemd:%define _with_systemd 1}}
8 Summary: Speech recognition service for Tizen
9 Name: speech-recognition
14 URL: https://github.com/otcshare/speech-recognition
15 Source0: %{name}-%{version}.tar.gz
17 BuildRequires: pkgconfig(libpulse)
19 # Termporarily had to replace these with explicit package-dependencies,
20 # because the murphy pkgconfig files lack the correct version (needs to
21 # be fixed) and now we need a new enough murphy with native-types support.
22 # Switch these back once this is fixed on the murphy side.
24 # BuildRequires: pkgconfig(murphy-common) >= 0.0.42
25 # BuildRequires: pkgconfig(murphy-pulse) >= 0.0.42
26 # BuildRequires: pkgconfig(murphy-glib) >= 0.0.42
28 BuildRequires: murphy-devel >= 0.0.43
29 BuildRequires: murphy-glib-devel >= 0.0.43
30 BuildRequires: murphy-pulse-devel >= 0.0.43
32 BuildRequires: pkgconfig(libudev)
33 BuildRequires: pkgconfig(json)
34 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
35 BuildRequires: pkgconfig(pocketsphinx)
36 BuildRequires: pkgconfig(sphinxbase)
38 %if %{?_with_festival:1}%{!?_with_festival:0}
39 BuildRequires: festival-devel
42 %if %{?_with_dbus:1}%{!?_with_dbus:0}
43 BuildRequires: pkgconfig(dbus-1)
46 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
48 Requires: pocketsphinx
50 %if %{?_with_systemd:1}%{!?_with_systemd:0}
51 BuildRequires: pkgconfig(libsystemd-daemon)
55 SRS/Winthorpe speech recognition system service.
58 Summary: The header files and libraries needed for SRS/Winthorpe clients
59 Group: Development/Libraries
60 Requires: %{name} = %{version}
63 This package contains header files and libraries necessary for development.
66 Summary: Various test binaries for SRS/Winthorpe
67 Group: Development/Debug
68 Requires: %{name} = %{version}
71 This package contains various test binaries for SRS/Winthorpe.
74 %setup -q -n %{name}-%{version}
77 %if %{?_with_debug:1}%{!?_with_debug:0}
78 export CFLAGS="-O0 -g3"
79 export CXXFLAGS="-O0 -g3"
85 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
86 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-sphinx"
88 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-sphinx"
91 %if %{?_with_festival:1}%{!?_with_festival:0}
92 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-festival"
94 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-festival"
97 %if %{?_with_wrt:1}%{!?_with_wrt:0}
98 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-wrt-client"
100 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-wrt-client"
103 %if %{?_with_dbus:1}%{!?_with_dbus:0}
104 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
106 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
109 %if %{?_with_systemd:1}%{!?_with_systemd:0}
110 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-systemd"
112 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-systemd"
117 %configure $CONFIG_OPTIONS && \
121 rm -fr $RPM_BUILD_ROOT
125 # Install dictionaries, configuration and service files.
126 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} \
127 $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition \
128 $RPM_BUILD_ROOT/lib/systemd/user \
129 $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
130 $RPM_BUILD_ROOT%{_libdir}/srs/scripts \
131 $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
133 /usr/bin/install -m 644 packaging/speech-recognition.conf \
134 $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition
135 /usr/bin/install -m 644 packaging/speech-recognition.service \
136 $RPM_BUILD_ROOT/lib/systemd/user
137 %if %{?_with_systemd:1}%{!?_with_systemd:0}
138 /usr/bin/install -m 644 packaging/speech-recognition.socket \
139 $RPM_BUILD_ROOT/lib/systemd/user
141 /usr/bin/install -m 644 \
142 -t $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
143 dictionaries/demo/demo.*
144 /usr/bin/install -m 755 packaging/start-speech-service.sh \
145 $RPM_BUILD_ROOT%{_libdir}/srs/scripts
146 /usr/bin/install -m 755 packaging/org.tizen.srs.service \
147 $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
150 rm -rf $RPM_BUILD_ROOT
154 %if %{?_with_systemd:1}%{!?_with_systemd:0}
155 systemctl --user enable speech-recognition.socket
159 %if %{?_with_systemd:1}%{!?_with_systemd:0}
160 systemctl --user disable speech-recognition.socket
167 %defattr(-,root,root,-)
168 %{_sbindir}/srs-daemon
169 %if %{?_with_dbus:1}%{!?_with_dbus:0}
170 %{_bindir}/srs-client
173 %{_libdir}/libsrs*.so.*
174 %{_sysconfdir}/speech-recognition/speech-recognition.conf
175 %{_datadir}/speech-recognition/dictionaries
176 /lib/systemd/user/speech-recognition.service
177 %if %{?_with_systemd:1}%{!?_with_systemd:0}
178 /lib/systemd/user/speech-recognition.socket
180 %{_datadir}/dbus-1/services/org.tizen.srs.service
183 %defattr(-,root,root,-)
185 %{_libdir}/libsrs*.so
186 %{_libdir}/pkgconfig/srs*.pc
189 %defattr(-,root,root,-)
190 %{_bindir}/srs-native-client