aboutsummaryrefslogtreecommitdiff
path: root/package.bash
blob: 4cb462ea4d6c738454a0d8e28eeb73cdad18c3fc (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
28
29
30
31
32
33
#!/bin/bash

set -eu
cd $(dirname "$0")

# Build binary and sets $GITVERSION (example: v0.7-15-gf01f599)
source build.bash

# Set $ID (example: "fedora", "debian") and $VERSION_ID (example: "23", "8")
if [[ -e /etc/os-release ]]; then
	# Modern Debian and Fedora
	source /etc/os-release
elif [[ -e /etc/redhat-release ]]; then
	# RHEL and CentOS
	ID=$(cat /etc/redhat-release | tr ' ' '_')
	VERSION_ID=""
else
	echo "Could not get distribution version"
	ID=unknown
	VERSION_ID=.unknown
fi

ARCH=$(go env GOARCH)
# Build gocryptfs.1 man page
./Documentation/MANPAGE-render.bash > /dev/null
cp -a ./Documentation/gocryptfs.1 .

TARGZ=gocryptfs_${GITVERSION}_${ID}${VERSION_ID}_${ARCH}.tar.gz

tar czf $TARGZ gocryptfs gocryptfs.1

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