packaging: enable socket-based activation for the native API.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 16 Jan 2014 15:27:48 +0000 (17:27 +0200)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 16 Dec 2014 19:28:38 +0000 (21:28 +0200)
Change-Id: Ia383e79257acf5d3c84d49c3c9a7cb23e47f42e7

packaging/speech-recognition.changes
packaging/speech-recognition.conf
packaging/speech-recognition.service
packaging/speech-recognition.socket [new file with mode: 0644]
packaging/speech-recognition.spec

index c6849b0..64f2897 100644 (file)
@@ -1,3 +1,8 @@
+* Wed Jan 15 17:35:21 EEST 2014 Krisztian Litkey <kli@iki.fi> - 0.0.5
+- Enable systemd socket-based activation for the native client API.
+- TIVI-2079: try autospawning pulseaudio if it is not running.
+- Load the wrt-media-client plugin (forgotten in 0.0.4).
+
 * Tue Jan 07 14:02:21 EEST 2014 Krisztian Litkey <kli@iki.fi> - 0.0.4
 - A few crash fixes.
 - Added native client library.
index 19d702a..35d0199 100644 (file)
@@ -1,3 +1,11 @@
+#########################
+# plugins we always need (at least currently)
+#
+load simple-disambiguator
+
+#########################
+# sphinx speech engine
+#
 # default mike input
 sphinx.pulsesrc = alsa_input.usb-Logitech_Logitech_USB_Microphone-00-Microphone.analog-mono
 # language models and dictionaries
@@ -8,5 +16,38 @@ sphinx.fsg  = /usr/share/speech-recognition/dictionaries/demo/demo.fsg
 sphinx.decoder      = general
 sphinx.general.lm   = /usr/share/pocketsphinx/model/lm/en_US/wsj0vp.5000.DMP
 sphinx.general.dict = /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic
-# search plugin command
+
+load sphinx-speech
+
+#########################
+# festival voice engine
+#
+festival.voices = auto
+
+load festival-loader
+load festival-voice
+
+#########################
+# MPRIS2 and bluetooth clients (for iPhone control)
+#
+
+#mpris2.player1 = Anssi_Kostiainen__Intel____s_iPhone_Music
+
+#load mpris2-client
+#load bluetooth-client
+
+#########################
+# dumb search plugin
+#
 search.command = /usr/bin/MiniBrowser "http://google.com/search?q=__url__"
+
+load search-client
+
+#########################
+# client API plugins
+#
+load native-client
+
+# wrt-media-client needs GMainLoop
+gmainloop = true
+load wrt-media-client
index 5d0a79d..5ea483b 100644 (file)
@@ -1,11 +1,10 @@
 [Unit]
-Description=Speech recognition service
-After=sound.target
+Description=Winthorpe Speech Recognition and Synthesis Services
 
 [Service]
-EnvironmentFile=/etc/sysconfig/speech-recognition
-ExecStart=/usr/sbin/srs-daemon -f $CONFIG $MIKE $PLUGINS $CLIENTS
 Type=simple
+ExecStart=/usr/sbin/srs-daemon -P /usr/lib/srs/plugins -c /etc/speech-recognition/speech-recognition.conf -S native.socket -f -vvv
+KillSignal=SIGTERM
 
 [Install]
-WantedBy=tizen-middleware.target
+WantedBy=multi-user.target
diff --git a/packaging/speech-recognition.socket b/packaging/speech-recognition.socket
new file mode 100644 (file)
index 0000000..8605fae
--- /dev/null
@@ -0,0 +1,6 @@
+[Socket]
+ListenStream=127.0.0.1:4100
+Accept=false
+
+[Install]
+WantedBy=sockets.target
index 6d52465..23dfdaf 100644 (file)
@@ -3,10 +3,11 @@
 %{!?_with_festival:%{!?_without_festival:%define _with_festival 1}}
 %{!?_with_wrt:%{!?_without_wrt:%define _with_wrt 1}}
 %{!?_with_dbus:%{!?_without_dbus:%define _without_dbus 1}}
+%{!?_with_systemd:%{!?_without_systemd:%define _with_systemd 1}}
 
 Summary: Speech recognition service for Tizen
 Name: speech-recognition
-Version: 0.0.4
+Version: 0.0.5
 Release: 0
 License: BSD-3-Clause
 Group: Base/Utilities
@@ -24,9 +25,9 @@ BuildRequires: pkgconfig(libpulse)
 # BuildRequires: pkgconfig(murphy-pulse) >= 0.0.42
 # BuildRequires: pkgconfig(murphy-glib) >= 0.0.42
 
-BuildRequires: murphy-devel >= 0.0.42
-BuildRequires: murphy-glib-devel >= 0.0.42
-BuildRequires: murphy-pulse-devel >= 0.0.42
+BuildRequires: murphy-devel >= 0.0.43
+BuildRequires: murphy-glib-devel >= 0.0.43
+BuildRequires: murphy-pulse-devel >= 0.0.43
 
 BuildRequires: pkgconfig(libudev)
 BuildRequires: pkgconfig(json)
@@ -36,22 +37,20 @@ BuildRequires: pkgconfig(sphinxbase)
 %endif
 %if %{?_with_festival:1}%{!?_with_festival:0}
 BuildRequires: festival-devel
+Requires: festival
 %endif
 %if %{?_with_dbus:1}%{!?_with_dbus:0}
 BuildRequires: pkgconfig(dbus-1)
 %endif
-
 Requires: pulseaudio
 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
 Requires: sphinxbase
 Requires: pocketsphinx
 %endif
-%if %{?_with_festival:1}%{!?_with_festival:0}
-BuildRequires: festival-devel
-Requires: festival
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+BuildRequires: pkgconfig(libsystemd-daemon)
 %endif
 
-
 %description
 SRS/Winthorpe speech recognition system service.
 
@@ -107,6 +106,12 @@ CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
 %endif
 
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-systemd"
+%else
+CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-systemd"
+%endif
+
 
 ./bootstrap && \
     %configure $CONFIG_OPTIONS && \
@@ -118,19 +123,21 @@ rm -fr $RPM_BUILD_ROOT
 %make_install
 
 # Install dictionaries, configuration and service files.
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig \
-    $RPM_BUILD_ROOT/lib/systemd/user \
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} \
     $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition \
+    $RPM_BUILD_ROOT/lib/systemd/user \
     $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
     $RPM_BUILD_ROOT%{_libdir}/srs/scripts \
     $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
 
 /usr/bin/install -m 644 packaging/speech-recognition.conf \
     $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition
-/usr/bin/install -m 644 packaging/speech-recognition.env \
-    $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/speech-recognition
 /usr/bin/install -m 644 packaging/speech-recognition.service \
     $RPM_BUILD_ROOT/lib/systemd/user
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+/usr/bin/install -m 644 packaging/speech-recognition.socket \
+    $RPM_BUILD_ROOT/lib/systemd/user
+%endif
 /usr/bin/install -m 644 \
     -t $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
     dictionaries/demo/demo.*
@@ -144,6 +151,14 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 ldconfig
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+systemctl --user enable speech-recognition.socket
+%endif
+
+%preun
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+systemctl --user disable speech-recognition.socket
+%endif
 
 %postun
 ldconfig
@@ -157,9 +172,11 @@ ldconfig
 %{_libdir}/srs
 %{_libdir}/libsrs*.so.*
 %{_sysconfdir}/speech-recognition/speech-recognition.conf
-%{_sysconfdir}/sysconfig/speech-recognition
 %{_datadir}/speech-recognition/dictionaries
 /lib/systemd/user/speech-recognition.service
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+/lib/systemd/user/speech-recognition.socket
+%endif
 %{_datadir}/dbus-1/services/org.tizen.srs.service
 
 %files devel