Created
May 22, 2013 15:19
-
-
Save piavlo/5628417 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# This script needs "fpm". If you dont have it, | |
# run "gem install fpm" | |
# | |
# You also need to "apt-get install python-setuptools" (otherwise fpm fails) | |
clean() { | |
rm -rf whisper-0.9.10 carbon-0.9.10 graphite-web-0.9.10 | |
rm -f python*.deb | |
} | |
download() { | |
[ -e graphite-web-0.9.10.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.10.tar.gz | |
[ -e carbon-0.9.10.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz | |
[ -e whisper-0.9.10.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz | |
[ -e txAMQP-0.6.1.tar.gz ] || wget https://pypi.python.org/packages/source/t/txAMQP/txAMQP-0.6.1.tar.gz | |
} | |
extract() { | |
tar -zxvf graphite-web-0.9.10.tar.gz | |
tar -zxvf carbon-0.9.10.tar.gz | |
tar -zxvf whisper-0.9.10.tar.gz | |
tar -zxvf txAMQP-0.6.1.tar.gz | |
} | |
package() { | |
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" txAMQP-0.6.1/setup.py | |
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" whisper-0.9.10/setup.py | |
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" \ | |
--depends "python-twisted" carbon-0.9.10/setup.py | |
fpm -s python -t deb -S 2.7 --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" \ | |
graphite-web-0.9.10/setup.py | |
} | |
### --depends "libapache2-mod-python" \ | |
install() { | |
sudo dpkg -i python*.deb | |
sudo apt-get -f install | |
} | |
user() { | |
user="graphite" | |
group="graphite" | |
if ! getent group "$group" > /dev/null 2>&1 ; then | |
addgroup --system "$group" | |
fi | |
if ! id "$user" > /dev/null 2>&1 ; then | |
adduser --system --home /opt/graphite \ | |
--ingroup "$group" --disabled-password \ | |
--shell /bin/false "$user" | |
fi | |
} | |
#download | |
#clean | |
#extract | |
#package | |
#install | |
for func in $*; do | |
[ "function" == "$(type -t $func)" ] && eval $func | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment