forked from xmppjingle/jinglenodes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-deb.sh
executable file
·49 lines (38 loc) · 1.41 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
47
48
#!/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=jnode
GROUP=jnode
PROJECT=jinglenodes
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/*/.eunit
rm -rf apps/*/doc
rebar clean get-deps compile && rebar doc eunit skip_deps=true && rebar generate
if [[ $? -ne 0 ]]; then
echo "Please check dependencies, compilation went wrong"
exit 1
fi
rm -rf $INSTDIR
mkdir -p $INSTDIR/$PROJECT
cp -a rel/$PROJECT $INSTDIR/
#build the package
pushd $INSTDIR
$FPM -s dir -t deb -n $PROJECT -v $TAG -C $INSTDIR --description "JingleNodes Erlang Server" -p jinglenodes-VERSION_ARCH.deb --config-files /opt/$PROJECT/etc/app.config --prefix /opt --deb-user $USER --deb-group $GROUP --url http://www.yuilop.com/ --vendor Yuilop --maintainer '"Manuel Rubio" <[email protected]>' $PROJECT