File relx-fix-readlink-for-relative-path-names.patch of Package erlang-relx

diff -rupN erlang-relx-3.21.1-ori/priv/templates/bin erlang-relx-3.21.1/priv/templates/bin
--- erlang-relx-3.21.1-ori/priv/templates/bin	2016-10-07 18:33:29.000000000 +0000
+++ erlang-relx-3.21.1/priv/templates/bin	2018-05-05 11:40:21.000000000 +0000
@@ -2,7 +2,17 @@
 
 set -e
 
-SCRIPT=$(readlink $0 || true)
+# SCRIPT=$(readlink $0 || true)
+# OSX does not support readlink '-f' flag, work
+# around that
+case $OSTYPE in 
+    darwin*)
+        SCRIPT=$(readlink $0 || true)
+    ;;
+    *)
+        SCRIPT=$(readlink -f $0 || true)
+    ;;
+esac
 if [ -z $SCRIPT ]; then
     SCRIPT=$0
 fi;
diff -rupN erlang-relx-3.21.1-ori/priv/templates/extended_bin erlang-relx-3.21.1/priv/templates/extended_bin
--- erlang-relx-3.21.1-ori/priv/templates/extended_bin	2016-10-07 18:33:29.000000000 +0000
+++ erlang-relx-3.21.1/priv/templates/extended_bin	2018-05-05 11:40:21.000000000 +0000
@@ -2,7 +2,17 @@
 
 set -e
 
-SCRIPT=$(readlink $0 || true)
+# SCRIPT=$(readlink $0 || true)
+# OSX does not support readlink '-f' flag, work
+# around that
+case $OSTYPE in 
+    darwin*)
+        SCRIPT=$(readlink $0 || true)
+    ;;
+    *)
+        SCRIPT=$(readlink -f $0 || true)
+    ;;
+esac
 if [ -z $SCRIPT ]; then
     SCRIPT=$0
 fi;