123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- #!/bin/sh
- #
- # SpanDSP - a series of DSP components for telephony
- #
- # unpack_gsm0610_data.sh
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Lesser General Public License version 2.1,
- # as published by the Free Software Foundation.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU Lesser General Public
- # License along with this program; if not, write to the Free Software
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- # The ETSI distribution file extracts to 5 ZIP files, called DISK1.ZIP to DISK5.ZIP
- # These were originally the contents of 5 floppy disks. Disks 1 to 3 contain data
- # files. However, disks 4 and 5 contain .EXE files, which unpack.... but only in an
- # MS environment. These files need to be executed in a Windows or DOS environment,
- # or a good emulation like FreeDOS or Wine.
- ETSIDATA="../../../en_300961v080101p0.zip"
- cd test-data
- if [ -d etsi ]
- then
- cd etsi
- else
- mkdir etsi
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot create test-data/etsi!
- exit $RETVAL
- fi
- cd etsi
- fi
- if [ -d gsm0610 ]
- then
- cd gsm0610
- else
- mkdir gsm0610
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot create test-data/etsi/gsm0610!
- exit $RETVAL
- fi
- cd gsm0610
- fi
- if [ $1x = --no-exe-runx ]
- then
- # Run the .exe files, which should be here
- ./FR_A.EXE
- ./FR_HOM_A.EXE
- ./FR_SYN_A.EXE
- ./FR_U.EXE
- ./FR_HOM_U.EXE
- ./FR_SYN_U.EXE
- exit 0
- fi
- # Clear out any leftovers from the past
- rm -rf ASN.1.txt
- rm -rf DISK1.ZIP
- rm -rf DISK2.ZIP
- rm -rf DISK3.ZIP
- rm -rf DISK4.ZIP
- rm -rf DISK5.ZIP
- rm -rf *.EXE
- rm -rf READ_FRA.TXT
- rm -rf ACTION
- rm -rf unpacked
- if [ $1x = --no-exex ]
- then
- # We need to prepare the .exe files to be run separately
- rm -rf *.INP
- rm -rf *.COD
- rm -rf *.OUT
- unzip ${ETSIDATA} >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- unzip ./DISK4.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- unzip ./DISK5.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- rm -rf ASN.1.txt
- rm -rf DISK1.ZIP
- rm -rf DISK2.ZIP
- rm -rf DISK3.ZIP
- rm -rf DISK4.ZIP
- rm -rf DISK5.ZIP
- rm -rf READ_FRA.TXT
- # An environment which is emulating an MS one will probably need
- # to make the .EXE files actually executable.
- chmod 755 *.EXE
- echo "Now copy the files from the test-data/etsi/gsm0610 directory to a Windows,"
- echo "DOS or other machine which can run .exe files. Run each of the .exe"
- echo "files (there are 6 of them), and copy the whole directory back here."
- echo "You can then complete the creation of the working data directories"
- echo "with the command:"
- echo $0 "--no-exe-continue"
- exit 0
- fi
- unzip ${ETSIDATA} >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- #rm ${ETSIDATA}
- rm -rf ASN.1.txt
- if [ $1x != --no-exe-continuex ]
- then
- # We need to extract and run the .exe files right now. For this to succeed
- # we must be running in an environment which can run .exe files. This has been
- # tested with Cygwin on a Windows XP machine.
- rm -rf *.INP
- rm -rf *.COD
- rm -rf *.OUT
- unzip ./DISK4.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- unzip ./DISK5.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- # An environment which is emulating an MS one will probably need
- # to make the .EXE files actually executable.
- chmod 755 *.EXE
- ./FR_HOM_A.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- ./FR_SYN_A.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- ./FR_A.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- ./FR_HOM_U.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- ./FR_SYN_U.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- ./FR_U.EXE >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot run ./FR_HOM_A.EXE
- exit $RETVAL
- fi
- rm -rf READ_FRA.TXT
- fi
- rm -rf DISK4.ZIP
- rm -rf DISK5.ZIP
- rm -rf *.EXE
- chmod 644 *.INP
- chmod 644 *.OUT
- chmod 644 *.COD
- # Create the directories where we want to put the test data files.
- mkdir unpacked
- mkdir unpacked/fr_A
- mkdir unpacked/fr_L
- mkdir unpacked/fr_U
- mkdir unpacked/fr_homing_A
- mkdir unpacked/fr_homing_L
- mkdir unpacked/fr_homing_U
- mkdir unpacked/fr_sync_A
- mkdir unpacked/fr_sync_L
- mkdir unpacked/fr_sync_U
- # Disks 1, 2 and 3 simply unzip, and the files have sensible file names. We
- # just need to rearrange the directories in which they are located.
- unzip ./DISK1.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- unzip ./DISK2.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- unzip ./DISK3.ZIP >/dev/null
- RETVAL=$?
- if [ $RETVAL != 0 ]
- then
- echo Cannot unpack the ETSI test vectors for GSM 06.10!
- exit $RETVAL
- fi
- rm -rf DISK1.ZIP
- rm -rf DISK2.ZIP
- rm -rf DISK3.ZIP
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK1/"* ./unpacked/fr_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/"Sync*.cod ./unpacked/fr_sync_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK2/"Seq*h.* ./unpacked/fr_homing_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/"Seq*h.* ./unpacked/fr_homing_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Bitsync.inp" ./unpacked/fr_sync_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Seqsync.inp" ./unpacked/fr_sync_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Homing01.cod" ./unpacked/fr_homing_L
- mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Homing01.out" ./unpacked/fr_homing_L
- rm -rf ACTION
- # The files extracted by the .EXE files have messy naming, and are not in
- # a sane directory layout. We rename and move them, to make the final result of
- # the files extracted from all five of the original .ZIP files reasonably
- # consistent, and easy to follow.
- rm -rf READ_FRA.TXT
- for I in SYN*_A.COD ;
- do
- mv $I `echo $I | sed -e "s|SYN|./unpacked/fr_sync_A/Sync|" | sed -e "s/COD/cod/"`
- done
- for I in SYN*_U.COD ;
- do
- mv $I `echo $I | sed -e "s|SYN|./unpacked/fr_sync_U/Sync|" | sed -e "s/COD/cod/"`
- done
- for I in SEQ*H_A.COD ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/COD/cod/"`
- done
- for I in SEQ*H_U.COD ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/COD/cod/"`
- done
- for I in SEQ*H_A.INP ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/INP/inp/"`
- done
- for I in SEQ*H_U.INP ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/INP/inp/"`
- done
- for I in SEQ*H_A.OUT ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/OUT/out/"`
- done
- for I in SEQ*H_U.OUT ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/OUT/out/"`
- done
- for I in SEQ*-A.COD ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/COD/cod/"`
- done
- for I in SEQ*-U.COD ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/COD/cod/"`
- done
- for I in SEQ*-A.INP ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/INP/inp/"`
- done
- for I in SEQ*-U.INP ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/INP/inp/"`
- done
- for I in SEQ*-A.OUT ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/OUT/out/"`
- done
- for I in SEQ*-U.OUT ;
- do
- mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/OUT/out/"`
- done
- mv HOM01_A.OUT ./unpacked/fr_homing_A/Homing01_A.out
- mv HOM01_U.OUT ./unpacked/fr_homing_U/Homing01_U.out
- mv SEQSYN_A.INP ./unpacked/fr_sync_A/Seqsync_A.inp
- mv SEQSYN_U.INP ./unpacked/fr_sync_U/Seqsync_U.inp
- echo "The ETSI test vectors for GSM 06.10 should now be correctly laid out in the"
- echo "gsm0610 directory"
|