Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates an RPM package for NSQ (distributed messaging platform written in Golang). Tested on CentOS 6 x86_64 with EPEL and Golang 1.2.
#!/bin/bash
echo 'Downloading pre-built binaries'
wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Extracting archive'
tar xzf nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Creating correct directory structure'
mkdir -p nsq-0.2.24.linux-amd64.go1.2/usr/local/
mv nsq-0.2.24.linux-amd64.go1.2/{bin,share} nsq-0.2.24.linux-amd64.go1.2/usr/local/
echo 'Building package with fpm'
fpm -s dir -t rpm -n nsq -v 0.2.24 --iteration 'go1.2' -a x86_64 -C nsq-0.2.24.linux-amd64.go1.2 .
echo 'Cleaning up'
rm -rf nsq-0.2.24.linux-amd64.go1.2
rm nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.