2017-11-01 18:58:10 +01:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
# git_archive_extra PREFIX EXTRA1 [EXTRA2 ...]
|
|
|
|
# Call git-archive and add additional files to the tarball.
|
|
|
|
git_archive_extra() {
|
|
|
|
local PREFIX=$1
|
|
|
|
shift
|
|
|
|
# Add files tracked in git
|
2020-04-13 13:09:27 +02:00
|
|
|
git archive --prefix "$PREFIX/" -o "$PREFIX.tar" HEAD
|
2017-11-01 18:58:10 +01:00
|
|
|
# Add "extra" files
|
2020-04-13 13:09:27 +02:00
|
|
|
tar --owner=root --group=root --transform "s!^!$PREFIX/!" --append -f "$PREFIX.tar" "$@"
|
2017-11-01 18:58:10 +01:00
|
|
|
# Compress
|
2020-04-13 13:09:27 +02:00
|
|
|
gzip -f "$PREFIX.tar"
|
2017-11-01 18:58:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
GITVERSION=$(git describe --tags --dirty)
|
2020-04-13 13:09:27 +02:00
|
|
|
echo "$GITVERSION" > VERSION
|
2018-01-07 19:00:20 +01:00
|
|
|
|
2019-03-02 15:40:05 +01:00
|
|
|
# Render the manpages and include them in the tarball. This
|
|
|
|
# avoids a build-dependency to pandoc.
|
|
|
|
./Documentation/MANPAGE-render.bash
|
|
|
|
|
2018-01-07 19:00:20 +01:00
|
|
|
# gocryptfs source tarball
|
|
|
|
PREFIX_SRC_ONLY=gocryptfs_${GITVERSION}_src
|
2020-04-13 13:09:27 +02:00
|
|
|
git_archive_extra "$PREFIX_SRC_ONLY" VERSION Documentation/*.1
|
2017-11-01 18:58:10 +01:00
|
|
|
|
2018-01-07 19:00:20 +01:00
|
|
|
# gocryptfs source + dependencies tarball
|
2020-04-13 14:07:55 +02:00
|
|
|
go mod vendor
|
2018-01-07 19:00:20 +01:00
|
|
|
PREFIX_SRC_DEPS=gocryptfs_${GITVERSION}_src-deps
|
2020-04-13 13:09:27 +02:00
|
|
|
git_archive_extra "$PREFIX_SRC_DEPS" VERSION Documentation/*.1 vendor
|
2018-01-07 19:00:20 +01:00
|
|
|
|
2017-11-01 19:41:47 +01:00
|
|
|
rm VERSION
|
2017-11-01 18:58:10 +01:00
|
|
|
|
2018-01-07 19:00:20 +01:00
|
|
|
echo "Tars created."
|
|
|
|
echo "Hint for signing: gpg -u 23A02740 --armor --detach-sig $PREFIX_SRC_ONLY.tar.gz"
|
|
|
|
echo " gpg -u 23A02740 --armor --detach-sig $PREFIX_SRC_DEPS.tar.gz"
|