[simon] fix runtime dependencies for model compilation

Kevin Kofler kkofler at fedoraproject.org
Sun Mar 24 22:06:17 UTC 2013


commit 1c96079641767f7d811eaa5066387323a0a3352d
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date:   Sun Mar 24 23:06:06 2013 +0100

    fix runtime dependencies for model compilation
    
    * Sun Mar 24 2013 Kevin Kofler <Kevin at tigcc.ticalc.org> 0.4.0-6
    - Requires: sphinxbase pocketsphinx (only -libs autorequired)
    - Requires: sphinxtrain (F18+)
    - don't pass absolute path to KConfig so global simonmodelcompilationrc is found
    - ship a default simonmodelcompilationrc with the correct executable paths

 simon-0.4.0-speechmodelcompilation-kconfig.patch |   12 +++++++++++
 simon.spec                                       |   23 +++++++++++++++++++++-
 simonmodelcompilationrc                          |    7 ++++++
 3 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/simon-0.4.0-speechmodelcompilation-kconfig.patch b/simon-0.4.0-speechmodelcompilation-kconfig.patch
new file mode 100644
index 0000000..974331c
--- /dev/null
+++ b/simon-0.4.0-speechmodelcompilation-kconfig.patch
@@ -0,0 +1,12 @@
+diff -ur simon-0.4.0/simonlib/speechmodelcompilation/modelcompilersphinx.cpp simon-0.4.0-speechmodelcompilation-kconfig/simonlib/speechmodelcompilation/modelcompilersphinx.cpp
+--- simon-0.4.0/simonlib/speechmodelcompilation/modelcompilersphinx.cpp	2012-12-29 20:06:37.000000000 +0100
++++ simon-0.4.0-speechmodelcompilation-kconfig/simonlib/speechmodelcompilation/modelcompilersphinx.cpp	2013-03-24 22:20:17.000000000 +0100
+@@ -31,7 +31,7 @@
+ 
+ bool ModelCompilerSPHINX::parseConfiguration()
+ {
+-  KConfig config( KStandardDirs::locateLocal("config", "simonmodelcompilationrc"), KConfig::FullConfig );
++  KConfig config( "simonmodelcompilationrc", KConfig::FullConfig );
+   KConfigGroup programGroup(&config, "Programs");
+ 
+ //  if(compilationType & ModelCompiler::CompileSpeechModel)//TODO: think and then put conditions back
diff --git a/simon.spec b/simon.spec
index 8b97780..4afdb36 100644
--- a/simon.spec
+++ b/simon.spec
@@ -1,19 +1,23 @@
 Name:    simon
 Summary: Speech recognition
 Version: 0.4.0
-Release: 5%{?dist}
+Release: 6%{?dist}
 
 License: GPLv2+
 URL:     http://www.simon-listens.org/
 #Source0: http://download.kde.org/stable/simon/%{version}/src/simon-%{version}.tar.bz2
 # the above, minus nonfree (all rights reserved) simond/default.jconf
 Source0: simon-%{version}-cleaned.tar.bz2
+# default simonmodelcompilationrc with the correct sphinxtrain executable paths
+Source1: simonmodelcompilationrc
 
 ## upstreamable patches
 # support LIB_SUFFIX, don't hard-code <prefix>/lib libdir
 Patch50: simon-0.4.0-LIB_SUFFIX.patch
 # fix/avoid unversioned shared library libeventsimulation
 Patch51: simon-0.4.0-libeventsimulation_soname.patch
+# don't pass absolute path to KConfig so global simonmodelcompilationrc is found
+Patch52: simon-0.4.0-speechmodelcompilation-kconfig.patch
 
 BuildRequires: bison
 BuildRequires: desktop-file-utils
@@ -29,6 +33,13 @@ BuildRequires: pkgconfig(qwt) >= 6
 BuildRequires: pkgconfig(samplerate)
 BuildRequires: qaccessibilityclient-devel
 
+# Simon needs binaries from these packages, only -libs autorequired
+Requires: sphinxbase pocketsphinx
+%if 0%{?fedora} > 17
+# Unfortunately, sphinxtrain is not available on Fedora 17
+Requires: sphinxtrain
+%endif
+
 Requires: %{name}-libs%{?_isa} = %{version}-%{release}
 
 %description
@@ -64,6 +75,7 @@ BuildArch: noarch
 
 %patch50 -p1 -b .LIB_SUFFIX
 %patch51 -p1 -b .libeventsimulation_soname
+%patch52 -p1 -b .speechmodelcompilation-kconfig
 
 # drop broken FindOpenCV.cmake
 rm -fv cmake/FindOpenCV.cmake
@@ -89,6 +101,9 @@ rm -fv %{buildroot}%{_kde4_appsdir}/simon.log
 # omit some nonfree (all rights reserved) files
 rm -fv %{buildroot}%{_kde4_appsdir}/simond/default.jconf
 
+install -p -D -m 644 %{SOURCE1} \
+  %{buildroot}%{_kde4_configdir}/simonmodelcompilationrc
+
 
 %check
 for f in %{buildroot}%{_kde4_datadir}/applications/kde4/*.desktop ; do
@@ -152,6 +167,12 @@ fi
 
 
 %changelog
+* Sun Mar 24 2013 Kevin Kofler <Kevin at tigcc.ticalc.org> 0.4.0-6
+- Requires: sphinxbase pocketsphinx (only -libs autorequired)
+- Requires: sphinxtrain (F18+)
+- don't pass absolute path to KConfig so global simonmodelcompilationrc is found
+- ship a default simonmodelcompilationrc with the correct executable paths
+
 * Sun Mar 17 2013 Rex Dieter <rdieter at fedoraproject.org> 0.4.0-5
 - repacked tarball minus nonfree default.jconf
 - fix unversioned libeventsimulation
diff --git a/simonmodelcompilationrc b/simonmodelcompilationrc
new file mode 100644
index 0000000..299a84a
--- /dev/null
+++ b/simonmodelcompilationrc
@@ -0,0 +1,7 @@
+[Programs]
+sphinxtrain=/usr/bin/sphinxtrain
+bw=/usr/libexec/sphinxtrain/bw
+sphinx_fe=/usr/bin/sphinx_fe
+pocketsphinx_mdef_convert=/usr/bin/pocketsphinx_mdef_convert
+map_adapt=/usr/libexec/sphinxtrain/map_adapt
+mllr_solve=/usr/libexec/sphinxtrain/mllr_solve


More information about the scm-commits mailing list