Blob Blame Raw
Name: festival
Summary: A free speech synthesizer
Version: 1.95
Release: 5

# we ship the 1.4.2 docs for now.
%define docversion 1.4.2

# Files needed for everything...
%define baseURL  http://festvox.org/packed/festival/%{version}
Source: %{baseURL}/festival-%{version}-beta.tar.gz
Source1: %{baseURL}/speech_tools-1.2.95-beta.tar.gz

# Docs haven't been updated yet; here's the old ones
Source2: http://festvox.org/packed/festival/1.4.3/festdoc-1.4.2.tar.gz

### DICTIONARIES
# Generic English dictionary
Source100: %{baseURL}/festlex_POSLEX.tar.gz
# American English dictionary
Source101: %{baseURL}/festlex_CMU.tar.gz
# OALD isn't included because it's got a more restrictive (non-commercial
# only) license. OALD voices not included for same reason.

### DIPHONE VOICES
# American English male speaker (KAL), residual excited LPC diphone database
Source200: %{baseURL}/festvox_kallpc16k.tar.gz
# Same voice at lower quality
Source201: %{baseURL}/festvox_kallpc8k.tar.gz
# American English male speaker, residual excited LPC diphone database
Source202: %{baseURL}/festvox_kedlpc16k.tar.gz
# Same voice at lower quality
Source203: %{baseURL}/festvox_kedlpc8k.tar.gz
# Castilian Spanish male speaker, residual excited LPC diphone database
Source204: %{baseURL}/festvox_ellpc11k.tar.gz

### HTS VOICES (use Nagoya Institute of Technology's HTS based synthesizer)
# US English male ("bdl")
Source210: %{baseURL}/festvox_cmu_us_bdl_arctic_hts.tar.gz
# US English female ("slt")
Source211: %{baseURL}/festvox_cmu_us_slt_arctic_hts.tar.gz
# Canadian English male ("jmk") using US English
Source212: %{baseURL}/festvox_cmu_us_jmk_arctic_hts.tar.gz
# Scottish English male ("awb") using US English
Source213: %{baseURL}/festvox_cmu_us_awb_arctic_hts.tar.gz

### Multisyn voices left out because they're ~ 100MB each.

### MBROLA voices left out, because they require MBROLA, which ain't free.


# Fix up various locations to be more FSSTND compliant
Patch0: festival-1.95-fsstnd.patch

# Set defaults to American English instead of British English - the OALD
# dictionary (free for non-commercial use only) is needed for BE support
Patch1: festival-1.95-american.patch

# Whack some buildroot references
Patch2: festival-buildroot.patch

# Use shared libraries
Patch3: festival-1.95-shared-build.patch

# Somebody please teach the source code what C++ looks like this millenium
Patch4: speech_tools-1.2.95-gcc4.patch
Patch5: festival-1.95-gcc4.patch

# Get gnopernicus working again: bug 178312
Patch6: festival-1.95-fix-localhost-connections.patch

# mattdm: this is a hack to make the shared libraries build with actual
# sonames. I'm not sure I'm doing the right thing here, but this *does*
# make it work. Someone should double check me.
Patch30: festival-1.95-sonamehack.patch

URL: http://www.cstr.ed.ac.uk/projects/festival/
Group: Applications/Multimedia
License: X11-style
BuildRoot: %{_tmppath}/%{name}-%{version}-root
# Try turning this off.
# ExclusiveArch: i386 sparc
# readlink from kpathsea
Requires(post): /sbin/install-info
Requires(postun): /sbin/install-info
BuildRequires: tetex
BuildRequires: libtermcap-devel
Requires: info

%package devel
Requires: %{name} = %{version}
Summary: Development files for the festival speech synthesizer
Group: Development/Libraries

%description
Festival is a general multi-lingual speech synthesis system developed
at CSTR. It offers a full text to speech system with various APIs, as
well as an environment for development and research of speech synthesis
techniques. It is written in C++ with a Scheme-based command interpreter
for general control.

%description devel
Development files for the festival speech synthesizer. Install
festival-devel if you want to use the festival speech synthesizer from
within your own progrmas and/or if you intend to compile other programs
using it.

%prep
rm -rf $RPM_BUILD_ROOT

%setup -q -n festival -a 1

tar xzf %{SOURCE2}

ln -sf festival/speech_tools ../speech_tools

%patch0 -p1 -b .fsstnd
%patch1 -p1 -b .americandefault
%patch2 -p1
%patch3 -p1
%patch4 -p0
%patch5 -p1
%patch6 -p1 -b .fix-localhost-connections
%patch30 -p1 -b .soname

# zero length
rm festdoc-%{docversion}/speech_tools/doc/index_html.jade
rm festdoc-%{docversion}/speech_tools/doc/examples_gen/error_example_section.sgml
rm festdoc-%{docversion}/speech_tools/doc/tex_stuff.jade



%build

%ifarch ppc
CFLAGS="$RPM_OPT_FLAGS -O0"
export CFLAGS
%endif

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/speech_tools/lib:$PATH
export PATH=`pwd`/bin:$PATH
pushd speech_tools
%configure

make CXXFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -fPIC" CFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -O0 -fPIC"

#g++ -shared -L../../../speech_tools/lib -lestools -lestbase -leststring -ltermcap -Wl,-soname -Wl,libFestival.so.1 -Wl,--rpath -Wl,/usr/lib -o ../libFestival.so.1.4.1 *

popd

%configure
FTLIBDIR=%{_datadir}/festival make  CXXFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -fPIC" CFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -O0 -fPIC"

mkdir DATA.TMP
cd DATA.TMP
tar xzf %{SOURCE100}
tar xzf %{SOURCE101}
tar xzf %{SOURCE200}
tar xzf %{SOURCE201}
tar xzf %{SOURCE202}
tar xzf %{SOURCE203}
tar xzf %{SOURCE204}
tar xzf %{SOURCE210}
tar xzf %{SOURCE211}
tar xzf %{SOURCE212}
tar xzf %{SOURCE213}

cd festival/lib/dicts/cmu
make  CXXFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -fPIC" CFLAGS="-ffriend-injection -fpermissive -Wno-deprecated -Wno-non-template-friend -O0 -fPIC"

cd ../../..

%install
export PATH=`pwd`/src/main:$PATH
export LD_LIBRARY_PATH=`pwd`/speech_tools/lib:$PATH
mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libexecdir}/speech-tools
pushd speech_tools
rm -f bin/Makefile
cp -a bin/* $RPM_BUILD_ROOT%{_libexecdir}/speech-tools
cp -a lib/lib*.a lib/lib*.so* $RPM_BUILD_ROOT%{_libdir}
popd
mkdir -p $RPM_BUILD_ROOT%{_datadir}/festival
mv DATA.TMP/festival/lib/voices $RPM_BUILD_ROOT%{_datadir}/festival
mv DATA.TMP/festival/lib/dicts $RPM_BUILD_ROOT%{_datadir}/festival
rm -f lib/Makefile lib/*.fsstnd lib/*.americandefault bin/Makefile
mv lib/* $RPM_BUILD_ROOT%{_datadir}/festival
mv bin/* $RPM_BUILD_ROOT%{_bindir}
# We want the real festival, not the wrapper script
rm -f $RPM_BUILD_ROOT%{_bindir}/{Makefile,VCLocalRules}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
cp -a doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1

mkdir -p $RPM_BUILD_ROOT%{_includedir}/speech_tools
mkdir -p $RPM_BUILD_ROOT%{_includedir}/festival
cp -a src/include/* $RPM_BUILD_ROOT%{_includedir}/festival
cp -aR speech_tools/include/* $RPM_BUILD_ROOT%{_includedir}/speech_tools
cp -a src/lib/libFestival.a $RPM_BUILD_ROOT%{_libdir}

# symlinks into buildtree evil
for i in $RPM_BUILD_ROOT%{_libexecdir}/speech-tools/*; do
	if [ -h "$i" ]; then
    		a=`readlink "$i"`
		rm -f "$i"	
		cp -a "$a" $RPM_BUILD_ROOT%{_libexecdir}/speech-tools/
	fi
done
for i in $RPM_BUILD_ROOT%{_bindir}/*; do
	if [ -h "$i" ]; then
    		a=`readlink "$i"`
		rm -f "$i"	
		cp -a "$a" $RPM_BUILD_ROOT%{_bindir}/
	fi
done


# Remove some files we don't need
rm -rf $RPM_BUILD_ROOT%{_includedir}/speech_tools/win32
rm -rf $RPM_BUILD_ROOT%{_includedir}/speech_tools/Makefile
rm -rf $RPM_BUILD_ROOT%{_includedir}/festival/Makefile
rm -f  $RPM_BUILD_ROOT%{_datadir}/festival/etc/unknown_RedHatLinux/.made
rm -f $RPM_BUILD_ROOT%{_bindir}/{est_gdb,est_examples,est_program}
rm -f $RPM_BUILD_ROOT%{_libexecdir}/speech-tools/{build_docbook_index,cxx_to_docbook}

# This shouldn't be in the tarball
pushd festdoc-%{docversion}/speech_tools/doc
  rm -fr CVS arch_doc/CVS man/CVS  speechtools/arch_doc/CVS
  rm -f .*_made .speechtools_html .tex_done
popd

# Fix up the headers to look for other includes where we want them, not
# where they're supposed to be in the source tree
# There is probably a better way to do this, I'm not (yet) a sed expert.
# What this does is, basically, replacing "EST_*.h" with <speech_tools/EST_*.h>.
for i in `find $RPM_BUILD_ROOT%{_includedir}/festival/ -type f` `find $RPM_BUILD_ROOT%{_includedir}/speech_tools/ -type f`; do
  sed -e 's,"EST.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/\",speech_tools/,g' \
	-e 's,"siod.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/\",speech_tools/,g' \
	-e 's,"instantiate/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/instantiate/\",speech_tools/instantiate/,g' -e 's,"instantiate,instantiate,g' \
	-e 's,"ling_class/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/ling_class/\",speech_tools/ling_class/,g' -e 's,"ling_class,ling_class,g'\
	-e 's,"rxp/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/rxp/\",speech_tools/rxp/,g' -e 's,"rxp,rxp,g' \
  	-e 's,"sigpr/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/sigpr/\",speech_tools/sigpr/,g' -e 's,"sigpr,sigpr,g' \
	-e 's,"unix/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/unix/\",speech_tools/unix/,g' -e 's,\.h\">,.h\>,g' -e 's,"unix,unix,g' \
	-e 's,"festival\.h",\<festival/festival.h\>,g' \
  	-e 's,"ModuleDescription\.h",\<festival/ModuleDescription.h\>,g' \
  	-e 's,"Phone\.h",\<festival/Phone.h\>,g' $i >$i-redhat
  mv -f $i-redhat $i
done

mkdir $RPM_BUILD_ROOT%{_infodir}
cp -p festdoc-%{docversion}/festival/info/* $RPM_BUILD_ROOT%{_infodir}

rm ../speech_tools

# Remove the spanish voices until we get clarification on the license
rm -rf $RPM_BUILD_ROOT%{_datadir}/festival/voices/spanish/

#remove files not needed in the install
rm -f $RPM_BUILD_ROOT/%{_bindir}/VCLocalRules

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig
/sbin/install-info %{_infodir}/festival.info.gz %{_infodir}/dir --section "Accessibility" > /dev/null 2>&1

%postun
/sbin/ldconfig
if [ "$1" = 0 ]; then
	/sbin/install-info --delete %{_infodir}/festival.info.gz %{_infodir}/dir --section "Accessibility" > /dev/null 2>&1
fi

%files
%defattr(-,root,root)
%doc ACKNOWLEDGMENTS COPYING INSTALL NEWS README
%doc festdoc-%{docversion}/festival/html/*html
%{_infodir}/*
%{_bindir}/*
%dir %{_libexecdir}/speech-tools
%{_libexecdir}/speech-tools/*
%{_datadir}/festival
%{_libdir}/*.so.*
%{_mandir}/man1/*

%files devel
%defattr(-,root,root)
%doc festdoc-%{docversion}/speech_tools
%{_libdir}/*.a
%{_libdir}/*.so
%dir %{_includedir}/speech_tools
%dir %{_includedir}/festival
%{_includedir}/speech_tools/*
%{_includedir}/festival/*

%changelog
* Sun Jan 22 2006 Ray Strode <rstrode@redhat.com> - 1.95-5
- get gnopernicus working again. Patch from 
  Fernando Herrera <fherrera@gmail.com> (bug 178312)
- add a lot of compiler flags and random cruft to get
  festival to build with gcc 4.1

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Mon Oct 10 2005 Florian La Roche <laroche@redhat.com>
- another try to get it to compile again

* Tue Apr 28 2005  <johnp@redhat.com> - 1.95-3
- require info packages so the post does not fail
- remove /usr/bin/VCLocalRule from buildroot since it is
  an extranious file that does not need to be installed

* Wed Apr 27 2005 Miloslav Trmac <mitr@redhat.com> - 1.95-2
- Fix build with gcc 4 (#156132)
- Require /sbin/install-info for scriptlets (#155698)
- Don't ship %{_bindir}/VCLocalRules (#75645)

* Fri Feb 25 2005  <jrb@redhat.com> - 1.95-1
- patch from Matthew Miller to update to 1.95.  Full changelog below

* Mon Feb  7 2005 Matthew Miller <mattdm@mattdm.org> 1.95-0.mattdm8
- put speech-tools binaries in /usr/libexec/speech-tools so as to not
  clutter /usr/bin. Another approach would be to make speech-tools a 
  separate package and to make these utilities a subpackage of that.
- macro-ize /usr/bin, /usr/lib, /usr/include

* Sun Feb  6 2005 Matthew Miller <mattdm@mattdm.org> 1.95-0.mattdm6
- worked on this some more
- made actually work -- put back rest of fsstnd patch which I had broken
- made kludge for lack of sonames in shared libraries -- I think I did the
  right thing
- put back american as the default -- british dicts are non-free.

* Wed Jan  5 2005 Matthew Miller <mattdm@mattdm.org> 1.95-0.mattdm1
- preliminary update to 1.95 beta
- add really nice CMU_ARCTIC HTS voices, which is the whole point of wanting
  to do this. (They have a free license.)
- switch to festvox.org north american upstream urls
- keep old doc files -- there's no new ones yet.
- add comment to specfile about reason for lack of OALD (British) voices --
  they've got a more restrictive license.
- change license to "X11-style", because that's how they describe it.
- remove exclusivearch. I dunno if this builds on other archs, but I
  also don't know why it wouldn't.
- fancier buildroot string, 'cause hey, why not.
- more "datadir" macros
- remove most of Patch0 (fsstnd) -- can be done by setting variables instead.
  there's some bits in speechtools still, though
- update Patch3 (shared-build)
- don't apply patches 20 and 21 -- no longer needed.
- disable adding "FreeBSD" and "OpenBSD" to the dictionary for now. Probably
  a whole list of geek words should be added. Also, the patch was applied
  in an icky kludgy way.

* Thu Jul 29 2004 Miloslav Trmac <mitr@redhat.com> - 1.4.2-25
- Update for gcc 3.4

* Wed Jul 28 2004 Miloslav Trmac <mitr@redhat.com> - 1.4.2-24
- Use shared libraries to reduce package size
- Don't ship patch backup files

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue May  4 2004 Jonathan Blandford <jrb@redhat.com> 1.4.2-21
- Remove the spanish voices until we get clarification on the license

* Sat Apr 10 2004 Warren Togami <wtogami@redhat.com>
- BR libtermcap-devel #104722

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Mon Aug 25 2003 Bill Nottingham <notting@redhat.com> 1.4.2-19
- clean up buildroot references (#75643, #77908, #102985)
- remove some extraneous scripts
- fix build with gcc-3.3

* Thu Jun 12 2003 Elliot Lee <sopwith@redhat.com> 1.4.2-17
- Rebuild

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Thu Jan  9 2003 Tim Powers <timp@redhat.com> 1.4.2-15
- redirect install-info spewage

* Tue Jan  7 2003 Jens Petersen <petersen@redhat.com> 1.4.2-14
- put info files in infodir
- add post and postun script to install and uninstall info dir file entry
- drop postscript and info files from docs

* Wed Dec 11 2002 Tim Powers <timp@redhat.com> 1.4.2-13
- rebuild

* Thu Aug 15 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.4.2-12
- Adapt to current libstdc++

* Tue Jul 23 2002 Tim Powers <timp@redhat.com> 1.4.2-10
- build using gcc-3.2-0.1

* Wed Jul  3 2002 Trond Eivind Glomsrød <teg@redhat.com> 1.4.2-9
- Add some missing helpprograms (# 67698)

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Mon Jun 10 2002 Trond Eivind Glomsrød <teg@redhat.com> 1.4.2-7
- Fix some rpmlint errors

* Mon Jun 10 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.4.2-6
- Fix ISO C++ compliance

* Mon Mar 18 2002 Tim Powers <timp@redhat.com>
- rebuilt

* Thu Mar 14 2002 Trond Eivind Glomsrød <teg@redhat.com> 1.4.2-2
- Get rid of CVS directiories in doc dir
- Fix broken symlinks for components from speech_tools

* Wed Mar  6 2002 Trond Eivind Glomsrød <teg@redhat.com>
- 1.4.2
- Lots of fixes to make it build, more needed
- Cleanups
- Update URL
- Fix docs inclusion
- Drop prefix
- Use %%{_tmppath}

* Wed Aug  2 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Add defattr (Bug #15033)

* Tue Jul 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- fix build on current 7.0

* Mon Jul 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- fix build on current 7.0

* Thu Jul  6 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- FHSify

* Mon Jun 19 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix build on non-x86

* Sun Apr 22 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- initial packaging