xref: /btstack/tool/package.sh (revision 1cc8850a162636b6ffb5115e87a73202bd68f362)
17ab355f4SMatthias Ringwald#!/usr/bin/env sh
27ab355f4SMatthias Ringwald
37ab355f4SMatthias Ringwald# get absolute path
47ab355f4SMatthias RingwaldTOOL_DIR=`dirname "$0"`
57ab355f4SMatthias RingwaldBTSTACK_ROOT=`realpath ${TOOL_DIR}/..`
67ab355f4SMatthias Ringwald
77ab355f4SMatthias Ringwald# get tag from git
8*1cc8850aSMatthias Ringwaldtag=`git tag --points-at HEAD`
97ab355f4SMatthias Ringwald
107ab355f4SMatthias Ringwald# get git version
117ab355f4SMatthias Ringwaldcommit=`git rev-parse --short HEAD`
127ab355f4SMatthias Ringwald
137ab355f4SMatthias Ringwald# use tag if available
147ab355f4SMatthias Ringwaldif [ -z "$tag" ]
157ab355f4SMatthias Ringwaldthen
167ab355f4SMatthias Ringwald    version=${commit}
177ab355f4SMatthias Ringwaldelse
187ab355f4SMatthias Ringwald    version=${tag}-${commit}
197ab355f4SMatthias Ringwaldfi
207ab355f4SMatthias Ringwald
217ab355f4SMatthias Ringwald# zip repository
227ab355f4SMatthias Ringwaldarchive_zip="btstack-${version}.zip"
237ab355f4SMatthias Ringwaldecho Create ${archive_zip}
247ab355f4SMatthias Ringwaldcd ${BTSTACK_ROOT} && git archive --format=zip -o ${archive_zip} HEAD .
257ab355f4SMatthias Ringwald
267ab355f4SMatthias Ringwald# build HTML documentation
277ab355f4SMatthias Ringwaldecho Build HTML documentation
287ab355f4SMatthias Ringwaldcd ${BTSTACK_ROOT}/doc/manual && make update_content html 2&> /dev/null
297ab355f4SMatthias Ringwald
307ab355f4SMatthias Ringwald# add HTML documentation to zip archive
317ab355f4SMatthias Ringwaldecho Add HTML documentation to zip archive as doc/manual/btstack
327ab355f4SMatthias Ringwaldcd ${BTSTACK_ROOT} && zip ${archive_zip} doc/manual/btstack > /dev/null
337ab355f4SMatthias Ringwald
347ab355f4SMatthias Ringwaldecho Done
35