-
Notifications
You must be signed in to change notification settings - Fork 5
/
make-package.sh
53 lines (40 loc) · 1.01 KB
/
make-package.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
49
50
51
52
53
#!/bin/bash
#
# make-package.sh
#
# Author: Eric Viara Institut Curie(c) copyright 2017
# Date: Jan 2017
#
set -e
topdir=$(pwd)
cd engine/src
package=$(make package | grep "^Package:" | awk '{print $2}')
packname=MaBoSS-env-$(echo $package | cut -d'-' -f2 | sed s/.tgz// )
packdir=/tmp/$packname
mkdir $packdir
trap "rm -r $packdir" 0 1 2 3
cd $packdir
tar xvfz $package
mv MaBoSS-*/ engine
rm engine/README
mkdir -p engine/pub
mv engine/binaries binaries
mv engine/doc doc
mv engine/examples examples
cd $topdir
cp MaBoSS.env README.md check-requirements.sh $packdir
set +e
find tools ! -name \*~ | grep -v "/\." | grep -v /doc/ | cpio -pdmv $packdir
cd $topdir/tools
find doc ! -name \*~ | egrep -v "/\.|\.docx|\.tex|\.ppt" | cpio -pdmv $packdir
cd $topdir
find tutorial ! -name \*~ | egrep -v "/\.|\.docx|\.tex|\.ppt" | cpio -pdmv $packdir
set -e
cd $packdir
rmdir tools/doc
cd /tmp
echo "${packname}"
tar cvfz $packname.tgz $packname
echo
echo "MaBoSS package: $package"
echo "MaBoSS-env package: /tmp/${packname}.tgz"