Skip to content

Instantly share code, notes, and snippets.

@perseoq
Created July 22, 2016 19:45
Show Gist options
  • Save perseoq/23989d82d03be05c5c76f5789a873eff to your computer and use it in GitHub Desktop.
Save perseoq/23989d82d03be05c5c76f5789a873eff to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
URL="https://github.com/gkovacs/pdfocr.git"
INSTALL_DIR="/opt/pdfocr"
INSTALL_PREFIX="/usr/local"
if ! type git > /dev/null 2>&1; then
echo "'git' is not found. Install it with the command below and try again"
echo
echo " $ sudo apt-get install git"
echo
exit 1
fi
echo "Installing required packages..."
sudo apt-get install ruby \
exactimage \
tesseract-ocr
sudo git clone $URL "$INSTALL_DIR"
sudo mkdir -p "$INSTALL_PREFIX/bin"
sudo mkdir -p "$INSTALL_PREFIX/share/man/man1"
sudo ln -sf "$INSTALL_DIR/pdfocr.rb" "$INSTALL_PREFIX/bin/pdfocr"
sudo ln -sf "$INSTALL_DIR/pdfocr.1" "$INSTALL_PREFIX/share/man/man1/pdfocr.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment