123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- #!/usr/bin/env bash
- if [ "$1" == "keep" ]; then KEEP="yes"; else KEEP="no"; fi
- WOLFSSL_TEMPDIR=$(mktemp -d) || exit $?
- WOLFSSL_BRANCH=$(git symbolic-ref --short HEAD)
- function cleanup_on_exit() {
- if [ "$KEEP" == "no" ];
- then
- echo "Removing tmp directory"
- rm -rf "$WOLFSSL_TEMPDIR"
- else
- echo "tmp directory ${WOLFSSL_TEMPDIR} left in place."
- fi
- }
- trap cleanup_on_exit EXIT
- WOLFSSL_VERSION=$(grep -Eo '[0-9]\.[0-9]\.[0-9]+' wolfssl/version.h)
- if [ -n "$WOLFSSL_VERSION" ]; then
- echo "Detected wolfSSL Version $WOLFSSL_VERSION"
- else
- echo "Couldn't detect wolfSSL version."
- exit 1
- fi
- echo "Setting up work directory..."
- git clone -q -n --shared . "$WOLFSSL_TEMPDIR" || exit $?
- pushd "$WOLFSSL_TEMPDIR" >/dev/null || exit $?
- git checkout -q "$WOLFSSL_BRANCH"
- echo "Removing files not needed..."
- rm -rf -- ./.git*
- rm -rf ./build-aux
- rm -rf ./certs
- rm -rf ./doc
- rm -rf ./Docker
- rm -rf ./examples
- rm -rf ./IDE
- rm -rf ./IPP
- rm -rf ./lib
- rm -rf ./linuxkm
- rm -rf ./m4
- rm -rf ./mcapi
- rm -rf ./mplabx
- rm -rf ./mqx
- rm -rf ./rpm
- rm -rf ./RTOS
- rm -rf ./scripts
- rm -rf ./sslSniffer
- rm -rf ./swig
- rm -rf ./tests
- rm -rf ./testsuite
- rm -rf ./tirtos
- rm -rf ./wrapper
- rm -f -- *.rc *.supp *.ac *.am *.conf *.sh *.cproject *.project *.pl
- rm -f Vagrantfile SCRIPTS-LIST quit input resource.h
- find . -name "*.am" -delete
- find . -name "*.vcxproj" -delete
- find . -name "*.vcproj" -delete
- find . -name "*.sln" -delete
- rm -rf ./wolfcrypt/src/port
- rm -rf ./wolfssl/wolfcrypt/port
- cp ./wolfssl/options.h.in ./wolfssl/options.h || exit $?
- cp ./wolfcrypt/test/test_paths.h.in ./wolfcrypt/test/test_paths.h || exit $?
- popd >/dev/null || exit $?
- echo "Generating wolfssl-${WOLFSSL_VERSION}-small.tar.gz..."
- tar zcf "wolfssl-${WOLFSSL_VERSION}-small.tar.gz" -C "$WOLFSSL_TEMPDIR" . || exit $?
- echo "Done"
|