festival.spec 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. ##
  2. ## festival.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package versions
  24. %define V_festival 1.96
  25. %define V_speech_tools 1.2.96
  26. %define V_ogireslpc 2.2
  27. %define V_ogilexicon 2.2
  28. %define V_ogivoiceas 2.3
  29. %define V_ogivoicemwm5 2.3
  30. %define V_ogivoiceaec 2.3
  31. %define V_ogivoicejph 2.3
  32. %define V_ogivoicetll 2.3
  33. %define V_ogivoicerab 2.1
  34. # package information
  35. Name: festival
  36. Summary: Speech Synthesis System
  37. URL: http://www.cstr.ed.ac.uk/projects/festival/
  38. Vendor: University of Edinburgh
  39. Packager: OpenPKG Foundation e.V.
  40. Distribution: OpenPKG Community
  41. Class: EVAL
  42. Group: Audio
  43. License: X11-style
  44. Version: %{V_festival}
  45. Release: 20080323
  46. # package options
  47. %option with_ogi no
  48. # list of sources
  49. Source0: http://festvox.org/packed/festival/%{V_festival}/festival-%{V_festival}-beta.tar.gz
  50. Source1: http://festvox.org/packed/festival/%{V_festival}/speech_tools-%{V_speech_tools}-beta.tar.gz
  51. Source2: http://festvox.org/packed/festival/%{V_festival}/festlex_CMU.tar.gz
  52. Source3: http://festvox.org/packed/festival/%{V_festival}/festlex_POSLEX.tar.gz
  53. Source4: http://festvox.org/packed/festival/%{V_festival}/festlex_OALD.tar.gz
  54. Source5: http://festvox.org/packed/festival/%{V_festival}/festvox_kallpc16k.tar.gz
  55. Source6: http://festvox.org/packed/festival/%{V_festival}/festvox_kedlpc16k.tar.gz
  56. Source7: http://festvox.org/packed/festival/%{V_festival}/festvox_kedlpc8k.tar.gz
  57. Source8: http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_awb_arctic_hts.tar.gz
  58. Source9: http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_bdl_arctic_hts.tar.gz
  59. Source10: http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_jmk_arctic_hts.tar.gz
  60. Source11: http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_slt_arctic_hts.tar.gz
  61. Source12: http://www.cslu.ogi.edu/tts/download/data/OGIresLPC-%{V_ogireslpc}.tar.gz
  62. Source13: http://www.cslu.ogi.edu/tts/download/data/OGIlexicon-%{V_ogilexicon}.tar.gz
  63. Source14: http://www.cslu.ogi.edu/tts/download/data/voice_as_di_%{V_ogivoiceas}.tar.gz
  64. Source15: http://www.cslu.ogi.edu/tts/download/data/voice_mwm5_di_%{V_ogivoicemwm5}.tar.gz
  65. Source16: http://www.cslu.ogi.edu/tts/download/data/voice_aec_di_%{V_ogivoiceaec}.tar.gz
  66. Source17: http://www.cslu.ogi.edu/tts/download/data/voice_jph_di_%{V_ogivoicejph}.tar.gz
  67. Source18: http://www.cslu.ogi.edu/tts/download/data/voice_tll_di_%{V_ogivoicetll}.tar.gz
  68. Source19: http://www.cslu.ogi.edu/tts/download/data/voice_ogirab_di_%{V_ogivoicerab}.tar.gz
  69. Source20: rc.festival
  70. Source21: festival-init.scm
  71. Source22: festival-vars.scm
  72. Patch0: festival.patch
  73. # build information
  74. Prefix: %{l_prefix}
  75. BuildRoot: %{l_buildroot}
  76. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, gcc::with_cxx = yes
  77. PreReq: OpenPKG, openpkg >= 20040130, opensp
  78. AutoReq: no
  79. AutoReqProv: no
  80. %description
  81. Festival offers a general framework for building speech synthesis
  82. systems as well as including examples of various modules. As a whole
  83. it offers full text to speech through a number APIs. Festival is
  84. multi-lingual though English is the most advanced language. The
  85. system is written in C++ and uses the Edinburgh Speech Tools Library
  86. (EST) for low level architecture and has a Scheme (SIOD) based
  87. command interpreter for control.
  88. %track
  89. prog festival = {
  90. version = %{version}
  91. url = http://festvox.org/packed/festival/
  92. regex = (1\.\d+|2\.\d+)/
  93. }
  94. %prep
  95. %setup -q -c
  96. %setup -q -T -D -a 1
  97. %setup -q -T -D -a 2
  98. %setup -q -T -D -a 3
  99. %setup -q -T -D -a 4
  100. %setup -q -T -D -a 5
  101. %setup -q -T -D -a 6
  102. %setup -q -T -D -a 7
  103. %setup -q -T -D -a 8
  104. %setup -q -T -D -a 9
  105. %setup -q -T -D -a 10
  106. %setup -q -T -D -a 11
  107. %if "%{with_ogi}" == "yes"
  108. %setup -q -T -D -a 12
  109. %setup -q -T -D -a 13
  110. %setup -q -T -D -a 14
  111. %setup -q -T -D -a 15
  112. %setup -q -T -D -a 16
  113. %setup -q -T -D -a 17
  114. %setup -q -T -D -a 18
  115. %setup -q -T -D -a 19
  116. %endif
  117. %patch -p0
  118. %build
  119. # expand variables in patched sources
  120. %{l_shtool} subst %{l_value -s -a} \
  121. festival/lib/init.scm \
  122. festival/lib/tts.scm \
  123. festival/lib/voices.scm
  124. # optionally activate OGI extension
  125. %if "%{with_ogi}" == "yes"
  126. ( echo "ALSO_INCLUDE += OGIcommon OGIeffect OGIinsert OGIdbase OGIresLPC"
  127. ) >>festival/config/config.in
  128. %{l_shtool} subst \
  129. -e 's;^\(OPTIONAL.*\);\1 OGIcommon OGIeffect OGIinsert OGIdbase OGIresLPC;' \
  130. festival/src/modules/Makefile
  131. %endif
  132. # support additional platforms
  133. cp speech_tools/config/systems/ix86_FreeBSD.mak \
  134. speech_tools/config/systems/unknown_FreeBSD.mak
  135. cp speech_tools/config/systems/ix86_SunOS5.mak \
  136. speech_tools/config/systems/unknown_SunOS5.mak
  137. cp festival/config/systems/ix86_FreeBSD.mak \
  138. festival/config/systems/unknown_FreeBSD.mak
  139. cp festival/config/systems/ix86_SunOS5.mak \
  140. festival/config/systems/unknown_SunOS5.mak
  141. # build speech tools
  142. ( cd speech_tools
  143. CC="%{l_cc}" \
  144. CXX="%{l_cxx}" \
  145. CFLAGS="%{l_cflags -O}" \
  146. CXXFLAGS="%{l_cxxflags -O}" \
  147. CPPFLAGS="%{l_cppflags}" \
  148. LDFLAGS="%{l_ldflags}" \
  149. ./configure \
  150. --prefix=%{l_prefix}
  151. %{l_make} %{l_mflags}
  152. ) || exit $?
  153. # build festival toolkit
  154. ( cd festival
  155. ( echo "FTLIBDIR=%{l_prefix}/lib/festival"
  156. ) >>config/config.in
  157. CC="%{l_cc}" \
  158. CXX="%{l_cxx}" \
  159. CFLAGS="%{l_cflags -O}" \
  160. CXXFLAGS="%{l_cxxflags -O}" \
  161. CPPFLAGS="%{l_cppflags}" \
  162. LDFLAGS="%{l_ldflags}" \
  163. ./configure \
  164. --prefix=%{l_prefix}
  165. %{l_make} %{l_mflags}
  166. ) || exit $?
  167. %install
  168. # create installation hierarchy
  169. rm -rf $RPM_BUILD_ROOT
  170. %{l_shtool} mkdir -f -p -m 755 \
  171. $RPM_BUILD_ROOT%{l_prefix}/bin \
  172. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  173. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  174. $RPM_BUILD_ROOT%{l_prefix}/etc/festival \
  175. $RPM_BUILD_ROOT%{l_prefix}/lib/festival \
  176. $RPM_BUILD_ROOT%{l_prefix}/var/festival
  177. # install program files
  178. %{l_shtool} install -c -m 755 \
  179. festival/lib/etc/*/audsp \
  180. $RPM_BUILD_ROOT%{l_prefix}/bin/festival_audsp
  181. %{l_shtool} install -c -m 755 \
  182. festival/src/main/festival \
  183. festival/src/main/festival_client \
  184. $RPM_BUILD_ROOT%{l_prefix}/bin/
  185. %{l_shtool} install -c -m 755 \
  186. -e 's;\(exec \).*\(/bin/festival --script\);\1%{l_prefix}\2;' \
  187. festival/examples/saytime \
  188. festival/examples/text2pos \
  189. festival/examples/text2wave \
  190. $RPM_BUILD_ROOT%{l_prefix}/bin/
  191. %{l_shtool} install -c -m 644 \
  192. festival/doc/festival.1 \
  193. festival/doc/festival_client.1 \
  194. festival/doc/text2wave.1 \
  195. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  196. # install library files
  197. chmod -R u+w,a+r,og-w festival/lib
  198. find festival/lib -type d -print | xargs chmod 755
  199. mv festival/lib/voices/us/* festival/lib/voices/english/
  200. rmdir festival/lib/voices/us
  201. cp -rp festival/lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/festival/
  202. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/festival/etc
  203. # install default site configuration
  204. %{l_shtool} install -c -m 644 \
  205. %{SOURCE festival-vars.scm} \
  206. %{SOURCE festival-init.scm} \
  207. $RPM_BUILD_ROOT%{l_prefix}/etc/festival/
  208. # install run-command script
  209. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  210. %{SOURCE rc.festival} \
  211. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  212. # determine installation files
  213. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  214. %{l_files_std} \
  215. '%config %{l_prefix}/etc/festival/*' \
  216. '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/festival'
  217. %files -f files
  218. %clean
  219. rm -rf $RPM_BUILD_ROOT
  220. %post
  221. # after upgrade, restart service
  222. [ $1 -eq 2 ] || exit 0
  223. eval `%{l_rc} festival status 2>/dev/null`
  224. [ ".$festival_active" = .yes ] && %{l_rc} festival restart
  225. exit 0
  226. %preun
  227. # before erase, stop service and remove log files
  228. [ $1 -eq 0 ] || exit 0
  229. %{l_rc} festival stop 2>/dev/null
  230. rm -f $RPM_INSTALL_PREFIX/var/festival/* >/dev/null 2>&1 || true
  231. exit 0