aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-release.sh73
-rwxr-xr-xbin/mkchecksum.sh48
-rwxr-xr-xbin/mkdocker.sh52
-rwxr-xr-xbin/mkrelease.sh54
4 files changed, 227 insertions, 0 deletions
diff --git a/bin/build-release.sh b/bin/build-release.sh
new file mode 100755
index 0000000..fc8319e
--- /dev/null
+++ b/bin/build-release.sh
@@ -0,0 +1,73 @@
+#! /usr/bin/env sh
+
+readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ prefix="${OPT_PREFIX:-$BASEDIR/work/install}"
+
+ # Exit after every failure from here on out
+ set -e
+
+ # Build Rakudo Star from the release tarball
+ mkdir -p -- "$BASEDIR/work/build"
+ cd -- "$BASEDIR/work/build"
+ tar xzf "$BASEDIR/work/release/rakudo-star-$1.tar.gz"
+ cd "rakudo-star-$1"
+ perl Configure.pl --prefix="$prefix" --backend=moar --gen-moar
+
+ if [ "$OPT_INSTALL" ]
+ then
+ make install
+ fi
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":hip:" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ i) OPT_INSTALL=1 ; OPTS=$(( OPTS + 1 )) ;;
+ p) OPT_PREFIX=$OPTARG ; OPTS=$(( OPTS + 2 )) ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+
+ unset opt
+}
+
+usage()
+{
+ cat <<EOF
+Usage:
+ $(basename "$0") -h
+ $(basename "$0") [-i [-p <path>]] <version>
+
+Build Rakudo Star from a release tarball in $BASEDIR/work/release. This tarball
+can be easily made using mkrelease.sh in this repository. If you don't specify
+-i, this will not install Raku in $BASEDIR/work/install. This can be convenient
+if you just want to run some simple tests.
+
+Options:
+ -h Show this help text and exit.
+ -i Also install the freshly built Rakudo Star.
+ -p Set a prefix to install Rakudo Star into. Defaults to ./work/install,
+ relative to the repository root.
+EOF
+}
+
+main "$@"
diff --git a/bin/mkchecksum.sh b/bin/mkchecksum.sh
new file mode 100755
index 0000000..5a7ac1f
--- /dev/null
+++ b/bin/mkchecksum.sh
@@ -0,0 +1,48 @@
+#! /usr/bin/env sh
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ printf "md5 %s\n" "$(md5sum "$1" | cut -f1 -d" ")"
+ printf "sha1 %s\n" "$(sha1sum "$1" | cut -f1 -d" ")"
+ printf "sha224 %s\n" "$(sha224sum "$1" | cut -f1 -d" ")"
+ printf "sha256 %s\n" "$(sha256sum "$1" | cut -f1 -d" ")"
+ printf "sha384 %s\n" "$(sha384sum "$1" | cut -f1 -d" ")"
+ printf "sha512 %s\n" "$(sha512sum "$1" | cut -f1 -d" ")"
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+}
+
+usage()
+{
+ cat <<EOF
+Usage:
+ $(basename "$0") -h
+ $(basename "$0") <file>
+
+Make a number of checksums of a given file.
+EOF
+}
+
+main "$@"
diff --git a/bin/mkdocker.sh b/bin/mkdocker.sh
new file mode 100755
index 0000000..8c6e1b8
--- /dev/null
+++ b/bin/mkdocker.sh
@@ -0,0 +1,52 @@
+#! /usr/bin/env sh
+
+readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ # Make the Docker image
+ cd -- "$BASEDIR"
+ docker build --build-arg "VERSION=$1" -t "rakudo-star:$1" .
+ docker tag "rakudo-star:$1" rakudo-star:latest
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+}
+
+usage()
+{
+ cat <<EOF
+Usage:
+ $(basename "$0") -h
+ $(basename "$0") <version>
+
+Make a Docker image for Rakudo Star. This requires a release tarball to exist.
+You must specify the same version argument as you supplied to mkrelease.sh.
+
+Options:
+ -h Show this help text and exit.
+EOF
+}
+
+main "$@"
diff --git a/bin/mkrelease.sh b/bin/mkrelease.sh
new file mode 100755
index 0000000..5dc036d
--- /dev/null
+++ b/bin/mkrelease.sh
@@ -0,0 +1,54 @@
+#! /usr/bin/env sh
+
+readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ # Make the release
+ cd -- "$BASEDIR"
+ make -f tools/star/Makefile all VERSION="$1" \
+ && make -f tools/star/Makefile release VERSION="$1"
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+}
+
+usage()
+{
+ cat <<EOF
+Usage:
+ $(basename "$0") -h
+ $(basename "$0") <version>
+
+Make a releasable tarball of Rakudo Star. You must specify a version number,
+which will be used to name the tarball. The tarball will be put in
+$BASEDIR/work/release. You will still have to manually create checksums and a
+PGP signature.
+
+Options:
+ -h Show this help text and exit.
+EOF
+}
+
+main "$@"