Blob Blame History Raw
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           pocketsphinx
Version:        0.5.1
Release:        3%{?dist}
Summary:        Real-time speech recognition

Group:          Applications/Multimedia
License:        BSD and LGPLv2+
URL:            http://www.pocketsphinx.org/
Source0:        http://downloads.sourceforge.net/cmusphinx/%{name}-%{version}.tar.bz2
# Fix the building of doxygen documentation
Patch0:         pocketsphinx-0.5.1-doc.patch
# Install the Python egg in the Fedora way.
Patch1:         pocketsphinx-0.5.1-python.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  doxygen, gstreamer-devel, gstreamer-plugins-base-devel
BuildRequires:  pkgconfig, python-setuptools-devel, sphinxbase-devel
BuildRequires:  alsa-lib-devel

%description
PocketSphinx is a version of the open-source Sphinx-II speech recognition
system which is able to recognize speech in real-time.  While it may be
somewhat less accurate than the offline speech recognizers, it is lightweight
enough to run on handheld and embedded devices.

%package devel
Summary:        Header files for developing with pocketsphinx
Group:          Applications/Multimedia
Requires:       %{name}-libs = %{version}-%{release}, pkgconfig
Requires:       sphinxbase-devel

%description devel
Header files for developing with pocketsphinx.

%package libs
Summary:        Shared libraries for pocketsphinx executables
Group:          Applications/Multimedia

%description libs
Shared libraries for pocketsphinx executables.

%package plugin
Summary:        Pocketsphinx gstreamer plugin
Group:          Applications/Multimedia
Requires:       %{name}-libs = %{version}-%{release}, gstreamer-plugins-base

%description plugin
A gstreamer plugin for pocketsphinx.

%package python
Summary:        Python interface to pocketsphinx
Group:          Applications/Multimedia
Requires:       %{name}-libs = %{version}-%{release}, sphinxbase-python

%description python
Python interface to pocketsphinx.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%configure --disable-dependency-tracking --disable-static

# Get rid of undesirable hardcoded runpaths
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

# Get rid of undesirable direct library dependencies
sed -i -e 's/ -lsphinxad//g' src/libpocketsphinx/Makefile

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{python_sitearch}
make install DESTDIR=$RPM_BUILD_ROOT

# Install the man pages
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
cp -p doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1

# Get rid of files we don't want packaged
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-0.10/*.la
rm -f $RPM_BUILD_ROOT%{_datadir}/pocketsphinx/model/lm/turtle/turtle.handdict
rm -f doc/html/installdox

%clean
rm -rf $RPM_BUILD_ROOT

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/*
%{_datadir}/pocketsphinx
%{_mandir}/man1/*

%files devel
%defattr(-,root,root,-)
%doc doc/html
%{_includedir}/pocketsphinx
%{_libdir}/libpocketsphinx.so
%{_libdir}/pkgconfig/pocketsphinx.pc

%files libs
%defattr(-,root,root,-)
%{_libdir}/libpocketsphinx.so.*

%files plugin
%defattr(-,root,root,-)
%{_libdir}/gstreamer-0.10/*

%files python
%defattr(-,root,root,-)
%{python_sitearch}/*

%changelog
* Fri Aug 21 2009 Jerry James <loganjerry@gmail.com> - 0.5.1-3
- More review issues:
- Fix license (gstreamer plugin is LGPLv2+)
- Remove unnecessary zero-byte turtle dictionary file

* Fri Aug 21 2009 Jerry James <loganjerry@gmail.com> - 0.5.1-2
- Fix issues raised in review by Andrew Colin Kissa, namely:
- Improve description and summary
- Change the group to Applications/Multimedia

* Tue Mar 24 2009 Jerry James <loganjerry@gmail.com> - 0.5.1-1
- Update to 0.5.1

* Thu Jul 10 2008 Jerry James <loganjerry@gmail.com> - 0.5-1
- Update to 0.5

* Wed Mar  5 2008 Jerry James <loganjerry@gmail.com> - 0.4.1-1
- Initial RPM