-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create install script, that will replace ansible
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/zsh -e | ||
setopt pipefail | ||
|
||
cd "$(dirname "$0")" | ||
|
||
# We export PATH in case the variable is not exported yet | ||
export PATH | ||
|
||
# We add our own bins to the path, but agree to use the system or user-defined | ||
# ones if they are already there | ||
path+="$(pwd)/.cache/bin" | ||
|
||
# Create cache dir | ||
mkdir -p .cache | ||
chmod 700 .cache | ||
|
||
# Install ccrypt if needed | ||
command -v ccdecrypt >/dev/null 2>&1 || { | ||
echo "*** Downloading and compiling ccrypt in the .cache folder..." | ||
pushd .cache | ||
readonly CCRYPT_SHASUM="6d20a4db9ef7caeea6ce432f3cffadf10172e420" | ||
readonly CCRYPT_VERSION="1.11" | ||
readonly CCRYPT_BASENAME="ccrypt-$CCRYPT_VERSION" | ||
readonly CCRYPT_TAR_NAME="$CCRYPT_BASENAME.tar.gz" | ||
readonly CCRYPT_URL="http://ccrypt.sourceforge.net/download/$CCRYPT_VERSION/$CCRYPT_TAR_NAME" | ||
test -e "$CCRYPT_TAR_NAME" || curl "$CCRYPT_URL" >"$CCRYPT_TAR_NAME" | ||
test "$(shasum "$CCRYPT_TAR_NAME" | cut -d' ' -f1)" = "$CCRYPT_SHASUM" || { | ||
echo "***** ERROR: ccrypt sha does not match expected sha. Bailing out." | ||
exit 1 | ||
} | ||
tar xf "$CCRYPT_TAR_NAME" | ||
pushd "$CCRYPT_BASENAME" | ||
./configure --prefix "$(pwd)/.." | ||
make install | ||
popd | ||
rm -fr "$CCRYPT_BASENAME" | ||
popd | ||
} |
Empty file.