Gilles Peskine | 0f4df8f | 2021-01-18 20:31:07 +0100 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | usage () { |
| 6 | cat <<EOF |
| 7 | Usage: $0 PATH_TO_PSA_CRYPTO_API_TREE |
| 8 | Update the rendered copy of the PSA Cryptography API specification. |
| 9 | |
| 10 | 1. Check out the desired version of the PSA Crypto API specification. |
| 11 | git clone https://github.com/ARMmbed/psa-crypto-api |
| 12 | git checkout <TAG> |
| 13 | 2. Build the specification. |
| 14 | cd psa-crypto-api |
| 15 | sudo docker build -t psa_api - <psa-crypto-api/scripts/Dockerfile |
| 16 | sudo docker run -i -t -u \$(id -u):\$(id -g) -v \$PWD:/var/lib/builds psa_api make |
| 17 | cd .. |
| 18 | 3. Copy the rendered files. |
| 19 | $0 psa-crypto-api |
| 20 | 4. Commit the changes. |
| 21 | git commit docs/html docs/PSA_Cryptography_API_Specification.pdf |
| 22 | EOF |
| 23 | } |
| 24 | |
| 25 | if [ $# -ne 1 ] || [ "$1" = "--help" ]; then |
| 26 | usage |
| 27 | exit $(($# != 1)) |
| 28 | fi |
| 29 | |
| 30 | rsync -a --delete "$1/sphinx-build/html" docs/ |
| 31 | rsync -a "$1/sphinx-build/latex/psa_crypto_api.pdf" docs/PSA_Cryptography_API_Specification.pdf |