Skip to content

Instantly share code, notes, and snippets.

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.
echo 'Downloading pre-built binaries'
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