Skip to content

Instantly share code, notes, and snippets.

@wangjiezhe
Last active August 29, 2015 14:08
Show Gist options
  • Save wangjiezhe/caec794bf3f23f6aa50a to your computer and use it in GitHub Desktop.
Save wangjiezhe/caec794bf3f23f6aa50a to your computer and use it in GitHub Desktop.
Install command 'dog'
#!/usr/bin/env bash
set -e
PROXY="--proxy http://127.0.0.1:8087"
tmpdir=$(mktemp -t -d dog.XXXXXX)
cd $tmpdir
# curl -O $PROXY https://launchpad.net/ubuntu/+archive/primary/+files/dog_1.7.orig.tar.gz
# curl -O $PROXY https://launchpad.net/ubuntu/+archive/primary/+files/dog_1.7-8.diff.gz
echo "Downloading source file for dog ..."
curl -O $PROXY https://launchpadlibrarian.net/1213035/dog_1.7.orig.tar.gz
echo "Downloading patch file for dog..."
curl -O $PROXY https://launchpadlibrarian.net/5085932/dog_1.7-8.diff.gz
tar xf dog_1.7.orig.tar.gz
cd dog-1.7.orig
echo "Generating patch files ..."
patch -p1 -i ../dog_1.7-8.diff.gz || exit 1
for file in $(cat debian/patches/00list)
do
echo "Patching $file ..."
sh debian/patches/$file -patch
done
echo "Start making ..."
make clean
make
sudo make prefix=/usr/local install
echo "Installation succeed!"
rm -rf ${tmpdir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment