libgocryptfs/package-source.bash
dhirsbrunner abb2f1fad0 Prevent local user ID from appearing in source tarballs
The local user ID (1026 jakob) appears in the source tarballs gocryptfs_v1.7_src.tar.gz and gocryptfs_v1.7_src-deps.tar.gz as the owner of VERSION, Documentation, and vendor. This issue is already fixed for the binary releases by commit 07f57314af, and the solution here is the same: use "tar --owner=root --group=root".
2019-07-29 11:06:49 +02:00

39 lines
1.1 KiB
Bash
Executable File

#!/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
git archive --prefix "$PREFIX/" -o $PREFIX.tar HEAD
# Add "extra" files
tar --owner=root --group=root --transform "s!^!$PREFIX/!" --append -f $PREFIX.tar "$@"
# Compress
gzip -f $PREFIX.tar
}
cd "$(dirname "$0")"
GITVERSION=$(git describe --tags --dirty)
echo $GITVERSION > VERSION
# Render the manpages and include them in the tarball. This
# avoids a build-dependency to pandoc.
./Documentation/MANPAGE-render.bash
# gocryptfs source tarball
PREFIX_SRC_ONLY=gocryptfs_${GITVERSION}_src
git_archive_extra $PREFIX_SRC_ONLY VERSION Documentation/*.1
# gocryptfs source + dependencies tarball
dep ensure
PREFIX_SRC_DEPS=gocryptfs_${GITVERSION}_src-deps
git_archive_extra $PREFIX_SRC_DEPS VERSION Documentation/*.1 vendor
rm VERSION
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"