[sphinxtrain] Initial import.

Jerry James jjames at fedoraproject.org
Tue Jan 22 15:59:28 UTC 2013


commit eda726b5556566c014689a4d91a0a9654a2d76c3
Author: Jerry James <jamesjer at betterlinux.com>
Date:   Tue Jan 22 08:59:15 2013 -0700

    Initial import.

 .gitignore                  |    1 +
 g2p_train.hpp               |   18 ++++++
 sources                     |    1 +
 sphinxtrain-extension.patch |   17 +++++
 sphinxtrain.spec            |  140 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 177 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..35ef199 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sphinxtrain-1.0.8.tar.gz
diff --git a/g2p_train.hpp b/g2p_train.hpp
new file mode 100644
index 0000000..00f60c0
--- /dev/null
+++ b/g2p_train.hpp
@@ -0,0 +1,18 @@
+#ifndef G2P_TRAIN_H_
+#define G2P_TRAIN_H_
+#include <string>
+
+using namespace std;
+
+void split(string input_file, string prefix, int ratio);
+
+void align(string input_file, string prefix, bool seq1_del, bool seq2_del, 
+		int seq1_max, int seq2_max, string seq_sep, string s1s2_sep,
+		string eps, string skip, string seq1in_sep, string seq2in_sep,
+		string s1s2_delim, int iter);
+		
+void train_model(string eps, string s1s2_sep, string skip, int order, 
+		string smooth, string prefix, string seq_sep, string prune, 
+		double theta, string count_pattern);
+
+#endif /* G2P_TRAIN_H_ */
diff --git a/sources b/sources
index e69de29..6f551e2 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+0f7155ba92fbdec169c92c1759303106  sphinxtrain-1.0.8.tar.gz
diff --git a/sphinxtrain-extension.patch b/sphinxtrain-extension.patch
new file mode 100644
index 0000000..e8e6b16
--- /dev/null
+++ b/sphinxtrain-extension.patch
@@ -0,0 +1,17 @@
+--- python/setup.py.orig	2012-09-28 15:26:01.000000000 -0600
++++ python/setup.py	2013-01-18 10:54:57.381964263 -0700
+@@ -1,6 +1,7 @@
+ #!/usr/bin/env python
+ 
+ from distutils.core import setup, Extension
++from Cython.Distutils import build_ext
+ 
+ setup(name='SphinxTrain',
+       version='1.0',
+@@ -10,4 +11,6 @@
+       url='http://www.cmusphinx.org/',
+       packages=['cmusphinx', 'cmusphinx.feat'],
+       requires=['numpy', 'scipy'],
++      cmdclass = {'build_ext': build_ext},
++      ext_modules=[Extension('cmusphinx.qmwx', ['cmusphinx/qmwx.pyx'])],
+       )
diff --git a/sphinxtrain.spec b/sphinxtrain.spec
new file mode 100644
index 0000000..99b4a45
--- /dev/null
+++ b/sphinxtrain.spec
@@ -0,0 +1,140 @@
+# NOTE: rpmlint complains about "only non-binary in /usr/lib", but some of the
+# files there, even though they are not ELF files, are in fact arch-specific.
+
+Name:           sphinxtrain
+Version:        1.0.8
+Release:        3%{?dist}
+Summary:        Acoustic model trainer for CMU's Sphinx tools
+
+Group:          Applications/Multimedia
+License:        BSD
+URL:            http://cmusphinx.sourceforge.net/
+Source0:        http://downloads.sourceforge.net/cmusphinx/%{name}-%{version}.tar.gz
+# This file was accidentally omitted from the upstream source tarball.
+Source1:        g2p_train.hpp
+# Sent upstream 17 Jan 2013.  Specify the python extension so it is built and
+# installed properly.
+Patch0:         %{name}-extension.patch
+
+BuildRequires:  Cython
+BuildRequires:  lapack-devel
+BuildRequires:  libsamplerate-devel
+BuildRequires:  libsndfile-devel
+BuildRequires:  opengrm-ngram-devel
+BuildRequires:  perl
+BuildRequires:  sphinxbase-devel
+BuildRequires:  sphinxbase-python
+BuildRequires:  python2-devel
+BuildRequires:  python-setuptools
+BuildRequires:  scipy
+
+Requires: perl(:MODULE_COMPAT_%{perl_version})
+
+# Don't provide the script's perl interfaces, and thus don't require them
+%global __provides_exclude perl
+%global __requires_exclude SphinxTrain::Config
+%global __requires_exclude %{__requires_exclude}|Queue::Job
+%global __requires_exclude %{__requires_exclude}|SimpleConfig
+%global __requires_exclude %{__requires_exclude}|Queue
+%global __requires_exclude %{__requires_exclude}|SphinxTrain::Util
+
+# Don't provide the python interface glue
+%global __provides_exclude_from ^%{_libdir}/python.*\\.so$
+
+%description
+SphinxTrain is Carnegie Mellon University's open source acoustic model
+trainer.  It contains the scripts and instructions necessary for building
+models for the CMU Sphinx Recognizer.
+
+%package -n python-%{name}
+Summary:        Python interface to SphinxTrain
+Group:          System Environment/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       sphinxbase-python%{?_isa}, scipy%{?_isa}
+
+%description -n python-%{name}
+Python interface to cmusphinx3.
+
+%prep
+%setup -q
+%patch0
+
+# Add an accidentally omitted header file
+cp -p %{SOURCE1} src/programs/g2p_train
+
+# Remove spurious executable bits
+find src -name \*.h -perm /0111 | xargs chmod a-x
+
+# Help the dependency generator
+for f in `grep -FRl /usr/bin/env python`; do
+  cp -p $f $f.new
+  sed -i 's|/usr/bin/env python|/usr/bin/python|' $f.new
+  touch -r $f $f.new
+  mv -f $f.new $f
+done
+
+%build
+# The configure script only turns PIC on for x86_64
+%ifnarch x86_64
+export CFLAGS="%{optflags} -fPIC -DPIC"
+%endif
+
+%configure --enable-g2p-decoder
+
+# Get rid of undesirable hardcoded rpaths; also workaround libtool reordering
+# -Wl,--as-needed after all the libraries.
+sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
+    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
+    -e 's|CC="g..|& -Wl,--as-needed|' \
+    -i libtool
+#"
+make %{?_smp_mflags}
+
+# Build the python interface
+cd python
+python2 setup.py build
+
+%install
+%make_install
+
+# Get rid of stuff we don't want to install
+rm -fr %{buildroot}%{_libdir}/%{name}/python %{buildroot}%{_includedir}
+
+# Install the Python interface
+mkdir -p %{buildroot}%{python_sitearch}
+cd python
+python2 setup.py install --skip-build --root %{buildroot}
+
+# Fix permissions
+for f in classlm2fst cluster_mixw dict_spd fstutils lat2dot lat2fsg \
+    lat_rescore lat_rescore_fst lattice lattice_conv lattice_error \
+    lattice_error_fst lattice_prune lda mllr mllt prune_mixw quantize_mixw \
+    s3senmgau sendump test_arpalm test_corpus test_evaluation test_hmm \
+    test_s3file test_s3dict test_s3model; do
+  chmod 0755 %{buildroot}%{python_sitearch}/cmusphinx/$f.py
+done
+find %{buildroot}%{_libdir}/%{name}/scripts/lib -name \*.pm -o -name \*.txt | \
+  xargs chmod 0644
+
+%files
+%doc COPYING NEWS README
+%{_bindir}/%{name}
+%{_libexecdir}/%{name}/
+%{_libdir}/%{name}/
+%exclude %{python_sitearch}/*
+
+%files -n python-%{name}
+%{python_sitearch}/SphinxTrain*.egg-info
+%{python_sitearch}/cmusphinx/
+
+%changelog
+* Thu Jan 17 2013 Jerry James <loganjerry at gmail.com> - 1.0.8-3
+- Don't Require the perl interface that we don't Provide
+- Fix the python interface to build and install properly
+
+* Thu Jan 17 2013 Jerry James <loganjerry at gmail.com> - 1.0.8-2
+- Fix the name of the python subpackage
+- Make sure the main package doesn't include the python interface
+
+* Tue Jan  1 2013 Jerry James <loganjerry at gmail.com> - 1.0.8-1
+- Initial RPM


More information about the scm-commits mailing list