Hello community, here is the log from the commit of package pocketsphinx for openSUSE:Factory checked in at 2020-03-25 23:49:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pocketsphinx (Old) and /work/SRC/openSUSE:Factory/.pocketsphinx.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pocketsphinx" Wed Mar 25 23:49:57 2020 rev:4 rq:788308 version:0.8 Changes: -------- --- /work/SRC/openSUSE:Factory/pocketsphinx/pocketsphinx.changes 2019-02-28 21:45:00.301484062 +0100 +++ /work/SRC/openSUSE:Factory/.pocketsphinx.new.3160/pocketsphinx.changes 2020-03-25 23:50:56.980010190 +0100 @@ -1,0 +2,6 @@ +Wed Mar 25 17:11:32 UTC 2020 - Antonio Larrosa <[email protected]> + +- Generate python3 bindings instead of python2: + * use-python3.patch + +------------------------------------------------------------------- New: ---- use-python3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pocketsphinx.spec ++++++ --- /var/tmp/diff_new_pack.NmH6NE/_old 2020-03-25 23:50:58.512009785 +0100 +++ /var/tmp/diff_new_pack.NmH6NE/_new 2020-03-25 23:50:58.516009783 +0100 @@ -1,7 +1,7 @@ # # spec file for package pocketsphinx # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,13 +16,14 @@ # +%define sover 1 Name: pocketsphinx Version: 0.8 Release: 0 Summary: Speech recognizer library written in C License: BSD-2-Clause Group: Productivity/Office/Other -Url: http://cmusphinx.sourceforge.net/wiki/download/ +URL: http://cmusphinx.sourceforge.net/wiki/download/ Source: http://downloads.sourceforge.net/project/cmusphinx/pocketsphinx/%{version}/%{name}-%{version}.tar.gz # PATCH-FIX-UPSTREAM pocketsphinx-doxygen.patch -- Obtained from fedora package (http://pkgs.fedoraproject.org/cgit/rpms/pocketsphinx.git/tree/) Patch0: pocketsphinx-doxygen.patch @@ -30,14 +31,15 @@ Patch1: pocketsphinx-largefile.patch # PATCH-FIX-UPSTREAM pocketsphinx-long-utterance.patch -- Obtained from fedora package (http://pkgs.fedoraproject.org/cgit/rpms/pocketsphinx.git/tree/) Patch2: pocketsphinx-long-utterance.patch +Patch3: use-python3.patch BuildRequires: alsa-devel BuildRequires: doxygen BuildRequires: fdupes BuildRequires: gstreamer-devel BuildRequires: pkgconfig -BuildRequires: python-Cython -BuildRequires: python-devel -BuildRequires: python-gtk-devel +BuildRequires: python3-Cython +BuildRequires: python3-devel +BuildRequires: python3-gobject BuildRequires: sphinxbase-devel Requires(post): update-alternatives Requires(postun): update-alternatives @@ -46,11 +48,11 @@ Pocketsphinx is a version of the open-source CMU Sphinx II speech recognition system which is able to recognize speech in real-time. -%package -n libpocketsphinx1 +%package -n libpocketsphinx%{sover} Summary: Speech recognizer library Group: System/Libraries -%description -n libpocketsphinx1 +%description -n libpocketsphinx%{sover} CMU Sphinx toolkit has a number of packages for different tasks and applications. Pocketsphinx is a version of the open-source CMU Sphinx II speech recognition system which is able to recognize speech in @@ -59,7 +61,7 @@ %package devel Summary: Development files for pocketsphinx, a speech recognizer library Group: Development/Libraries/C and C++ -Requires: libpocketsphinx1 = %{version} +Requires: libpocketsphinx%{sover} = %{version} %description devel CMU Sphinx toolkit has a number of packages for different tasks and @@ -69,12 +71,12 @@ This is the development package for pocketsphinx. -%package -n python2-pocketsphinx -Summary: Python bindings for pocketsphinx +%package -n python3-pocketsphinx +Summary: Python3 bindings for pocketsphinx Group: Development/Languages/Python Requires: %{name} = %{version} -%description -n python2-pocketsphinx +%description -n python3-pocketsphinx Pocketsphinx is a version of the open-source CMU Sphinx II speech recognition system which is able to recognize speech in real-time. @@ -85,11 +87,12 @@ %patch0 %patch1 %patch2 +%patch3 -p1 rm python/pocketsphinx.c %build -%configure --disable-static -make %{?_smp_mflags} +%configure --disable-static --with-python=%{_bindir}/python3 +%make_build %install %make_install @@ -104,7 +107,7 @@ done %check -make check +%make_build check %post update-alternatives --install %{_bindir}/pocketsphinx_batch pocketsphinx_batch %{_bindir}/pocketsphinx_batch-%{version} 10 \ @@ -116,8 +119,8 @@ update-alternatives --remove pocketsphinx_batch %{_bindir}/pocketsphinx_batch-%{version} fi -%post -n libpocketsphinx1 -p /sbin/ldconfig -%postun -n libpocketsphinx1 -p /sbin/ldconfig +%post -n libpocketsphinx%{sover} -p /sbin/ldconfig +%postun -n libpocketsphinx%{sover} -p /sbin/ldconfig %files %doc AUTHORS ChangeLog README @@ -134,16 +137,16 @@ %{_datadir}/%{name}/model/lm %{_mandir}/man1/*%{ext_man} -%files -n libpocketsphinx1 -%{_libdir}/*.so.* +%files -n libpocketsphinx%{sover} +%{_libdir}/libpocketsphinx.so.%{sover}* %files devel %{_includedir}/%{name}/ %{_libdir}/*.so %{_libdir}/pkgconfig/pocketsphinx.pc -%files -n python2-pocketsphinx -%{py_sitedir}/*.so -%{py_sitedir}/PocketSphinx-%{version}-py2.7.egg-info +%files -n python3-pocketsphinx +%{python3_sitearch}/pocketsphinx*.so +%{python3_sitearch}/PocketSphinx-%{version}-py%{python3_version}.egg-info %changelog ++++++ use-python3.patch ++++++ Index: pocketsphinx-0.8/python/Makefile.am =================================================================== --- pocketsphinx-0.8.orig/python/Makefile.am +++ pocketsphinx-0.8/python/Makefile.am @@ -40,5 +40,5 @@ endif if BUILD_CYTHON $(srcdir)/pocketsphinx.c: $(srcdir)/pocketsphinx.pyx $(srcdir)/pocketsphinx.pxd - cython -o $@ $< $(CPPFLAGS) -I$(sphinxbase)/python + cython -3 -o $@ $< $(CPPFLAGS) -I$(sphinxbase)/python endif Index: pocketsphinx-0.8/python/Makefile.in =================================================================== --- pocketsphinx-0.8.orig/python/Makefile.in +++ pocketsphinx-0.8/python/Makefile.in @@ -505,7 +505,7 @@ uninstall-am: uninstall-local uninstall- @BUILD_PYTHON_TRUE@ touch $@ @BUILD_CYTHON_TRUE@$(srcdir)/pocketsphinx.c: $(srcdir)/pocketsphinx.pyx $(srcdir)/pocketsphinx.pxd -@BUILD_CYTHON_TRUE@ cython -o $@ $< $(CPPFLAGS) -I$(sphinxbase)/python +@BUILD_CYTHON_TRUE@ cython -3 -o $@ $< $(CPPFLAGS) -I$(sphinxbase)/python # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Index: pocketsphinx-0.8/python/pocketsphinx.pyx =================================================================== --- pocketsphinx-0.8.orig/python/pocketsphinx.pyx +++ pocketsphinx-0.8/python/pocketsphinx.pyx @@ -265,7 +265,7 @@ cdef class Lattice: self.dag = ps_lattice_read(NULL, latfile) self.n_frames = ps_lattice_n_frames(self.dag) if self.dag == NULL: - raise RuntimeError, "Failed to read lattice from %s" % latfile + raise RuntimeError("Failed to read lattice from %s" % latfile) cdef set_dag(Lattice self, ps_lattice_t *dag): ps_lattice_retain(dag) @@ -366,7 +366,7 @@ cdef class Lattice: rv = ps_lattice_write(self.dag, outfile) if rv < 0: - raise RuntimeError, "Failed to write lattice to %s" % outfile + raise RuntimeError("Failed to write lattice to %s" % outfile) cdef class Segment: @@ -469,11 +469,11 @@ cdef class Decoder: i = i + 2 config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0) if config == NULL: - raise RuntimeError, "Failed to parse argument list" + raise RuntimeError("Failed to parse argument list") self.ps = ps_init(config) sb.cmd_ln_free_r(config) if self.ps == NULL: - raise RuntimeError, "Failed to initialize PocketSphinx" + raise RuntimeError("Failed to initialize PocketSphinx") cdef set_boxed(Decoder self, box): cdef ps_decoder_t *ps @@ -571,15 +571,15 @@ cdef class Decoder: PyString_AsStringAndSize(data, &strdata, &len) cdata = strdata - if ps_process_raw(self.ps, cdata, len / 2, no_search, full_utt) < 0: - raise RuntimeError, "Failed to process %d samples of audio data" % len / 2 + if ps_process_raw(self.ps, cdata, len // 2, no_search, full_utt) < 0: + raise RuntimeError("Failed to process %d samples of audio data" % len // 2) def end_utt(self): """ Finish processing an utterance. """ if ps_end_utt(self.ps) < 0: - raise RuntimeError, "Failed to stop utterance processing" + raise RuntimeError("Failed to stop utterance processing") def get_hyp(self): """ @@ -633,7 +633,7 @@ cdef class Decoder: dag = ps_get_lattice(self.ps) if dag == NULL: - raise RuntimeError, "Failed to create word lattice" + raise RuntimeError("Failed to create word lattice") lat = Lattice() lat.set_dag(dag) return lat @@ -726,7 +726,7 @@ cdef class Decoder: cdef SegmentIterator itor first_seg = ps_seg_iter(self.ps, &score) if first_seg == NULL: - raise RuntimeError, "Failed to create best path word segment iterator" + raise RuntimeError("Failed to create best path word segment iterator") itor = SegmentIterator() itor.set_iter(first_seg) return (itor, score) Index: pocketsphinx-0.8/python/setup.py.in =================================================================== --- pocketsphinx-0.8.orig/python/setup.py.in 2012-11-12 14:56:58.000000000 +0100 +++ pocketsphinx-0.8/python/setup.py.in 2020-01-15 12:46:21.842830046 +0100 @@ -5,7 +5,7 @@ import distutils.command.install import os -import commands +import subprocess import sys class bogus_uninstall(distutils.command.install.install): @@ -29,7 +29,7 @@ if os.path.isdir(f): dirs[f] = 1 continue - print "Trying to remove file", f + print("Trying to remove file", f) try: os.unlink(f) except: @@ -38,11 +38,11 @@ # This is really not guaranteed to work!!! for d in dirs: while d != self.prefix: - print "Trying to remove dir", d + print("Trying to remove dir", d) try: if d.endswith(".egg-info"): files=[os.path.join(d,f) for f in os.listdir(d)] - print "Trying to remove:", " ".join(files) + print("Trying to remove:", " ".join(files)) for f in files: os.unlink(f) os.rmdir(d) except: @@ -51,7 +51,7 @@ def pkgconfig(*packages, **kw): flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} - for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): + for token in subprocess.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) return kw
