-
Notifications
You must be signed in to change notification settings - Fork 4
/
make.sh
executable file
·83 lines (76 loc) · 1.86 KB
/
make.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
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
#!/bin/bash
WORKDIR=$PWD
SRCDIR=$WORKDIR/src
DISTDIR=$WORKDIR/dist
BUILDDIR=$WORKDIR/build
TEMPLATEDIR=$WORKDIR/template
TMPZIP=$BUILDDIR/tmp.zip
# initial cleanup
mkdir -p $DISTDIR
mkdir -p $BUILDDIR
rm -rf $DISTDIR/*
rm -rf $BUILDDIR/*
# loop over all target
for TARGET in "runGen" "buildGen" "runAthena" "buildJob" "runHPO"
do
echo "Start " $TARGET
EXESRCDIR=$SRCDIR/`echo $TARGET | tr "[A-Z]" "[a-z]"`
EXENAME=$DISTDIR/$TARGET-`cat $EXESRCDIR/version`
rm -f $TMPZIP
# include utils
zip -o $TMPZIP -R pandawnutil "*.py" "*.c"
# script main
cd $EXESRCDIR
zip -o $TMPZIP -R . "*.py"
cd $WORKDIR
# make self-exracting executable
cat $TEMPLATEDIR/zipheader $TMPZIP > $EXENAME
chmod +x $EXENAME
echo
done
# include non-python files
for TARGET in "runMerge"
do
echo "Start " $TARGET
EXESRCDIR=$SRCDIR/`echo $TARGET | tr "[A-Z]" "[a-z]"`
EXENAME=$DISTDIR/$TARGET-`cat $EXESRCDIR/version`
rm -f $TMPZIP
# include utils
zip -o $TMPZIP -r pandawnutil -i "*.py" "*.c"
# script main
cd $EXESRCDIR
zip -o $TMPZIP -r . -i *
cd $WORKDIR
# make self-exracting executable
cat $TEMPLATEDIR/zipheader $TMPZIP > $EXENAME
chmod +x $EXENAME
echo
done
# include non-python files with CVMFS setup
for TARGET in "preGoodRunList"
do
echo "Start " $TARGET
EXESRCDIR=$SRCDIR/`echo $TARGET | tr "[A-Z]" "[a-z]"`
EXENAME=$DISTDIR/$TARGET-`cat $EXESRCDIR/version`
rm -f $TMPZIP
# include utils
zip -o $TMPZIP -r pandawnutil -i "*.py" "*.c"
# script main
cd $EXESRCDIR
zip -o $TMPZIP -r . -i *
cd $WORKDIR
# make self-exracting executable
cat $TEMPLATEDIR/zipheaderCVMFS $TMPZIP > $EXENAME
chmod +x $EXENAME
echo
done
# just copy
for TARGET in "runcontainer"
do
echo "Start " $TARGET
EXESRCDIR=$SRCDIR/`echo $TARGET | tr "[A-Z]" "[a-z]"`
EXENAME=$DISTDIR/$TARGET
cp $EXESRCDIR/$TARGET $EXENAME
chmod +x $EXENAME
echo
done