Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasschaert/8464573 to your computer and use it in GitHub Desktop.
Save rasschaert/8464573 to your computer and use it in GitHub Desktop.
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