File indexing completed on 2024-04-21 03:40:56

0001 #!/bin/bash
0002 #
0003 # Run this script on gcompris.net to update the rcc files
0004 # being served by it.
0005 #
0006 # cd /opt/gcompris
0007 # ./updateVoices.sh
0008 #
0009 
0010 # the path depends on the distribution
0011 # export RCC=/usr/lib64/qt5/bin/rcc
0012 export RCC=/usr/bin/rcc
0013 
0014 CURRENT_DATE=$(date "+%F-%H-%M-%S")
0015 
0016 echo "Generate ogg rcc"
0017 rm -rf ogg
0018 rsync -a --exclude .git --exclude aac --exclude mp3 . ogg
0019 cd ogg
0020 ./generate_voices_rcc.sh ogg
0021 
0022 cd ../
0023 
0024 function generateEncodedVoices {
0025     codec=$1
0026     echo "Create the $codec directory"
0027     rm -rf $codec
0028     rsync -a --exclude .git --exclude voices-ogg ogg/ $codec
0029     cd $codec
0030 
0031     echo "Encoding $codec files"
0032     ./encodeTo.sh $codec
0033 
0034     echo "Generate $codec rcc"
0035     ./generate_voices_rcc.sh $codec
0036 
0037     echo "Consolidate the top level Content file"
0038     cat .rcc/Contents >> ../ogg/.rcc/Contents
0039     rm .rcc/Contents
0040 
0041     cp .rcc/voices-$codec/Contents .rcc/voices-$codec/Contents-${CURRENT_DATE}
0042 
0043 #    echo "Update $codec on gcompris.net"
0044 #    rsync -avx .rcc/ /var/www/data3/
0045     cd ..
0046 }
0047 
0048 generateEncodedVoices aac
0049 generateEncodedVoices mp3
0050 
0051 # Keep a trace of the uploaded Contents in case we need
0052 cp ogg/.rcc/Contents ogg/.rcc/Contents-${CURRENT_DATE}
0053 cp ogg/.rcc/words/Contents ogg/.rcc/words/Contents-${CURRENT_DATE}
0054 cp ogg/.rcc/voices-ogg/Contents ogg/.rcc/voices-ogg/Contents-${CURRENT_DATE}
0055 
0056 #echo "Update ogg on gcompris.net"
0057 #cd ogg
0058 #rsync -avx .rcc/ /var/www/data3/