make_package.sh 1.4 KB
Newer Older
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

CURPWD=$(pwd)
cd "$(dirname "$0")"
19
ROOTPATH=$(pwd)
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
20

21 22 23 24
os=$1
./get_nwjs.sh $os
if [ $? -ne 0 ]; then
    exit 1
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
25 26 27 28 29 30
fi

ID=agkyra-$(date +%s)
TMPDIR=/tmp/$ID
TMPAGKYRA=$TMPDIR/agkyra
mkdir -p $TMPAGKYRA
31
WHEELHOUSE=$TMPAGKYRA/wheelhouse
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
32

33 34 35
pip wheel . -w $WHEELHOUSE
if [ $? -ne 0 ]; then
    exit 1
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
36 37
fi

38 39 40 41 42 43 44 45 46
cd $WHEELHOUSE
for i in *; do unzip $i -d $TMPAGKYRA/lib; done
cd $TMPAGKYRA
rm -r $WHEELHOUSE

cp $ROOTPATH/COPYING $TMPAGKYRA
cp $ROOTPATH/README.md $TMPAGKYRA
cp $ROOTPATH/agkyra/scripts/gui.py $TMPAGKYRA/agkyra
cp $ROOTPATH/agkyra/scripts/cli.py $TMPAGKYRA/agkyra-cli
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
47 48

cd $TMPDIR
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
49 50 51 52 53 54
ARCHIVENAME=$CURPWD/agkyra-snapshot-${os}
if [[ "$os" =~ ^(linux64|linux32)$ ]]; then
    tar czf ${ARCHIVENAME}.tar.gz agkyra
else
    zip -r ${ARCHIVENAME}.zip agkyra
fi