Name: speech-tools Summary: The Edinburgh Speech Tools libraries Version: 1.2.96 Release: 0.1%{?dist} URL: http://www.cstr.ed.ac.uk/projects/speech_tools/ Group: System Environment/Libraries License: MIT-style %define baseURL http://festvox.org/packed/festival/1.96 Source0: %{baseURL}/speech_tools-%{version}-beta.tar.gz # Whack some buildroot references. This needs cleanup. Patch2: speech-tools-1.2.96-buildroot-FIXME.patch # Use shared libraries Patch3: speech-tools-1.2.96-shared-build.patch # Build the ESD module Patch4: speech-tools-1.2.96-buildesdmodule.patch # Fix a coding error (see bug #162137). This has been reported # to upstream. Patch5: speech-tools-1.2.96-rateconvtrivialbug.patch # Link libs with libm, libtermcap, and libesd (see bug #198190). # This has been reported upstream. Patch6: speech-tools-1.2.96-linklibswithotherlibs.patch # For some reason, CXX is set to gcc on everything but Mac OS Darwin, # where it's set to g++. Yeah, well. We need it to be right too. # This has been reported upstream. Patch7: speech-tools-1.2.96-ohjeezcxxisnotgcc.patch # Make the make system understand how to build any library as a # shared library. This has been reported upstream. Patch11: speech-tools-1.2.96-generalizesharedbuilds.patch # This is a hack to make the shared libraries build with actual # sonames. Should pretty much do the right thing, although note # of course that the sonames aren't official upstream. This # has been reported upstream; not sure what they'll do with it. Patch12: speech-tools-1.2.96-bettersonamehack.patch # This makes the include files not be installed into "EST" subdirectories. Patch13: speech-tools-1.2.96-includelocation.patch # This updates to a development version which fixes # a 64-bit cleanliness issue (among other changes). Patch20: speech-tools-1.2.96-beta+awb.patch # This makes festival use /usr/lib[arch]/festival/etc for its # arch-specific "etc-path", rather than /usr/share/festival/etc/system_type. # Then I use sed to replace the token with actual arch-specific libdir. # A better way would be to actually make this a flexible makefile parameter, # but that's something to take up with upstream. (Which I have; we'll see # what they do in the next version.) # Why this is in the speech-tools library in addition to the main program, # I'm not not exactly sure. It may not actually be used in one of those # places. That's worth discussing upstream too. Patch31: speech-tools-1.2.96-kludge-etcpath-into-libarch.patch BuildRequires: ncurses-devel, esound-devel Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig Provides: festival-speechtools-libs Obsoletes: festival-speechtools-libs <= %{version} BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %package utils Summary: Miscellaneous utilities from the Edinburgh Speech Tools Group: Applications/Multimedia Provides: festival-speechtools-utils Obsoletes: festival-speechtools-utils <= %{version} %package devel Summary: Development files for Edinburgh Speech Tools libraries Group: Development/Libraries Requires: speech-tools = %{version} Provides: festival-speechtools-devel Obsoletes: festival-speechtools-devel <= %{version} %description The Edinburgh Speech Tools libraries, used by the Festival text-to-speech and speech synthesis system. %description utils Miscellaneous utilities from the Edinburgh Speech Tools. Unless you have a specific need for one of these programs, you probably don't need to install this. %description devel Development files for the Edinburgh Speech Tools Library, used by the Festival speech synthesis system. %prep %setup -q -n speech_tools # exit out if they've fixed this, so we can remove this hack. [ -x base_class/string/EST_strcasecmp.c ] || exit 1 chmod -x base_class/string/EST_strcasecmp.c %patch2 -p1 -b .buildrootrefs %patch3 -p1 -b .shared %patch4 -p1 -b .esd %patch5 -p1 -b .bugfix %patch6 -p1 -b .liblinking %patch7 -p1 -b .cxx %patch11 -p1 -b .shared %patch12 -p1 -b .soname %patch13 -p1 -b .noestdir %patch20 -p1 -b .awb %patch31 -p1 -b .libarch # finish the kludge for arch-specific "etc" (misc. binaries) for f in main/siod_main.cc; do sed -i -e 's,{{HORRIBLELIBARCHKLUDGE}},"%{_libdir}",' $f done %build export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/lib %configure # -fno-shared-data is used 'cause the upstream makefile does. # -fPIC 'cause we're building shared libraries and it doesn't hurt. # -fno-strict-aliasing because of a couple of warnings about code # problems; if $RPM_OPT_FLAGS contains -O2 or above, this puts # it back. Once that problem is gone upstream, remove this for # better optimization. make \ CFLAGS="$RPM_OPT_FLAGS -fPIC -fno-shared-data -fno-strict-aliasing" \ CXXFLAGS="$RPM_OPT_FLAGS -fPIC -fno-shared-data -fno-strict-aliasing" %install # "make install" for this package is, um, "interesting". It seems geared for # local user-level builds. So, rather than doing that and then patching it # up, do the right parts by hand as necessary. # install speech tools libs, binaries, and include files # libs make INSTALLED_LIB=$RPM_BUILD_ROOT%{_libdir} make_installed_lib_shared # no thanks, static libs. rm $RPM_BUILD_ROOT%{_libdir}/*.a # utilities make INSTALLED_BIN=$RPM_BUILD_ROOT%{_libexecdir}/speech-tools make_installed_bin_static # this list of the useful programs in speech_tools comes from # upstream developer Alan W. Black; the other stuff is to be removed. pushd $RPM_BUILD_ROOT%{_libexecdir}/speech-tools ls | grep -Evw "ch_wave|ch_track|na_play|na_record|wagon|wagon_test" | grep -Evw "make_wagon_desc|pitchmark|pm|sig2fv|wfst_build" | grep -Evw "wfst_run|wfst_run" | xargs rm popd # include files pushd include for d in $( find . -type d | grep -v win32 ); do make -w -C $d INCDIR=$RPM_BUILD_ROOT%{_includedir}/speech-tools/EST/$d install_incs done popd # Festival uses the speech tools make system for its own build. # Isn't that fun. pushd config for d in compilers rules systems; do mkdir -p $RPM_BUILD_ROOT%{_datadir}/speech-tools/config/${d} done # This is a long list, but I'm trying to avoid installing unneeded junk. # note for rpmlint: yes, modules.sh is non-executable and that's fine. for f in config modincludes.inc \ compilers/jdk_defaults.mak compilers/gcc.mak \ compilers/jdk.mak compilers/gcc_defaults.mak \ rules/*.mak rules/*.sh rules/*.awk \ systems/default.mak systems/Linux.mak \ systems/RedHatLinux.mak systems/unknown_RedHatLinux.mak do install -m 644 $f $RPM_BUILD_ROOT%{_datadir}/speech-tools/config/$f done popd # For some reason (possibly a good one; I don't have an opinion), festival # wants to treat these files as authoritative and takes and munges them as # part of its own build process. Okay then. mkdir -p $RPM_BUILD_ROOT%{_datadir}/speech-tools/lib/siod/ for f in siod.scm web.scm cstr.scm fringe.scm; do install -m 644 lib/siod/$f \ $RPM_BUILD_ROOT%{_datadir}/speech-tools/lib/siod/ done # And for bonus fun, the docs suggest #including some .cc files for C++ # template instantiation. And Festival does exactly that. The instructions # say to reference the files as "../base_class/whatever.cc", so with # -I/%{_includedir}/speech-tools/EST, this should work with unmodified code. pushd base_class mkdir -p $RPM_BUILD_ROOT%{_includedir}/speech-tools/base_class # This should grab all of the template classes. Plus there's the one .h file. for f in EST_matrix_support.h $( grep -l template EST_T*.cc ); do install -m 644 $f $RPM_BUILD_ROOT%{_includedir}/speech-tools/base_class/ done popd # The documentation in this package isn't up to date, and, the words of the # README, "The build process for the documentation is still dependent on # some more obscure packages so it is recommended that you take the # pre-built documentation." Therefore, we'll just refer people there. cat << EOF > README.devel The documentation for The Edinburgh Speech Tools Library can be found in the festival-docs package or online at . EOF %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root) %doc README %{_libdir}/libestbase.so.* %{_libdir}/libestools.so.* %{_libdir}/libeststring.so.* %files utils %defattr(-,root,root) %doc README %dir %{_libexecdir}/speech-tools %{_libexecdir}/speech-tools/* %files devel %defattr(-,root,root) %doc README.devel %{_libdir}/libestbase.so %{_libdir}/libestools.so %{_libdir}/libeststring.so %dir %{_includedir}/speech-tools %dir %{_includedir}/speech-tools/EST %dir %{_includedir}/speech-tools/base_class %{_includedir}/speech-tools/EST/* %{_includedir}/speech-tools/base_class/* %dir %{_datadir}/speech-tools %{_datadir}/speech-tools/* %changelog * Thu Mar 29 2007 Matthew Miller 1.2.96-0.1 - split package from festival. - change /usr/include/speech_tools to /usr/include/speech-tools for consistency. And add the EST subdirectory to better match upstream docs. - package up some .cc template classes in the devel package. (Need to check if building with -fno-implicit-templates would be a good thing to do. Or maybe it's exactly the wrong thing. Either way, worth testing.) - added readme pointing to the docs package for the devel stuff. - package up the lib/siod stuff in -devel so festival build can get it.