2020-08-10 22:47:09 +02:00
|
|
|
#!/usr/bin/env bash
|
2013-06-28 13:18:28 +10:00
|
|
|
|
2013-07-22 08:31:36 +10:00
|
|
|
set -e
|
|
|
|
|
|
2021-04-08 09:38:26 +10:00
|
|
|
tag="$1"
|
|
|
|
|
case $tag in
|
|
|
|
|
-h|--help)
|
|
|
|
|
echo "Usage: $0 <tag>"
|
|
|
|
|
echo "Builds the libevdev documentation and rsyncs it to the freedesktop.org server."
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Options:"
|
|
|
|
|
echo " tag ... the tag to build (default: master)"
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
1*)
|
|
|
|
|
# Helper so we can run it with the numerical tag only, tags
|
|
|
|
|
# are all prefixed with libevdev
|
|
|
|
|
tag="libevdev-$tag"
|
|
|
|
|
;;
|
|
|
|
|
**)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
tag=${tag:-master}
|
2013-07-22 08:31:36 +10:00
|
|
|
|
2021-04-08 09:38:26 +10:00
|
|
|
dir=$(mktemp -d --tmpdir='' libevdev-doc.XXX)
|
|
|
|
|
git clone --depth 1 --branch "$tag" https://gitlab.freedesktop.org/libevdev/libevdev.git "$dir"
|
|
|
|
|
pushd $dir
|
|
|
|
|
builddir=_doc_build
|
2021-04-08 09:13:58 +10:00
|
|
|
rm -rf "$builddir"
|
|
|
|
|
meson setup "$builddir"
|
|
|
|
|
ninja -C "$builddir"
|
2021-04-08 09:38:26 +10:00
|
|
|
|
|
|
|
|
# Strip libevdev- prefix from the tag and replace master with latest, whichever applies
|
|
|
|
|
htmldir=${tag/#libevdev-/}
|
|
|
|
|
htmldir=${htmldir/master/latest}
|
|
|
|
|
rsync --delete -avz "$builddir/html/" freedesktop.org:/srv/www.freedesktop.org/www/software/libevdev/doc/${htmldir}
|
|
|
|
|
popd
|