Skip to content

Instantly share code, notes, and snippets.

@nbrownus
Created July 13, 2015 18:20
Show Gist options
  • Save nbrownus/61fe1169508f0232d41b to your computer and use it in GitHub Desktop.
Save nbrownus/61fe1169508f0232d41b to your computer and use it in GitHub Desktop.
#!/bin/sh
# sudo pip install --egg SCons
PACKAGE="statsite"
VERSION="0.7.1"
BUILD="slack1"
set -e -x
DIRNAME="$(cd "$(dirname "$0")" && pwd)"
OLDESTPWD="$PWD"
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
curl -LO "https://github.com/armon/statsite/archive/v$VERSION.tar.gz"
/bin/tar -xvf "v$VERSION.tar.gz"
cd "$PACKAGE-$VERSION"
make
mkdir -p "rootfs/usr/local/bin" "rootfs/usr/local/lib/statsite"
cp "statsite" "rootfs/usr/local/bin/statsite"
cp -R "sinks" "rootfs/usr/local/lib/statsite/"
fakeroot fpm -C "$PWD/rootfs" \
-m "Nate Brown <nate@slack-corp.com>" \
-n "$PACKAGE" -v "$VERSION-$BUILD" \
-p "$OLDESTPWD/${PACKAGE}_${VERSION}-${BUILD}_amd64.deb" \
-s "dir" -t "deb" \
"usr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment