forked from Kunagi/ilarkesto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-package.bsh
executable file
·97 lines (68 loc) · 1.84 KB
/
build-package.bsh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
SRC=`pwd`
# checking if in project dir
if [ ! -f "src/main/java/ilarkesto/Servers.java" ]
then
echo "$0: build must be started from the ilarkesto project dir"
exit 1
fi
echo "cleaning up"
rm -rf build/ilarkesto
rm -f build/ilarkesto.tbz
if [ $? != 0 ]; then exit 1; fi
echo "building main bash-scripts"
DEST_BIN=$SRC/build/ilarkesto/bin
mkdir -p $DEST_BIN
cd src/main/bash
for file in $( find . -name '*.bsh' )
do
file=${file#./}
filename=${file%.bsh}
echo " > ${filename}"
destfile=$DEST_BIN/$filename
cp $file $destfile
if [ $? != 0 ]; then exit 1; fi
done
#chown root:root $DEST_BIN/*
#if [ $? != 0 ]; then exit 1; fi
chmod 555 $DEST_BIN/*
if [ $? != 0 ]; then exit 1; fi
echo "building additional bash-Scripts"
DEST_TOOLS=$SRC/build/ilarkesto/tools
mkdir -p $DEST_TOOLS
cd $SRC/src/tools/bash
for file in $( find . -name '*.bsh' )
do
file=${file#./}
filename=${file%.bsh}
echo " > ${filename}"
destfile=$DEST_TOOLS/$filename
cp $file $destfile
if [ $? != 0 ]; then exit 1; fi
done
#chown root:root $DEST_TOOLS/*
#if [ $? != 0 ]; then exit 1; fi
chmod 555 $DEST_TOOLS/*
if [ $? != 0 ]; then exit 1; fi
echo "building bashrc-includes"
DEST_BASHRC=$SRC/build/ilarkesto/bashrc
mkdir -p $DEST_BASHRC
cp $SRC/src/main/bashrc/* $DEST_BASHRC
if [ $? != 0 ]; then exit 1; fi
#chown root:root $DEST_BASHRC/*
#if [ $? != 0 ]; then exit 1; fi
chmod 444 $DEST_BASHRC/*
if [ $? != 0 ]; then exit 1; fi
echo "building images"
mkdir -p $SRC/build/ilarkesto/img
cp -r $SRC/img/* $SRC/build/ilarkesto/img
if [ $? != 0 ]; then exit 1; fi
mkdir -p $SRC/build/ilarkesto/jar
cp $SRC/build/ilarkesto.jar $SRC/build/ilarkesto/jar
chmod 444 $SRC/build/ilarkesto/jar/ilarkesto.jar
echo "building tarball"
cd $SRC/build
tar -cj --owner=root --group=root -f ilarkesto.tbz ilarkesto
if [ $? != 0 ]; then exit 1; fi
echo ""
echo "-> build/ilarkesto.tbz"