Skip to content

Instantly share code, notes, and snippets.

@spacelatte
Created October 12, 2019 18:50
Show Gist options
  • Save spacelatte/efb13955aed2fef610e5bec744aad416 to your computer and use it in GitHub Desktop.
Save spacelatte/efb13955aed2fef610e5bec744aad416 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
ORIG=$PWD
TEMP=$(mktemp -d)
curl -#L "https://www.ibiblio.org/pub/linux/games/amusements/fortune/fortune-mod-9708.tar.gz" \
| tar --strip=1 -C "${TEMP}" -ox
sed -i '' 's%/usr/local/games%/usr/local/bin%g' "${TEMP}/Makefile"
sed -i '' 's%/usr/local%$(PREFIX)%g' "${TEMP}/Makefile"
sed -i '' '1i\
PREFIX := /usr/local
' "${TEMP}/Makefile"
make -C "${TEMP}" \
PREFIX="${HOME}/.local" \
REGEXDEFS="-DHAVE_REGEX_H -DPOSIX_REGEX" \
clean install
rm -rf "${TEMP}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment