blob: 50b6b4b1b82e5f27d93429c74e27233a91120e5e [file] [log] [blame]
Gilles Peskine0f4df8f2021-01-18 20:31:07 +01001#!/bin/sh
2
3set -eu
4
5usage () {
6 cat <<EOF
7Usage: $0 PATH_TO_PSA_CRYPTO_API_TREE
8Update the rendered copy of the PSA Cryptography API specification.
9
101. 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>
132. 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 ..
183. Copy the rendered files.
19 $0 psa-crypto-api
204. Commit the changes.
Gilles Peskinec2db5f02021-01-18 20:36:53 +010021 git add docs/html docs/PSA_Cryptography_API_Specification.pdf
22 git commit
Gilles Peskine0f4df8f2021-01-18 20:31:07 +010023EOF
24}
25
26if [ $# -ne 1 ] || [ "$1" = "--help" ]; then
27 usage
28 exit $(($# != 1))
29fi
30
31rsync -a --delete "$1/sphinx-build/html" docs/
32rsync -a "$1/sphinx-build/latex/psa_crypto_api.pdf" docs/PSA_Cryptography_API_Specification.pdf