OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   20-Mar-2008 17:41:34
  Branch: HEAD                             Handle: 2008032016413300

  Added files:
    openpkg-src/festival    festival-init.scm festival-vars.scm rc.festival
  Modified files:
    openpkg-src/festival    festival.patch festival.spec

  Log:
    first cut for adding Festival daemon/server support

  Summary:
    Revision    Changes     Path
    1.1         +23 -0      openpkg-src/festival/festival-init.scm
    1.1         +7  -0      openpkg-src/festival/festival-vars.scm
    1.2         +38 -0      openpkg-src/festival/festival.patch
    1.3         +71 -38     openpkg-src/festival/festival.spec
    1.1         +63 -0      openpkg-src/festival/rc.festival
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/festival/festival-init.scm
  ============================================================================
  $ cvs diff -u -r0 -r1.1 festival-init.scm
  --- /dev/null 2008-03-20 17:40:47 +0100
  +++ festival-init.scm 2008-03-20 17:41:33 +0100
  @@ -0,0 +1,23 @@
  +;;
  +;;  festival-init.scm -- Festival Initialization Procedure (language: Scheme)
  +;;
  +
  +;;  server configuration
  +(set! server_log_file      '@l_prefix@/var/festival/festival.log)
  +(set! server_port          '12345)
  +(set! server_access_list   '("localhost\\.example\\.com" "localhost"))
  +(set! server_deny_list     nil)
  +(set! server_passwd        nil)
  +(set_server_safe_functions '(tts_return_to_client tts_text tts_textall 
Parameter.set tts_textasterisk))
  +
  +;;  select default voice (given in the Festival priority order)
  +(set! voice_default 'voice_kal_diphone)
  +;(set! voice_default 'voice_cmu_us_bdl_arctic_hts)
  +;(set! voice_default 'voice_cmu_us_jmk_arctic_hts)
  +;(set! voice_default 'voice_cmu_us_slt_arctic_hts)
  +;(set! voice_default 'voice_cmu_us_awb_arctic_hts) 
  +;(set! voice_default 'voice_ked_diphone)
  +;(set! voice_default 'voice_us1_mbrola)
  +;(set! voice_default 'voice_us2_mbrola)
  +;(set! voice_default 'voice_us3_mbrola)
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/festival/festival-vars.scm
  ============================================================================
  $ cvs diff -u -r0 -r1.1 festival-vars.scm
  --- /dev/null 2008-03-20 17:40:47 +0100
  +++ festival-vars.scm 2008-03-20 17:41:34 +0100
  @@ -0,0 +1,7 @@
  +;;
  +;;  festival-vars.scm -- Festival Variable Configuration (language: Scheme)
  +;;
  +
  +(set! system-voice-path '("@l_prefix@/lib/festival/voices"))
  +(set! sgml_parse_progname "@l_prefix@/bin/onsgmls")
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/festival/festival.patch
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 festival.patch
  --- openpkg-src/festival/festival.patch       20 Mar 2008 14:55:28 -0000      
1.1
  +++ openpkg-src/festival/festival.patch       20 Mar 2008 16:41:33 -0000      
1.2
  @@ -35,3 +35,41 @@
   -EST_TVector<int> size = 20 bytes.
   -EST_TMatrix<int> size = 28 bytes.
    Initial Matrix
  +Index: festival/lib/init.scm
  +--- festival/lib/init.scm.orig       2004-07-16 01:03:04 +0200
  ++++ festival/lib/init.scm    2008-03-20 16:18:56 +0100
  +@@ -55,6 +55,10 @@
  + (if (probe_file (path-append libdir "sitevars.scm"))
  +     (load (path-append libdir "sitevars.scm")))
  + 
  ++;;;  OpenPKG configuration hook 1
  ++(if (probe_file "@l_prefix@/etc/festival/festival-vars.scm")
  ++    (load "@l_prefix@/etc/festival/festival-vars.scm")))
  ++
  + ;;; CSTR siod extensions
  + (require 'cstr)
  + 
  +@@ -138,6 +142,10 @@
  + (if (probe_file (path-append libdir "siteinit.scm"))
  +     (load (path-append libdir "siteinit.scm")))
  + 
  ++;;;  OpenPKG configuration hook 2
  ++(if (probe_file "@l_prefix@/etc/festival/festival-init.scm")
  ++    (load "@l_prefix@/etc/festival/festival-init.scm")))
  ++
  + ;;;  User initialization, if a user has a personal customization
  + ;;;  file loaded it
  + (if (probe_file (path-append home-directory ".siodrc"))
  +--- festival/lib/multisyn/multisyn_pauses.scm        2004-06-21 
08:19:30.000000000 -0600
  ++++ festival/lib/multisyn/multisyn_pauses.scm        2005-01-12 
18:53:27.000000000 -0700
  +@@ -85,8 +85,8 @@
  + (let ((silence (car (cadr (car (PhoneSet.description '(silences))))))
  +       (seg (item.relation (find_last_seg word) 'Segment))
  +       pause_item)
  +-  (format t "  inserting pause after: %s.\n" (item.name seg))
  +-  (format t "  Inserting pause\n")
  ++;  (format t "  inserting pause after: %s.\n" (item.name seg))
  ++;  (format t "  Inserting pause\n")
  + ; if next seg is not silence insert one.
  +   (if (or (not (item.next seg))
  +       (not (string-equal (item.name (item.next seg)) silence)))
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/festival/festival.spec
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 festival.spec
  --- openpkg-src/festival/festival.spec        20 Mar 2008 14:57:35 -0000      
1.2
  +++ openpkg-src/festival/festival.spec        20 Mar 2008 16:41:33 -0000      
1.3
  @@ -54,13 +54,16 @@
   Source12:     
http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_bdl_arctic_hts.tar.gz
   Source13:     
http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_jmk_arctic_hts.tar.gz
   Source14:     
http://festvox.org/packed/festival/%{V_festival}/festvox_cmu_us_slt_arctic_hts.tar.gz
  +Source15:     rc.festival
  +Source16:     festival-init.scm
  +Source17:     festival-vars.scm
   Patch0:       festival.patch
   
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
   BuildPreReq:  OpenPKG, openpkg >= 20040130, make, gcc, gcc::with_cxx = yes
  -PreReq:       OpenPKG, openpkg >= 20040130
  +PreReq:       OpenPKG, openpkg >= 20040130, opensp
   AutoReq:      no
   AutoReqProv:  no
   
  @@ -99,30 +102,34 @@
       %patch -p0
   
   %build
  +    #   expand variables in patched sources
  +    %{l_shtool} subst %{l_value -s -a} \
  +        festival/lib/init.scm
  +
       #   build speech tools
  -    ( cd speech_tools
  -      CC="%{l_cc}" \
  -      CXX="%{l_cxx}" \
  -      CFLAGS="%{l_cflags -O}" \
  -      CXXFLAGS="%{l_cxxflags -O}" \
  -      CPPFLAGS="%{l_cppflags}" \
  -      LDFLAGS="%{l_ldflags}" \
  -      ./configure \
  -          --prefix=%{l_prefix}
  -      %{l_make} %{l_mflags}
  +    (   cd speech_tools
  +        CC="%{l_cc}" \
  +        CXX="%{l_cxx}" \
  +        CFLAGS="%{l_cflags -O}" \
  +        CXXFLAGS="%{l_cxxflags -O}" \
  +        CPPFLAGS="%{l_cppflags}" \
  +        LDFLAGS="%{l_ldflags}" \
  +        ./configure \
  +            --prefix=%{l_prefix}
  +        %{l_make} %{l_mflags}
       ) || exit $?
   
       #   build festival toolkit
  -    ( cd festival
  -      CC="%{l_cc}" \
  -      CXX="%{l_cxx}" \
  -      CFLAGS="%{l_cflags -O}" \
  -      CXXFLAGS="%{l_cxxflags -O}" \
  -      CPPFLAGS="%{l_cppflags}" \
  -      LDFLAGS="%{l_ldflags}" \
  -      ./configure \
  -          --prefix=%{l_prefix}
  -      %{l_make} %{l_mflags}
  +    (   cd festival
  +        CC="%{l_cc}" \
  +        CXX="%{l_cxx}" \
  +        CFLAGS="%{l_cflags -O}" \
  +        CXXFLAGS="%{l_cxxflags -O}" \
  +        CPPFLAGS="%{l_cppflags}" \
  +        LDFLAGS="%{l_ldflags}" \
  +        ./configure \
  +            --prefix=%{l_prefix}
  +        %{l_make} %{l_mflags}
       ) || exit $?
   
   %install
  @@ -131,8 +138,11 @@
       %{l_shtool} mkdir -f -p -m 755 \
           $RPM_BUILD_ROOT%{l_prefix}/bin \
           $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/festival \
           $RPM_BUILD_ROOT%{l_prefix}/libexec/festival \
  -        $RPM_BUILD_ROOT%{l_prefix}/lib/festival
  +        $RPM_BUILD_ROOT%{l_prefix}/lib/festival \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/festival
   
       #   install program files
       %{l_shtool} install -c -m 755 \
  @@ -142,17 +152,16 @@
           festival/src/main/festival \
           festival/src/main/festival_client \
           $RPM_BUILD_ROOT%{l_prefix}/libexec/festival/
  -    ( echo "#!/bin/sh"
  -      echo "PATH=%{l_prefix}/libexec/festival:\$PATH"
  -      echo "export PATH"
  -      echo "exec %{l_prefix}/libexec/festival/festival \\"
  -      echo "    --libdir %{l_prefix}/lib/festival \$*"
  +    (   echo "#!/bin/sh"
  +        echo "PATH=%{l_prefix}/libexec/festival:\$PATH"
  +        echo "export PATH"
  +        echo "exec %{l_prefix}/libexec/festival/festival \\"
  +        echo "    --libdir %{l_prefix}/lib/festival \$*"
       ) >festival.sh
  -    ( echo "#!/bin/sh"
  -      echo "PATH=%{l_prefix}/libexec/festival:\$PATH"
  -      echo "export PATH"
  -      echo "exec %{l_prefix}/libexec/festival/festival_client \\"
  -      echo "    %{l_prefix}/lib/festival \$*"
  +    (   echo "#!/bin/sh"
  +        echo "PATH=%{l_prefix}/libexec/festival:\$PATH"
  +        echo "export PATH"
  +        echo "exec %{l_prefix}/libexec/festival/festival_client \$*"
       ) >festival_client.sh
       %{l_shtool} install -c -m 755 \
           festival.sh $RPM_BUILD_ROOT%{l_prefix}/bin/festival
  @@ -172,20 +181,44 @@
       #   install library files
       chmod -R u+w,a+r,og-w festival/lib
       find festival/lib -type d -print | xargs chmod 755
  +    mv festival/lib/voices/us/* festival/lib/voices/english/
  +    rmdir festival/lib/voices/us
       cp -rp festival/lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/festival/
       rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/festival/etc
  -    ( echo "(set! system-voice-path '(\"%{l_prefix}/lib/festival/voices\"))"
  -      echo "(set! sgml_parse_progname \"nsgmls\")"
  -    ) >sitevars.scm
  +
  +    #   install default site configuration
       %{l_shtool} install -c -m 644 \
  -        sitevars.scm \
  -        $RPM_BUILD_ROOT%{l_prefix}/lib/festival/sitevars.scm
  +        %{SOURCE festival-vars.scm} \
  +        %{SOURCE festival-init.scm} \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/festival/
  +
  +    #   install run-command script
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.festival} \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   
       #   determine installation files
  -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%config %{l_prefix}/etc/festival/*' \
  +        '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/festival'
   
   %files -f files
   
   %clean
       rm -rf $RPM_BUILD_ROOT
   
  +%post
  +    #   after upgrade, restart service
  +    [ $1 -eq 2 ] || exit 0
  +    eval `%{l_rc} festival status 2>/dev/null`
  +    [ ".$festival_active" = .yes ] && %{l_rc} festival restart
  +    exit 0
  +
  +%preun
  +    #   before erase, stop service and remove log files
  +    [ $1 -eq 0 ] || exit 0
  +    %{l_rc} festival stop 2>/dev/null
  +    rm -f $RPM_INSTALL_PREFIX/var/festival/* >/dev/null 2>&1 || true
  +    exit 0
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/festival/rc.festival
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.festival
  --- /dev/null 2008-03-20 17:40:47 +0100
  +++ rc.festival       2008-03-20 17:41:34 +0100
  @@ -0,0 +1,63 @@
  [EMAIL PROTECTED]@/bin/openpkg rc
  +##
  +##  rc.festival -- Run-Commands
  +##
  +
  +%config
  +    festival_enable="$openpkg_rc_def"
  +    festival_daemon="no"
  +    festival_log_prolog="true"
  +    festival_log_epilog="true"
  +    festival_log_numfiles="10"
  +    festival_log_minsize="1M"
  +    festival_log_complevel="9"
  +
  +%common
  +    festival_logfile="@l_prefix@/var/festival/festival.log"
  +    festival_pidfile="@l_prefix@/var/festival/festival.pid"
  +    festival_signal () {
  +        [ -f $festival_pidfile ] && kill -$1 `cat $festival_pidfile`
  +    }
  +
  +%status -u @l_nusr@ -o
  +    festival_usable="unknown"
  +    festival_active="no"
  +    rcService festival enable yes && \
  +        festival_signal 0 && festival_active="yes"
  +    echo "festival_enable=\"$festival_enable\""
  +    echo "festival_usable=\"$festival_usable\""
  +    echo "festival_active=\"$festival_active\""
  +
  +%start -u @l_nusr@
  +    rcService festival enable yes || exit 0
  +    rcService festival active yes && exit 0
  +    rcVarIsYes festival_daemon || exit 0
  +    (   nohup @l_prefix@/bin/festival --server \
  +        </dev/null >/dev/null 2>&1 &
  +        echo $! >$festival_pidfile
  +    ) >/dev/null 2>&1
  +
  +%stop -u @l_nusr@
  +    rcService festival enable yes || exit 0
  +    rcService festival active no  && exit 0
  +    rcVarIsYes festival_daemon || exit 0
  +    festival_signal TERM
  +    sleep 2
  +    rm -f $festival_pidfile >/dev/null 2>&1 || true
  +
  +%restart -u @l_nusr@
  +    rcService festival enable yes || exit 0
  +    rcService festival active no  && exit 0
  +    rcVarIsYes festival_daemon || exit 0
  +    rc festival stop start
  +
  +%daily -u @l_nusr@
  +    rcService festival enable yes || exit 0
  +    rcVarIsYes festival_daemon || exit 0
  +    shtool rotate -f \
  +        -n ${festival_log_numfiles} -s ${festival_log_minsize} -d \
  +        -z ${festival_log_complevel} -m 664 -o @l_nusr@ -g @l_ngrp@ \
  +        -P "${festival_log_prolog}" \
  +        -E "${festival_log_epilog}; rc festival restart" \
  +        $festival_logfile
  +
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to