-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-deb.sh
executable file
·47 lines (36 loc) · 1.25 KB
/
build-deb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# Authors: Jorge Espada <[email protected]> & Manuel Rubio <[email protected]>
#
# You need to have installed rubygems, fpm[0] gem (gem install fpm) and build-essential
# [0] https://github.com/jordansissel/fpm/wiki
USER=ebot
GROUP=ebot
INSTDIR=$(pwd)/installdir
FPM=$(gem which fpm | sed 's/\/lib\/fpm.rb/\/bin\/fpm/g')
TAG=$(git describe --always --tag)
if [ ! -z "$1" ]; then
TAG="$1"
fi
#check if gem and fpm are installed
echo "You must have rubygems, fpm, and build-essential installed..."
gem list --local | grep fpm
if [[ $? -ne 0 ]]; then
echo "Please verify the output of: gem list --local | grep fpm , remember you need tubygems and fpm installed"
exit 1
fi
#clean compile and make the package
rm -rf deps/*
rm -rf apps/*/logs
rm -rf apps/test/*.beam
rebar clean get-deps compile generate
if [[ $? -ne 0 ]]; then
echo "Please check dependencies, compelation went wrong"
exit 1
fi
rm -rf $INSTDIR
mkdir -p $INSTDIR/ebot
cp -a rel/ebot/* $INSTDIR/ebot
#build the package
pushd $INSTDIR
$FPM -s dir -t deb -n ebot -v $TAG -C $INSTDIR --description "Regular xmpp bot" -p ebot-VERSION_ARCH.deb --config-files ebot/etc/app.config --prefix /opt --deb-user $USER --deb-group $GROUP --maintainer '"Pepe" <[email protected]>' ebot