blob: 618fd5d254cd4102b1c233cdda185f6734ef5189 [file] [log] [blame]
Jean-Marc Valinee31d6f2011-02-14 23:58:41 -05001#!/bin/sh
Jean-Marc Valin39ec0f92011-02-03 12:30:32 -05002
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -07003#Stop on errors
Jean-Marc Valin8163eb72011-04-28 14:20:13 -04004set -e
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -07005#Set the CWD to the location of this script
6[ -n "${0%/*}" ] && cd "${0%/*}"
7
8toplevel=".."
9destdir="opus_source"
Jean-Marc Valin8163eb72011-04-28 14:20:13 -040010
Jean-Marc Valin90781762011-02-17 16:44:21 -050011echo packaging source code
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070012rm -rf "${destdir}"
13mkdir "${destdir}"
Jean-Marc Valin103302b2011-05-19 17:17:44 -040014mkdir "${destdir}/src"
15mkdir "${destdir}/silk"
16mkdir "${destdir}/silk/float"
17mkdir "${destdir}/silk/fixed"
Jean-Marc Valinc3749902011-09-13 18:21:18 -070018mkdir "${destdir}/celt"
Jean-Marc Valin4923f3f2011-10-26 21:36:57 -040019mkdir "${destdir}/include"
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070020for f in `cat "${toplevel}"/opus_sources.mk "${toplevel}"/celt_sources.mk \
Ralph Gilescd539df2012-04-05 09:23:47 -070021 "${toplevel}"/silk_sources.mk "${toplevel}"/opus_headers.mk \
22 "${toplevel}"/celt_headers.mk "${toplevel}"/silk_headers.mk \
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070023 | grep '\.[ch]' | sed -e 's/^.*=//' -e 's/\\\\//'` ; do
Jean-Marc Valin103302b2011-05-19 17:17:44 -040024 cp -a "${toplevel}/${f}" "${destdir}/${f}"
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070025done
Gregory Maxwella5ff49e2011-10-26 19:56:00 -040026cp -a "${toplevel}"/src/opus_demo.c "${destdir}"/src/
Jean-Marc Valinc4ca21f2011-09-15 10:10:40 -070027cp -a "${toplevel}"/src/opus_compare.c "${destdir}"/src/
Gregory Maxwella5ff49e2011-10-26 19:56:00 -040028cp -a "${toplevel}"/celt/opus_custom_demo.c "${destdir}"/celt/
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070029cp -a "${toplevel}"/Makefile.draft "${destdir}"/Makefile
30cp -a "${toplevel}"/opus_sources.mk "${destdir}"/
31cp -a "${toplevel}"/celt_sources.mk "${destdir}"/
Jean-Marc Valinb2c00d22011-08-02 08:13:42 -040032cp -a "${toplevel}"/silk_sources.mk "${destdir}"/
Timothy B. Terriberryaf1f5382011-05-09 18:08:17 -070033cp -a "${toplevel}"/README.draft "${destdir}"/README
34cp -a "${toplevel}"/COPYING "${destdir}"/COPYING
Jean-Marc Valinfa3ef8d2011-10-28 23:13:28 -040035cp -a "${toplevel}"/tests/run_vectors.sh "${destdir}"/
Jean-Marc Valin39ec0f92011-02-03 12:30:32 -050036
Jean-Marc Valine249b0b2012-05-15 16:31:50 -040037GZIP=-9 tar --owner=root --group=root --format=v7 -czf opus_source.tar.gz "${destdir}"
Jean-Marc Valin90781762011-02-17 16:44:21 -050038echo building base64 version
Timothy B. Terriberry828e33f2011-09-26 20:53:26 -070039cat opus_source.tar.gz| base64 | tr -d '\n' | fold -w 64 | \
40 sed -e 's/^/\<spanx style="vbare"\>###/' -e 's/$/\<\/spanx\>\<vspace\/\>/' > \
41 opus_source.base64
42
Jean-Marc Valin39ec0f92011-02-03 12:30:32 -050043
Jean-Marc Valinc4ca21f2011-09-15 10:10:40 -070044#echo '<figure>' > opus_compare_escaped.c
45#echo '<artwork>' >> opus_compare_escaped.c
46#echo '<![CDATA[' >> opus_compare_escaped.c
47#cat opus_compare.c >> opus_compare_escaped.c
48#echo ']]>' >> opus_compare_escaped.c
49#echo '</artwork>' >> opus_compare_escaped.c
50#echo '</figure>' >> opus_compare_escaped.c
Jean-Marc Valin90781762011-02-17 16:44:21 -050051
Timothy B. Terriberry53e67822012-05-15 13:45:40 -070052if [[ ! -d ../opus_testvectors ]] ; then
53 echo "Downloading test vectors..."
Gregory Maxwell8115a462012-08-21 17:56:51 -040054 wget 'http://opus-codec.org/testvectors/opus_testvectors.tar.gz'
55 tar -C .. -xvzf opus_testvectors.tar.gz
Timothy B. Terriberry53e67822012-05-15 13:45:40 -070056fi
Jean-Marc Valin17c59662012-02-17 16:09:21 -050057echo '<figure>' > testvectors_sha1
58echo '<artwork>' >> testvectors_sha1
59echo '<![CDATA[' >> testvectors_sha1
60(cd ../opus_testvectors; sha1sum *.bit *.dec) >> testvectors_sha1
61#cd opus_testvectors
62#sha1sum *.bit *.dec >> ../testvectors_sha1
63#cd ..
64echo ']]>' >> testvectors_sha1
65echo '</artwork>' >> testvectors_sha1
66echo '</figure>' >> testvectors_sha1
67
Jean-Marc Valin90781762011-02-17 16:44:21 -050068echo running xml2rfc
Jean-Marc Valin018b0df2011-09-06 08:03:38 -040069xml2rfc draft-ietf-codec-opus.xml draft-ietf-codec-opus.html &
Jean-Marc Valin39ec0f92011-02-03 12:30:32 -050070xml2rfc draft-ietf-codec-opus.xml
Jean-Marc Valin018b0df2011-09-06 08:03:38 -040071wait