Skip to content

Instantly share code, notes, and snippets.

@blalor
Last active December 17, 2015 10:49
Show Gist options
  • Save blalor/5598122 to your computer and use it in GitHub Desktop.
Save blalor/5598122 to your computer and use it in GitHub Desktop.
Creates Debian packages for whisper, carbon, graphite-web. sources: * https://github.com/jbraeuer/graphite-debs
#! /bin/bash
#
# requires: fpm, python-pip
# gem install fpm
# apt-get install python-pip
#
set -e
BASE="$(readlink -f $(dirname "$0"))"
WORK="$BASE/work"
VERSION=0.9.10
clean() {
rm -rf "$WORK"
rm -f python*.deb
mkdir "$WORK"
}
package() {
cd "$WORK"
fpm -s python -t deb \
--python-package-name-prefix python2.7 \
--depends "python" \
-v $VERSION whisper
## python-install-bin avoids later jiggery pokery with PYTHONPATH and
## GRAPHITE_CONF_DIR environment variables when starting carbon-cache.py
fpm -s python -t deb \
--python-package-name-prefix python2.7 \
--python-install-bin /opt/graphite/bin \
--depends "python" \
--depends "python-twisted" \
--depends "python2.7-whisper" \
-v $VERSION carbon
## same thing with python-install-bin here; there's nothing of great use
## that should get installed to /usr/bin
fpm -s python -t deb \
--python-package-name-prefix python2.7 \
--python-install-bin /opt/graphite/bin \
--depends "python" \
--depends "python2.7-whisper" \
--depends "python-twisted" \
--depends "python-cairo" \
--depends "python-django" \
--depends "python-django-tagging" \
-v $VERSION graphite-web
}
install() {
echo "********************************************************************************"
echo "Find the .deb's here: $WORK"
echo ""
echo "To install:"
echo " sudo dpkg -i python*.deb"
echo " sudo apt-get -f install"
}
clean
package
install
## the non-standard paths seem to throw fpm off
## GRAPHITE_CONF_DIR=/opt/graphite/conf PYTHONPATH=/opt/graphite/lib /usr/bin/carbon-cache.py status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment