Skip to content

Instantly share code, notes, and snippets.

@mattpascoe
Created October 5, 2012 22:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mattpascoe/3842920 to your computer and use it in GitHub Desktop.
Save mattpascoe/3842920 to your computer and use it in GitHub Desktop.
Simple script to build deb packages from graphite master on github
#! /bin/bash
# Requires fpm v0.4.20 at least
#
# rm -rf carbon-latest* ceres-latest* graphite-web-latest* whisper-latest* *.deb;rm -rf /opt/graphite/;dpkg -r python-whisper python-graphite-web python-carbon python-ceres python-txamqp
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
# Then simply execute this script and it will create packages and install them on your system.
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-latest carbon-latest graphite-web-latest ceres-latest
rm -f python*.deb
mkdir whisper-latest carbon-latest graphite-web-latest ceres-latest
}
download() {
[ -e graphite-web-latest.tar.gz ] || wget https://github.com/graphite-project/graphite-web/tarball/master -O graphite-web-latest.tar.gz
[ -e carbon-latest.tar.gz ] || wget https://github.com/graphite-project/carbon/tarball/master -O carbon-latest.tar.gz
[ -e whisper-latest.tar.gz ] || wget https://github.com/graphite-project/whisper/tarball/master -O whisper-latest.tar.gz
[ -e ceres-latest.tar.gz ] || wget https://github.com/graphite-project/ceres/tarball/master -O ceres-latest.tar.gz
}
extract() {
tar --strip-components=1 -C ./graphite-web-latest -zxvf graphite-web-latest.tar.gz
tar --strip-components=1 -C ./carbon-latest -zxvf carbon-latest.tar.gz
tar --strip-components=1 -C ./whisper-latest -zxvf whisper-latest.tar.gz
tar --strip-components=1 -C ./ceres-latest -zxvf ceres-latest.tar.gz
}
package() {
#fpm -s python -t deb txamqp
fpm -s python -t deb --python-install-bin /opt/graphite/bin --depends "python" --depends "python-support" whisper-latest/setup.py
fpm -s python -t deb --python-install-bin /opt/graphite/bin --depends "python" --depends "python-support" ceres-latest/setup.py
fpm -s python -t deb --python-install-bin /opt/graphite/bin --depends "python" --depends "python-support" \
--depends "python-twisted" carbon-latest/setup.py
fpm -s python -t deb --python-install-bin /opt/graphite/bin --depends "python" --depends "python-support" \
--depends "python-twisted" \
--depends "python-cairo" \
--depends "python-django" \
--depends "python-django-tagging" \
--depends "python-ldap" \
--depends "python-memcache" \
--depends "python-pysqlite2" \
--depends "python-sqlite" \
--depends "libapache2-mod-python" \
--depends "libapache2-mod-wsgi" \
graphite-web-latest/setup.py
}
install() {
sudo dpkg -i python*.deb
sudo apt-get -f install
}
download
clean
extract
package
install
@bfritz
Copy link

bfritz commented Sep 16, 2013

Handy script. Thank you.

On Debian Wheezy (built minimally from debootstrap), I also needed dependencies on python-tz and python-pyparsing for graphite-web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment