Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -eux |
| 4 | |
| 5 | build_tarball() { |
| 6 | for dir in vppinfra dpdk svm vlib-api vlib vnet vpp vpp-api-test |
| 7 | do |
| 8 | tar -C install-$1/$dir/include -cf - . | tar -C $tmp_dir/include -xf - |
| 9 | done |
| 10 | tar -C ../sample-plugin -cf - . \ |
| 11 | | tar -C $tmp_dir/src/sample-plugin -xf - |
| 12 | cp tools/bin/vppapigen $tmp_dir/tools/bin |
| 13 | echo Created by `id -u -n` on `hostname` at `date` > \ |
| 14 | $tmp_dir/toolkit-version-stamp |
| 15 | cp scripts/vpp-plugin-toolkit-readme $tmp_dir/README |
| 16 | tar -C $tmp_dir -zcf $PWD/vpp-plugin-toolkit-$1.tar.gz . |
| 17 | } |
| 18 | |
| 19 | if [ `basename $PWD` != "build-root" ] ; then |
| 20 | echo Please run this script from build-root |
| 21 | exit 1 |
| 22 | fi |
| 23 | |
| 24 | echo Pull additional tookit repos |
| 25 | make PLATFORM=vpp sample-plugin-find-source |
| 26 | |
| 27 | make PLATFORM=vpp TAG=vpp wipe-all |
| 28 | echo Build vpp forwarder production package |
| 29 | make PLATFORM=vpp TAG=vpp V=0 strip_sumbols=yes install-packages |
| 30 | |
| 31 | tmp_dir="`mktemp -d /tmp/plugin-XXXXXX`" |
| 32 | trap "rm -rf $tmp_dir" err |
| 33 | |
| 34 | echo Create vpp forwarder production plugin toolkit tarball |
| 35 | mkdir -p $tmp_dir/tools/bin $tmp_dir/include $tmp_dir/lib64 \ |
| 36 | $tmp_dir/src/sample-plugin |
| 37 | build_tarball vpp-native |
| 38 | rm -rf $tmp_dir |
| 39 | |
| 40 | exit 0 |