2017-08-21 14:10:05 +02:00
|
|
|
#!/bin/bash -eu
|
2015-10-07 22:14:00 +02:00
|
|
|
|
2017-08-21 14:10:05 +02:00
|
|
|
cd "$(dirname "$0")"
|
2015-10-07 22:14:00 +02:00
|
|
|
|
2017-05-27 15:22:27 +02:00
|
|
|
# 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
|
2017-05-29 08:40:55 +02:00
|
|
|
# "CentOS release 5.11 (Final)" -> "CentOS_release_5.11_Final"
|
|
|
|
ID=$(cat /etc/redhat-release | tr ' ' '_' | tr -d '()')
|
2017-05-27 15:22:27 +02:00
|
|
|
VERSION_ID=""
|
|
|
|
else
|
|
|
|
echo "Could not get distribution version"
|
|
|
|
ID=unknown
|
|
|
|
VERSION_ID=.unknown
|
|
|
|
fi
|
|
|
|
|
2016-01-09 15:47:29 +01:00
|
|
|
ARCH=$(go env GOARCH)
|
2016-11-01 15:43:33 +01:00
|
|
|
# Build gocryptfs.1 man page
|
|
|
|
./Documentation/MANPAGE-render.bash > /dev/null
|
|
|
|
cp -a ./Documentation/gocryptfs.1 .
|
2015-11-01 15:06:30 +01:00
|
|
|
|
2016-01-09 15:47:29 +01:00
|
|
|
TARGZ=gocryptfs_${GITVERSION}_${ID}${VERSION_ID}_${ARCH}.tar.gz
|
2015-11-01 15:06:30 +01:00
|
|
|
|
2017-08-21 14:10:05 +02:00
|
|
|
tar --owner=root --group=root -czf $TARGZ gocryptfs gocryptfs.1
|
2016-01-09 15:47:29 +01:00
|
|
|
|
|
|
|
echo "Tar created."
|
|
|
|
echo "Hint for signing: gpg -u 23A02740 --armor --detach-sig $TARGZ"
|