aboutsummaryrefslogtreecommitdiff
path: root/package-source.bash
blob: 4d5cf2016455a16347ae156e94ec578ae385fa44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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 master
	# Add "extra" files
	tar --transform "s!^!$PREFIX/!" --append -f $PREFIX.tar "$@"
	# Compress
	gzip -f $PREFIX.tar
}

cd "$(dirname "$0")"

GITVERSION=$(git describe --tags --dirty)
PREFIX=gocryptfs_${GITVERSION}_src+deps

dep ensure
echo $GITVERSION > VERSION
git_archive_extra $PREFIX VERSION vendor
rm VERSION

echo "Tar created."
echo "Hint for signing: gpg -u 23A02740 --armor --detach-sig $PREFIX.tar.gz"