forked from inet-framework/inet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakedist
executable file
·68 lines (53 loc) · 2.74 KB
/
makedist
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
#!/bin/sh
# before running this script:
# 1. build the INET documentation from the IDE:
# * be sure to switch off auto linking (i.e. enable tilde linking)
# * enable ALL features in the project properties dialog
# * be sure to have a 72DPI screen when generating the sources
# * after building the documentation grep for 'class="error"' in the neddoc
# folder to be sure that there are no broken tilde links
# 2. build the inet manual and copy the generated PDF file to the doc directory.
cd `dirname $0`/.. || { echo --- error changing to the inet root directory ---; exit 1;}
INET_ROOT=`pwd`
VERSION=`$INET_ROOT/_scripts/get_version` || exit 1
echo "INET Version: $VERSION"
if [ "$BUILDID" = "" ]; then
# generate our own build identifier
export BUILDDATE=`date +%Y%m%d`
export BUILDHASH=`git describe --tags --long | awk -F '-g' '{print $2;}'`
export BUILDID="$VERSION-$BUILDHASH"
fi
FILENAME=$INET_ROOT/inet-$BUILDID-src.tgz
DIRNAME=inet
rm -rf $INET_ROOT/out/$DIRNAME
mkdir -p $INET_ROOT/out/$DIRNAME
git checkout-index -a -f --prefix=$INET_ROOT/out/$DIRNAME/ || { echo --- error copying repo ---; exit 1;}
(cd showcases; git checkout-index -a -f --prefix=$INET_ROOT/out/$DIRNAME/showcases/ || { echo --- error copying showcases ---; exit 1;})
(cd tutorials; git checkout-index -a -f --prefix=$INET_ROOT/out/$DIRNAME/tutorials/ || { echo --- error copying tutorials ---; exit 1;})
echo "inet-$BUILDID" > $INET_ROOT/out/$DIRNAME/Version
# copying documentation
#cp -r doc/doxy $INET_ROOT/out/$DIRNAME/doc || { echo --- error copying generated docs ---; exit 1;}
#cp -r doc/neddoc $INET_ROOT/out/$DIRNAME/doc || { echo --- error copying generated docs ---; exit 1;}
#cp -r doc/index.html $INET_ROOT/out/$DIRNAME/doc || { echo --- error copying generated docs ---; exit 1;}
cp -r doc/inet-manual*.pdf $INET_ROOT/out/$DIRNAME/doc || { echo --- error copying generated docs ---; exit 1;}
# switch to the destination dir
cd $INET_ROOT/out/$DIRNAME
# patching files
perl -i -pe $REGEXPREPLACE s/##BUILDID##/$BUILDID/g doc/neddoc/overview.html
perl -i -pe $REGEXPREPLACE s/##BUILDID##/$BUILDID/g src/inet-index.ned
# cleanup
rm -rf _scripts obsolete doc/src
todofiles=`find . -name '__*'`
if [ "$todofiles" != "" ]; then
echo "Removing underscore files: $todofiles"
rm -rf $todofiles
fi
# clean up the showcase and tutorial dir and remove the website text and videos to reduce package size
(cd showcases && rm -rf docs _docs _config.yml start_local_server)
(cd tutorials && rm -rf *.md start_local_server _config.yml _data _includes _layouts etc */doc)
# pack and create tar.gz archives
echo Creating $FILENAME.
cd $INET_ROOT/out
rm -f $FILENAME
tar cfz $FILENAME $DIRNAME || { echo --- error creating INET-....tgz ---; exit 1;}
rm -rf $INET_ROOT/out/$DIRNAME