Last active
January 7, 2016 08:52
-
-
Save rgevaert/5ea816c4ad0ef2979f32 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 | |
version=$1 | |
maintainer="Rudy Gevaert <[email protected]>" | |
description="Kibana is webinterface for Elasticsearch. To recreate this package use https://gist.github.com/rgevaert/5ea816c4ad0ef2979f32" | |
if [ "$version" == "" ] | |
then | |
echo Usage: $0 version-number | |
exit | |
fi | |
file="kibana-${version}-linux-x64.tar.gz" | |
url="https://download.elastic.co/kibana/kibana/${file}" | |
temp=`mktemp -d` | |
cd $temp | |
cat > after-install <<EOF | |
#!/bin/sh | |
systemctl daemon-reload | |
EOF | |
chmod a+x after-install | |
mkdir install | |
cd install | |
mkdir -p opt etc/systemd/system | |
echo Building in `pwd` | |
cat > etc/systemd/system/kibana.service <<EOF | |
[Unit] | |
Description=Kibana 4 | |
[Service] | |
Type=simple | |
User=root | |
ExecStart=/opt/kibana/bin/kibana | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
wget $url | |
tar -xzf $file | |
mv kibana-${version}-linux-x64 opt/kibana | |
rm $file | |
cd | |
echo Creating Debian package in `pwd` | |
fpm -s dir \ | |
-t deb \ | |
-n kibana \ | |
-v $version \ | |
--iteration '1' \ | |
--license MIT \ | |
--description="${description}" \ | |
-a 'all' \ | |
--after-install $temp/after-install \ | |
--description 'Kibana is a web interface for Logstash.' \ | |
--url 'http://kibana.org' \ | |
--vendor 'Kibana.Org' \ | |
--maintainer "$maintainer" \ | |
-d 'ruby' \ | |
--deb-user 'root' \ | |
--deb-group 'root' \ | |
-C $temp/install \ | |
. | |
rm -fr $temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment