Blob Blame History Raw
Name: festival
Summary: A free speech synthesizer
Version: 1.4.2
Release: 19

# Files needed for everything...
Source: ftp://ftp.cstr.ed.ac.uk/pub/festival/%{version}/%{name}-%{version}-release.tar.gz
Source1: ftp://ftp.cstr.ed.ac.uk/pub/festival/%{version}/speech_tools-1.2.2-release.tar.gz
Source2: ftp://ftp.cstr.ed.ac.uk/pub/festival/%{version}/festdoc-1.4.2.tar.gz
Source3: speech_tools-config
Source5: festival-config

### DICTIONARIES
# Generic English dictionary
Source100: ftp://ftp.cstr.ed.ac.uk/pub/festival/%{version}/festlex_POSLEX.tar.gz
# American English dictionary
Source101: ftp://ftp.cstr.ed.ac.uk/pub/festival/%{version}/festlex_CMU.tar.gz

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

# Fix up various locations to be more FSSTND compliant
Patch: festival-1.4.1-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-american.patch

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

# Add some useful words to the dictionary...
Patch10: CMU-redhat.patch

# Translate this strange pseudocode to real C++
Patch20: speech_tools-1.2.2-c++.patch
Patch21: festival-1.4.2-c++.patch

URL: http://www.cstr.ed.ac.uk/projects/festival/
Group: Applications/Multimedia
License: BSD
BuildRoot: %{_tmppath}/%{name}-%{version}-root
ExclusiveArch: i386
# readlink from kpathsea
BuildRequires: tetex

%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

%patch -p1 -b .fsstnd
#patch1 -p1 -b .americandefault
%patch2 -p1
%patch20 -p0 -b .st_c++
%patch21 -p1 -b .fv_c++

# zero length

rm festdoc-1.4.2/speech_tools/doc/index_html.jade
rm festdoc-1.4.2/speech_tools/doc/examples_gen/error_example_section.sgml
rm festdoc-1.4.2/speech_tools/doc/tex_stuff.jade



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


make

#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 
make

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}
patch -p0 <%{PATCH10}
cd festival/lib/dicts/cmu
make
cd ../../..

%install
export PATH=`pwd`/src/main:$PATH
export LD_LIBRARY_PATH=`pwd`/speech_tools/lib:$PATH
mkdir -p $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/lib
pushd speech_tools
rm -f bin/Makefile
cp -a bin/* $RPM_BUILD_ROOT/usr/bin
cp -a lib/lib*.a $RPM_BUILD_ROOT/usr/lib
popd
mkdir -p $RPM_BUILD_ROOT/usr/share/festival
mv DATA.TMP/festival/lib/voices $RPM_BUILD_ROOT/usr/share/festival
mv DATA.TMP/festival/lib/dicts $RPM_BUILD_ROOT/usr/share/festival
rm -f lib/Makefile lib/*.fsstnd lib/*.americandefault bin/Makefile
mv lib/* $RPM_BUILD_ROOT/usr/share/festival
mv bin/* $RPM_BUILD_ROOT/usr/bin
# We want the real festival, not the wrapper script
rm -f $RPM_BUILD_ROOT/usr/bin/Makefile
mkdir -p $RPM_BUILD_ROOT/usr/man/man1
cp -a doc/*.1 $RPM_BUILD_ROOT/usr/man/man1

mkdir -p $RPM_BUILD_ROOT/usr/include/speech_tools
mkdir -p $RPM_BUILD_ROOT/usr/include/festival
cp -a src/include/* $RPM_BUILD_ROOT/usr/include/festival
cp -aR speech_tools/include/* $RPM_BUILD_ROOT/usr/include/speech_tools
cp -a src/lib/libFestival.a $RPM_BUILD_ROOT/usr/lib

# symlinks into buildtree evil
for i in $RPM_BUILD_ROOT/usr/bin/*; do
	if [ -h "$i" ]; then
    		a=`readlink "$i"`
		rm -f "$i"	
		cp -a "$a" $RPM_BUILD_ROOT/usr/bin/
	fi
done


# Remove some files we don't need
rm -rf $RPM_BUILD_ROOT/usr/include/speech_tools/win32
rm -rf $RPM_BUILD_ROOT/usr/include/speech_tools/Makefile
rm -rf $RPM_BUILD_ROOT/usr/include/festival/Makefile
rm -f  $RPM_BUILD_ROOT/usr/share/festival/etc/unknown_RedHatLinux/.made
rm -f $RPM_BUILD_ROOT/usr/bin/{est_gdb,est_examples,est_program}

# This shouldn't be in the tarball
pushd festdoc-1.4.2/speech_tools/doc
rm -fr CVS arch_doc/CVS man/CVS  speechtools/arch_doc/CVS
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/usr/include/festival/ -type f` `find $RPM_BUILD_ROOT/usr/include/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 %buildroot/%{_infodir}
cp -p festdoc-1.4.2/festival/info/* %buildroot/%{_infodir}

mkdir -p $RPM_BUILD_ROOT%{_mandir}
mv $RPM_BUILD_ROOT/usr/man/* $RPM_BUILD_ROOT%{_mandir}
rm -rf $RPM_BUILD_ROOT/usr/man
rm ../speech_tools

%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-1.4.2/festival/html/*html
#%doc festdoc-1.4.2/festival/info
#%doc festdoc-1.4.2/festival/festival.ps
%{_infodir}/*
# stuff from speech_tools
/usr/bin/*
/usr/share/festival
%{_mandir}/man1/*

%files devel
%defattr(-,root,root)
%doc festdoc-1.4.2/speech_tools
/usr/lib/*.a
%dir /usr/include/speech_tools
%dir /usr/include/festival
/usr/include/speech_tools/*
/usr/include/festival/*

%changelog
* 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