From 137618c299728720ca01c32572357e7b8338abf2 Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 7 Apr 2020 01:19:24 +0530 Subject: Add installation instructions to readme --- README.org | 29 ++++++++++++++++++++++++++++ scripts/install | 56 ------------------------------------------------------ scripts/install.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 56 deletions(-) delete mode 100755 scripts/install create mode 100755 scripts/install.sh diff --git a/README.org b/README.org index 6b3dfde..1eda814 100644 --- a/README.org +++ b/README.org @@ -9,13 +9,42 @@ Grus is a simple word unjumbler written in Go. | Source Code | [[https://tildegit.org/andinus/grus][Andinus / Grus]] | | GitHub (Mirror) | [[https://github.com/andinus/grus][Grus - GitHub]] | +*Tested on*: +- OpenBSD 6.6 (with /unveil/) + * Working - Grus takes a word as input from the user - Input is ordered in [[https://wikipedia.org/wiki/Lexicographical_order][lexical order]] - Ordered input is searched in grus's database It returns unjumbled word along with all the anagrams. +* Examples +Run =grus help= to get the usage printed. + +#+BEGIN_SRC sh +grus tinesl # will unjumble tinesl +#+END_SRC +You can also use the =grus-add= python script to add words to grus. +* Installation +** Pre-built binaries +Pre-built binaries are available for OpenBSD. +*** v0.1.0 +#+BEGIN_SRC sh +curl -s \ + https://tildegit.org/andinus/grus/raw/tag/v0.1.0/scripts/install.sh | sh + +# Download the initialization scripts. +curl -o grus-add \ + https://tildegit.org/andinus/grus/raw/tag/v0.1.0/scripts/grus-add + +curl -o init \ + https://tildegit.org/andinus/grus/raw/tag/v0.1.0/scripts/init + +# Initialize the database. +chmod +x init && \ + ./init +#+END_SRC * History Initial version of Grus was just a simple shell script that used the slowest method of unjumbling words, it checked every permutation of the word with all diff --git a/scripts/install b/scripts/install deleted file mode 100755 index bc02528..0000000 --- a/scripts/install +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -openbsdH="25a8dc77cda3d225c85d3f0cb318d01c17546c1c4a8c789a318f832ce1948bc3" - -earlyCheck(){ - os=`uname` - os=`echo $os | tr "[:upper:]" "[:lower:"]` - - case $os in - *openbsd* ) ;; - *) - echo "Pre-built binary not available for your os" - exit 1 - ;; - esac - - cpu=`uname -m` - cpu=`echo $cpu | tr "[:upper:]" "[:lower:"]` - - case $cpu in - *amd*64* | *x86*64* ) ;; - *) - echo "Pre-built binary not available for your cpu" - exit 1 - ;; - esac -} - -getURL(){ - url="https://archive.org/download/grus-v0.1.0/grus-v0.1.0-$os-$cpu" -} - -printURL(){ - echo "You can get the Pre-built binary here:" - echo "$url" - echo - echo "Run these commands to install it on your device." - echo "# curl -L -o /usr/local/bin/grus $url" - echo "# chmod +x /usr/local/bin/grus" - echo - echo "This is sha256 hash for grus built for: $os $cpu" - case $os in - *openbsd* ) - echo "$openbsdH" - ;; - esac - echo - echo "Verify the hash by running sha256 on grus binary." - echo "$ sha256 /usr/local/bin/grus" -} - -echo "Grus v0.1.0" -echo -earlyCheck -getURL -printURL diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..bc02528 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +openbsdH="25a8dc77cda3d225c85d3f0cb318d01c17546c1c4a8c789a318f832ce1948bc3" + +earlyCheck(){ + os=`uname` + os=`echo $os | tr "[:upper:]" "[:lower:"]` + + case $os in + *openbsd* ) ;; + *) + echo "Pre-built binary not available for your os" + exit 1 + ;; + esac + + cpu=`uname -m` + cpu=`echo $cpu | tr "[:upper:]" "[:lower:"]` + + case $cpu in + *amd*64* | *x86*64* ) ;; + *) + echo "Pre-built binary not available for your cpu" + exit 1 + ;; + esac +} + +getURL(){ + url="https://archive.org/download/grus-v0.1.0/grus-v0.1.0-$os-$cpu" +} + +printURL(){ + echo "You can get the Pre-built binary here:" + echo "$url" + echo + echo "Run these commands to install it on your device." + echo "# curl -L -o /usr/local/bin/grus $url" + echo "# chmod +x /usr/local/bin/grus" + echo + echo "This is sha256 hash for grus built for: $os $cpu" + case $os in + *openbsd* ) + echo "$openbsdH" + ;; + esac + echo + echo "Verify the hash by running sha256 on grus binary." + echo "$ sha256 /usr/local/bin/grus" +} + +echo "Grus v0.1.0" +echo +earlyCheck +getURL +printURL -- cgit 1.4.1-2-gfad0