summaryrefslogtreecommitdiff
path: root/package.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-27 15:22:27 +0200
committerJakob Unterwurzacher2017-05-27 15:22:27 +0200
commitc36a55e98599c96f228eb7ea09c1c71a5e114ee5 (patch)
treeac5bcfce154908f7cc0763cfdd8302c58103de46 /package.bash
parentd6ef283c3f076ba45dd873d69e1c7d86ed29b14a (diff)
package.bash: make it work somewhat on RHEL
RHEL and CentOS do not have /etc/os-release yet. Read from /etc/redhat-release instead. Fixes https://github.com/rfjakob/gocryptfs/issues/113
Diffstat (limited to 'package.bash')
-rwxr-xr-xpackage.bash19
1 files changed, 17 insertions, 2 deletions
diff --git a/package.bash b/package.bash
index d3b95fd..4cb462e 100755
--- a/package.bash
+++ b/package.bash
@@ -3,8 +3,23 @@
set -eu
cd $(dirname "$0")
-source build.bash # Builds binary and sets GITVERSION (example: v0.7-15-gf01f599)
-source /etc/os-release # Sets ID (example: fedora) and VERSION_ID (example: 23)
+# 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