Jean-Marc Valin | ee31d6f | 2011-02-14 23:58:41 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Jean-Marc Valin | 39ec0f9 | 2011-02-03 12:30:32 -0500 | [diff] [blame] | 2 | |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 3 | #Stop on errors |
Jean-Marc Valin | 8163eb7 | 2011-04-28 14:20:13 -0400 | [diff] [blame] | 4 | set -e |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 5 | #Set the CWD to the location of this script |
| 6 | [ -n "${0%/*}" ] && cd "${0%/*}" |
| 7 | |
| 8 | toplevel=".." |
| 9 | destdir="opus_source" |
Jean-Marc Valin | 8163eb7 | 2011-04-28 14:20:13 -0400 | [diff] [blame] | 10 | |
Jean-Marc Valin | 9078176 | 2011-02-17 16:44:21 -0500 | [diff] [blame] | 11 | echo packaging source code |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 12 | rm -rf "${destdir}" |
| 13 | mkdir "${destdir}" |
Jean-Marc Valin | 103302b | 2011-05-19 17:17:44 -0400 | [diff] [blame] | 14 | mkdir "${destdir}/src" |
| 15 | mkdir "${destdir}/silk" |
| 16 | mkdir "${destdir}/silk/float" |
| 17 | mkdir "${destdir}/silk/fixed" |
Jean-Marc Valin | c374990 | 2011-09-13 18:21:18 -0700 | [diff] [blame] | 18 | mkdir "${destdir}/celt" |
Jean-Marc Valin | 4923f3f | 2011-10-26 21:36:57 -0400 | [diff] [blame] | 19 | mkdir "${destdir}/include" |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 20 | for f in `cat "${toplevel}"/opus_sources.mk "${toplevel}"/celt_sources.mk \ |
Ralph Giles | cd539df | 2012-04-05 09:23:47 -0700 | [diff] [blame] | 21 | "${toplevel}"/silk_sources.mk "${toplevel}"/opus_headers.mk \ |
| 22 | "${toplevel}"/celt_headers.mk "${toplevel}"/silk_headers.mk \ |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 23 | | grep '\.[ch]' | sed -e 's/^.*=//' -e 's/\\\\//'` ; do |
Jean-Marc Valin | 103302b | 2011-05-19 17:17:44 -0400 | [diff] [blame] | 24 | cp -a "${toplevel}/${f}" "${destdir}/${f}" |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 25 | done |
Gregory Maxwell | a5ff49e | 2011-10-26 19:56:00 -0400 | [diff] [blame] | 26 | cp -a "${toplevel}"/src/opus_demo.c "${destdir}"/src/ |
Jean-Marc Valin | c4ca21f | 2011-09-15 10:10:40 -0700 | [diff] [blame] | 27 | cp -a "${toplevel}"/src/opus_compare.c "${destdir}"/src/ |
Gregory Maxwell | a5ff49e | 2011-10-26 19:56:00 -0400 | [diff] [blame] | 28 | cp -a "${toplevel}"/celt/opus_custom_demo.c "${destdir}"/celt/ |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 29 | cp -a "${toplevel}"/Makefile.draft "${destdir}"/Makefile |
| 30 | cp -a "${toplevel}"/opus_sources.mk "${destdir}"/ |
| 31 | cp -a "${toplevel}"/celt_sources.mk "${destdir}"/ |
Jean-Marc Valin | b2c00d2 | 2011-08-02 08:13:42 -0400 | [diff] [blame] | 32 | cp -a "${toplevel}"/silk_sources.mk "${destdir}"/ |
Timothy B. Terriberry | af1f538 | 2011-05-09 18:08:17 -0700 | [diff] [blame] | 33 | cp -a "${toplevel}"/README.draft "${destdir}"/README |
| 34 | cp -a "${toplevel}"/COPYING "${destdir}"/COPYING |
Jean-Marc Valin | fa3ef8d | 2011-10-28 23:13:28 -0400 | [diff] [blame] | 35 | cp -a "${toplevel}"/tests/run_vectors.sh "${destdir}"/ |
Jean-Marc Valin | 39ec0f9 | 2011-02-03 12:30:32 -0500 | [diff] [blame] | 36 | |
Jean-Marc Valin | e249b0b | 2012-05-15 16:31:50 -0400 | [diff] [blame] | 37 | GZIP=-9 tar --owner=root --group=root --format=v7 -czf opus_source.tar.gz "${destdir}" |
Jean-Marc Valin | 9078176 | 2011-02-17 16:44:21 -0500 | [diff] [blame] | 38 | echo building base64 version |
Timothy B. Terriberry | 828e33f | 2011-09-26 20:53:26 -0700 | [diff] [blame] | 39 | cat 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 Valin | 39ec0f9 | 2011-02-03 12:30:32 -0500 | [diff] [blame] | 43 | |
Jean-Marc Valin | c4ca21f | 2011-09-15 10:10:40 -0700 | [diff] [blame] | 44 | #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 Valin | 9078176 | 2011-02-17 16:44:21 -0500 | [diff] [blame] | 51 | |
Timothy B. Terriberry | 53e6782 | 2012-05-15 13:45:40 -0700 | [diff] [blame] | 52 | if [[ ! -d ../opus_testvectors ]] ; then |
| 53 | echo "Downloading test vectors..." |
Gregory Maxwell | 8115a46 | 2012-08-21 17:56:51 -0400 | [diff] [blame^] | 54 | wget 'http://opus-codec.org/testvectors/opus_testvectors.tar.gz' |
| 55 | tar -C .. -xvzf opus_testvectors.tar.gz |
Timothy B. Terriberry | 53e6782 | 2012-05-15 13:45:40 -0700 | [diff] [blame] | 56 | fi |
Jean-Marc Valin | 17c5966 | 2012-02-17 16:09:21 -0500 | [diff] [blame] | 57 | echo '<figure>' > testvectors_sha1 |
| 58 | echo '<artwork>' >> testvectors_sha1 |
| 59 | echo '<![CDATA[' >> testvectors_sha1 |
| 60 | (cd ../opus_testvectors; sha1sum *.bit *.dec) >> testvectors_sha1 |
| 61 | #cd opus_testvectors |
| 62 | #sha1sum *.bit *.dec >> ../testvectors_sha1 |
| 63 | #cd .. |
| 64 | echo ']]>' >> testvectors_sha1 |
| 65 | echo '</artwork>' >> testvectors_sha1 |
| 66 | echo '</figure>' >> testvectors_sha1 |
| 67 | |
Jean-Marc Valin | 9078176 | 2011-02-17 16:44:21 -0500 | [diff] [blame] | 68 | echo running xml2rfc |
Jean-Marc Valin | 018b0df | 2011-09-06 08:03:38 -0400 | [diff] [blame] | 69 | xml2rfc draft-ietf-codec-opus.xml draft-ietf-codec-opus.html & |
Jean-Marc Valin | 39ec0f9 | 2011-02-03 12:30:32 -0500 | [diff] [blame] | 70 | xml2rfc draft-ietf-codec-opus.xml |
Jean-Marc Valin | 018b0df | 2011-09-06 08:03:38 -0400 | [diff] [blame] | 71 | wait |