-
Notifications
You must be signed in to change notification settings - Fork 4
/
mktar
executable file
·67 lines (58 loc) · 1.53 KB
/
mktar
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
#!/bin/bash
#
# Script to make a release tarbal
PRGNAME=$(basename $0)
DESTDIR=$(pwd)
# OVerwrite callflow Version if callflow.version file is found
[[ -e callflow.version ]] && CALLFLOW_VERSION=$(cat callflow.version)
# Only include files that are known, any other file is to be ignored
FILES="CMakeLists.txt
callflow
conf/CMakeLists.txt
conf/callflow.conf
css/CMakeLists.txt
css/callflow.css
images/CMakeLists.txt
images/frame_bottom.png
images/frame_dynamic.png
images/frameless.png
images/frame_right.png
images/index.tpl
js/CMakeLists.txt
js/callflow.js
js/overlib.js
LICENSE
man/CMakeLists.txt
man/callflow.1
README.md
scripts/CMakeLists.txt
scripts/broadworks-parser.sh
scripts/callflow.awk
scripts/list-nodes.awk
scripts/long2html.awk
scripts/makevars.awk
scripts/marksession.awk
scripts/pcap-parser.sh
scripts/prunenodes.awk
scripts/removedups.sh"
# Verify location
FILE=$(echo "$FILES" | head -1)
[[ ! -f "$FILE" ]] && {
( echo "$PRGNAME: $FILE not found"
echo " might be in the wrong location"
) >&2
exit 1
}
TMPDIR=/tmp/$PRGNAME.$$
mkdir -p $TMPDIR/callflow-$CALLFLOW_VERSION
tar cf - $FILES | (cd $TMPDIR/callflow-$CALLFLOW_VERSION; tar xf - )
sed -i "s/\(PRGVRSN\)=.*/\1=$CALLFLOW_VERSION/" $TMPDIR/callflow-$CALLFLOW_VERSION/callflow
TARBAL=$DESTDIR/callflow-$CALLFLOW_VERSION.tar.bz2
( cd $TMPDIR; tar cjf $TARBAL callflow-$CALLFLOW_VERSION)
rm -rf "${TMPDIR:xxxxx}"
if [[ -f $TARBAL ]]; then
echo "$PRGNAME: tarbal stored at $TARBAL"
else
echo "$PRGNAME: tarbal $TARBAL not found,"
echo " something went awfully wrong!"
fi