Name: sphinxbase
Version: 0.8
Release: 2%{?dist}
Summary: Common library for CMU Sphinx voice recognition products
Group: Development/Libraries
License: BSD
URL: http://cmusphinx.sourceforge.net/
Source0: http://downloads.sourceforge.net/cmusphinx/%{name}-%{version}.tar.gz
BuildRequires: bison
BuildRequires: Cython
BuildRequires: doxygen
BuildRequires: ghostscript
BuildRequires: lapack-devel
BuildRequires: libsamplerate-devel
BuildRequires: libsndfile-devel
BuildRequires: perl
BuildRequires: perl(Pod::Usage)
BuildRequires: pulseaudio-libs-devel
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: tex(latex)
%global __provides_exclude_from ^%{_libdir}/python.*\\.so$
%description
Sphinxbase is a common library for CMU Sphinx voice recognition products.
This package does not provide voice recognition by itself.
%package devel
Summary: Header and other development files for sphinxbase
Group: Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: pulseaudio-libs-devel%{?_isa}
%description devel
Header files and other development files for sphinxbase.
%package libs
Summary: Libraries for sphinxbase
Group: Development/Libraries
%description libs
The libraries for sphinxbase.
%package python
Summary: Python 2 interface to sphinxbase
Group: Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description python
Python 2 interface to sphinxbase.
%prep
%setup -q
# Fix encoding
iconv -f ISO8859-1 -t UTF-8 -o AUTHORS.new AUTHORS
touch -r AUTHORS.new AUTHORS
mv -f AUTHORS.new AUTHORS
# Force code generation with newer versions of Cython and bison
rm -f python/sphinxbase.c src/libsphinxbase/lm/jsgf_parser.{c,h}
# Install the python egg in the Fedora way
sed 's|\( install \)--prefix\( \$(DESTDIR)\)\$(prefix)|\1--skip-build --root\2|' \
-i python/Makefile.in
# Improve auto requires detection
for f in src/sphinx_lmtools/sphinx_lm_sort src/sphinx_jsgf2fsg/fsg2dot.pl \
python/hufftest2.py python/sb_test.py; do
sed -r 's|/usr/bin/env (.*)|/usr/bin/\1|' $f > $f.new
touch -r $f $f.new
mv -f $f.new $f
done
%build
%configure --disable-static --disable-rpath
# Get rid of undesirable hardcoded rpaths; 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="gcc|CC="gcc -Wl,--as-needed|' \
-i libtool
# Build the programs and libraries
make %{?_smp_mflags}
# Build the man pages
cd doc
export LD_LIBRARY_PATH=../src/libsphinxbase/.libs:../src/libsphinxad/.libs
for prog in sphinx_cepview sphinx_fe; do
perl args2man.pl ../src/${prog}/${prog} < ${prog}.1.in > ${prog}.1
done
perl args2man.pl ../src/sphinx_adtools/sphinx_pitch < sphinx_pitch.1.in > sphinx_pitch.1
%install
# Install the binaries and libraries
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
# Remove libtool archives
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
# Fix a permission problem
chmod 0755 $RPM_BUILD_ROOT%{python2_sitearch}/%{name}.so
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%{_bindir}/*
%{_mandir}/man1/*
%files devel
%doc doc/html
%{_includedir}/sphinxbase/
%{_libdir}/libsphinxad.so
%{_libdir}/libsphinxbase.so
%{_libdir}/pkgconfig/sphinxbase.pc
%files libs
%doc AUTHORS ChangeLog COPYING NEWS README
%{_libdir}/libsphinxad.so.*
%{_libdir}/libsphinxbase.so.*
%files python
%{python2_sitearch}/*
%changelog
* Mon Feb 18 2013 Jerry James <loganjerry@gmail.com> - 0.8-2
- Add perl(Pod::Usage) BR
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Mon Dec 17 2012 Jerry James <loganjerry@gmail.com> - 0.8-1
- New upstream release
- Drop patches; no longer necessary
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Jan 10 2012 Jerry James <loganjerry@gmail.com> - 0.7-4
- Rebuild for bz 772699
* Fri Jan 6 2012 Jerry James <loganjerry@gmail.com> - 0.7-3
- Rebuild for GCC 4.7
- Fix a typo in the filter
* Fri Jul 15 2011 Jerry James <loganjerry@gmail.com> - 0.7-2
- Use RPM 4.9's new filter scheme to remove bogus provides
- Minor spec file cleanups
* Tue Apr 19 2011 Jerry James <loganjerry@gmail.com> - 0.7-1
- New upstream release
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Aug 16 2010 Jerry James <loganjerry@gmail.com> - 0.6.1-1
- New upstream release
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Fri Nov 20 2009 Jerry James <loganjerry@gmail.com> - 0.4.1-2
- Update python BRs for Rawhide
* Mon Jun 1 2009 Jerry James <loganjerry@gmail.com> - 0.4.1-1
- Initial RPM