From a80c73711a2121f05121d04513afa60840793c699cfb36393300b7b9fed1340f Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Thu, 3 May 2018 11:05:07 +0000 Subject: [PATCH] Accepting request 603624 from devel:languages:python:misc Move back the package to d:l:p to try to submit it to Factory again OBS-URL: https://build.opensuse.org/request/show/603624 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-SpeechRecognition?expand=0&rev=1 --- .gitattributes | 23 ++++++++ .gitignore | 1 + 3.8.1.tar.gz | 3 + fix-readme.patch | 66 ++++++++++++++++++++++ python-SpeechRecognition.changes | 53 +++++++++++++++++ python-SpeechRecognition.spec | 97 ++++++++++++++++++++++++++++++++ 6 files changed, 243 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 3.8.1.tar.gz create mode 100644 fix-readme.patch create mode 100644 python-SpeechRecognition.changes create mode 100644 python-SpeechRecognition.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/3.8.1.tar.gz b/3.8.1.tar.gz new file mode 100644 index 0000000..86313e9 --- /dev/null +++ b/3.8.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82d3313db383409ddaf3e42625fb0c3518231a1feb5e2ed5473b10b3d5ece7bd +size 125426650 diff --git a/fix-readme.patch b/fix-readme.patch new file mode 100644 index 0000000..ca15d0e --- /dev/null +++ b/fix-readme.patch @@ -0,0 +1,66 @@ +Index: speech_recognition-3.8.1/README.rst +=================================================================== +--- speech_recognition-3.8.1.orig/README.rst ++++ speech_recognition-3.8.1/README.rst +@@ -270,9 +270,7 @@ To hack on this library, first make sure + + - Most of the library code lives in ``speech_recognition/__init__.py``. + - Examples live under the ``examples/`` `directory `__, and the demo script lives in ``speech_recognition/__main__.py``. +-- The FLAC encoder binaries are in the ``speech_recognition/`` `directory `__. + - Documentation can be found in the ``reference/`` `directory `__. +-- Third-party libraries, utilities, and reference material are in the ``third-party/`` `directory `__. + + To install/reinstall the library locally, run ``python setup.py install`` in the project `root directory `__. + +@@ -301,41 +299,6 @@ Testing is also done automatically by Tr + python -m flake8 --ignore=E501,E701 speech_recognition tests examples setup.py # ignore errors for long lines and multi-statement lines + python -m rstcheck README.rst reference/*.rst # ensure RST is well-formed + +-FLAC Executables +-~~~~~~~~~~~~~~~~ +- +-The included ``flac-win32`` executable is the `official FLAC 1.3.2 32-bit Windows binary `__. +- +-The included ``flac-linux-x86`` and ``flac-linux-x86_64`` executables are built from the `FLAC 1.3.2 source code `__ with `Manylinux `__ to ensure that it's compatible with a wide variety of distributions. +- +-The built FLAC executables should be bit-for-bit reproducible. To rebuild them, run the following inside the project directory on a Debian-like system: +- +-.. code:: bash +- +- # download and extract the FLAC source code +- cd third-party +- sudo apt-get install --yes docker.io +- +- # build FLAC inside the Manylinux i686 Docker image +- tar xf flac-1.3.2.tar.xz +- sudo docker run --tty --interactive --rm --volume "$(pwd):/root" quay.io/pypa/manylinux1_i686:latest bash +- cd /root/flac-1.3.2 +- ./configure LDFLAGS=-static # compiler flags to make a static build +- make +- exit +- cp flac-1.3.2/src/flac/flac ../speech_recognition/flac-linux-x86 && sudo rm -rf flac-1.3.2/ +- +- # build FLAC inside the Manylinux x86_64 Docker image +- tar xf flac-1.3.2.tar.xz +- sudo docker run --tty --interactive --rm --volume "$(pwd):/root" quay.io/pypa/manylinux1_x86_64:latest bash +- cd /root/flac-1.3.2 +- ./configure LDFLAGS=-static # compiler flags to make a static build +- make +- exit +- cp flac-1.3.2/src/flac/flac ../speech_recognition/flac-linux-x86_64 && sudo rm -r flac-1.3.2/ +- +-The included ``flac-mac`` executable is extracted from `xACT 2.39 `__, which is a frontend for FLAC 1.3.2 that conveniently includes binaries for all of its encoders. Specifically, it is a copy of ``xACT 2.39/xACT.app/Contents/Resources/flac`` in ``xACT2.39.zip``. +- + Authors + ------- + +@@ -374,9 +337,3 @@ Copyright 2014-2017 `Anthony Zhang (Uber + SpeechRecognition is made available under the 3-clause BSD license. See ``LICENSE.txt`` in the project's `root directory `__ for more information. + + For convenience, all the official distributions of SpeechRecognition already include a copy of the necessary copyright notices and licenses. In your project, you can simply **say that licensing information for SpeechRecognition can be found within the SpeechRecognition README, and make sure SpeechRecognition is visible to users if they wish to see it**. +- +-SpeechRecognition distributes source code, binaries, and language files from `CMU Sphinx `__. These files are BSD-licensed and redistributable as long as copyright notices are correctly retained. See ``speech_recognition/pocketsphinx-data/*/LICENSE*.txt`` and ``third-party/LICENSE-Sphinx.txt`` for license details for individual parts. +- +-SpeechRecognition distributes source code and binaries from `PyAudio `__. These files are MIT-licensed and redistributable as long as copyright notices are correctly retained. See ``third-party/LICENSE-PyAudio.txt`` for license details. +- +-SpeechRecognition distributes binaries from `FLAC `__ - ``speech_recognition/flac-win32.exe``, ``speech_recognition/flac-linux-x86``, and ``speech_recognition/flac-mac``. These files are GPLv2-licensed and redistributable, as long as the terms of the GPL are satisfied. The FLAC binaries are an `aggregate `__ of `separate programs `__, so these GPL restrictions do not apply to the library or your programs that use the library, only to FLAC itself. See ``LICENSE-FLAC.txt`` for license details. diff --git a/python-SpeechRecognition.changes b/python-SpeechRecognition.changes new file mode 100644 index 0000000..6eb15d7 --- /dev/null +++ b/python-SpeechRecognition.changes @@ -0,0 +1,53 @@ +------------------------------------------------------------------- +Thu May 3 09:48:57 UTC 2018 - alarrosa@suse.com + +- Add fix-readme.patch to keep clear that the flac binaries and third-party + source files are removed and are not used by the python-SpeechRecognition + package. + +------------------------------------------------------------------- +Fri Jan 5 09:38:06 UTC 2018 - alarrosa@suse.com + +- Update to version 3.8.1 + * Snowboy hotwords support for highly efficient, performant listening. + This is implemented as the snowboy_configuration parameter of + recognizer_instance.listen. + * Configurable Pocketsphinx models - you can now specify your own acoustic + parameters, language model, and phoneme dictionary, using the language + parameter of recognizer_instance.recognize_sphinx. + * audio_data_instance.get_segment(start_ms=None, end_ms=None) is a new method + that can be called on any AudioData instance to get a segment of the audio + starting at start_ms and ending at end_ms. This is really useful when you + want to get, say, only the first five seconds of some audio. + * The stopper function returned by listen_in_background now accepts one + parameter, wait_for_stop (defaulting to True for backwards compatibility), + which determines whether the function will wait for the background thread + to fully shutdown before returning. One advantage is that if wait_for_stop + is False, you can call the stopper function from any thread! + * New example, demonstrating how to simultaneously listen to and recognize + speech with the threaded producer/consumer pattern: threaded_workers.py. + * Various improvements and bugfixes: + * Python 3 style type annotations in library documentation. + * recognize_google_cloud now uses the v1 rather than the beta API. + * recognize_google_cloud now returns timestamp info when the show_all + parameter is True. + * recognize_bing won't time out as often on credential requests, due to a + longer default timeout. + * recognize_google_cloud timeouts respect + recognizer_instance.operation_timeout now. + * Any recognizers using FLAC audio were broken inside Linux on Docker - + this is now fixed. + * Various documentation and lint fixes. + * Lots of small build system improvements. + +------------------------------------------------------------------- +Wed Nov 15 16:20:51 UTC 2017 - alarrosa@suse.com + +- Added python-SpeechRecognition-common-en-US package to install the + pocketsphinx-data directory in a common place for python2 and python3 + packages. + +------------------------------------------------------------------- +Mon Sep 4 17:54:27 UTC 2017 - alarrosa@suse.com + +- Initial release of python-SpeechRecognition 3.7.1 diff --git a/python-SpeechRecognition.spec b/python-SpeechRecognition.spec new file mode 100644 index 0000000..793f907 --- /dev/null +++ b/python-SpeechRecognition.spec @@ -0,0 +1,97 @@ +# +# spec file for package python-SpeechRecognition +# +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define justpython python +Name: python-SpeechRecognition +Version: 3.8.1 +Release: 0 +# Note: The sources include third party code with different licenses. +# We remove all those before building so it's not installed in the +# generated packages. +License: BSD-3-Clause +Summary: Library for performing speech recognition, with support for several engines +Url: https://github.com/Uberi/speech_recognition#readme +Group: Development/Languages/Python +Source: https://github.com/Uberi/speech_recognition/archive/%{version}.tar.gz +Patch0: fix-readme.patch +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +Requires: flac +Requires: python-PyAudio +Requires: python-oauth2client +Requires: %{justpython}-SpeechRecognition-common-en-US +Recommends: python-google-api-python-client +Recommends: python-pocketsphinx-python +BuildArch: noarch + +%python_subpackages + +%description +SpeechRecognition Library for performing speech recognition, with support for several engines and APIs, online and offline. + +The Speech recognition engine/API supports CMU Sphinx (works offline), Google Speech Recognition, +Google Cloud Speech API, Wit.ai, Microsoft Bing Voice Recognition, Houndify API and +IBM Speech to Text + +%package -n python-SpeechRecognition-common-en-US +Summary: Common files for en-US language model support in python-speech_recognition + +%description -n python-SpeechRecognition-common-en-US +SpeechRecognition Library for performing speech recognition, with support for +several engines and APIs, online and offline. + +The Speech recognition engine/API supports CMU Sphinx (works offline), Google +Speech Recognition, Google Cloud Speech API, Wit.ai, Microsoft Bing Voice +Recognition, Houndify API and IBM Speech to Text. + +This package contains the data for en-US language model to be used by +pocketsphinx from python-SpeechRecognition. + +%prep +%setup -q -n speech_recognition-%{version} +%patch0 -p1 +rm -Rf third-party +rm speech_recognition/flac-* +rm LICENSE-FLAC.txt + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +mkdir -p %{buildroot}%{_datadir}/speech_recognition +cp -Ra speech_recognition/pocketsphinx-data %{buildroot}%{_datadir}/speech_recognition/ +%python_expand rm -Rf %{buildroot}%{$python_sitelib}/speech_recognition/pocketsphinx-data +%python_expand ln -s %{_datadir}/speech_recognition/pocketsphinx-data %{buildroot}%{$python_sitelib}/speech_recognition/ + +%files %{python_files} +%defattr(-,root,root,-) +%license LICENSE.txt +%{python_sitelib}/* +%dir %{_datadir}/speech_recognition/ +%dir %{_datadir}/speech_recognition/pocketsphinx-data + +%files -n python-SpeechRecognition-common-en-US +%defattr(-,root,root,-) +%{_datadir}/speech_recognition/pocketsphinx-data/en-US + + +%changelog