@@ -1,65 +1,65 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | CHARTS_TEMP_DIR=temp_dir |
|
4 | 4 | CHARTS_TEMP_DIR_FULL=../$CHARTS_TEMP_DIR |
|
5 | 5 | |
|
6 | 6 | if [ "$1" = "" ] |
|
7 | 7 | then |
|
8 | 8 | echo Usage: $0 version [branch or SHA] |
|
9 | 9 | echo Branch defaults to master. |
|
10 | 10 | echo Creates the package in parent dir. |
|
11 | 11 | echo A temporary dir $CHARTS_TEMP_DIR_FULL is utilized for intermediate steps. |
|
12 | 12 | fi |
|
13 | 13 | |
|
14 | 14 | if [ "$2" = "" ] |
|
15 | 15 | then |
|
16 | 16 | CHARTS_BRANCH=origin/master |
|
17 | 17 | else |
|
18 | 18 | CHARTS_BRANCH=$2 |
|
19 | 19 | fi |
|
20 | 20 | |
|
21 | 21 | CHARTS_VERSION=$1 |
|
22 | 22 | CHARTS_CURRENT_DIR=$PWD |
|
23 | 23 | CHARTS_BUILD_DIR=$CHARTS_TEMP_DIR_FULL/tempbuild |
|
24 |
CHARTS_PACKAGE_UNTAR_NAME=qtcharts |
|
|
24 | CHARTS_PACKAGE_UNTAR_NAME=qtcharts-$CHARTS_VERSION | |
|
25 | 25 | CHARTS_PACKAGE_UNTAR_DIR=$CHARTS_TEMP_DIR_FULL/$CHARTS_PACKAGE_UNTAR_NAME |
|
26 | 26 | CHARTS_TEMP_TAR=qtcharts_temp_$CHARTS_VERSION.tar |
|
27 | 27 | CHARTS_TEMP_TAR_FULL=$CHARTS_TEMP_DIR_FULL/$CHARTS_TEMP_TAR |
|
28 | 28 | CHARTS_FINAL_TAR=$CHARTS_CURRENT_DIR/../qt-enterprise-charts-src-$CHARTS_VERSION.tar |
|
29 | 29 | |
|
30 | 30 | echo Exporting $CHARTS_BRANCH to $CHARTS_TEMP_TAR_FULL... |
|
31 | 31 | rm -r -f $CHARTS_TEMP_DIR_FULL 2> /dev/null |
|
32 | 32 | mkdir -p $CHARTS_TEMP_DIR_FULL 2> /dev/null |
|
33 | 33 | git fetch |
|
34 | 34 | git archive --format tar --output $CHARTS_TEMP_TAR_FULL $CHARTS_BRANCH |
|
35 | 35 | |
|
36 | 36 | echo Unpacking $CHARTS_TEMP_TAR_FULL to $CHARTS_PACKAGE_UNTAR_DIR and $CHARTS_BUILD_DIR... |
|
37 | 37 | mkdir -p $CHARTS_PACKAGE_UNTAR_DIR 2> /dev/null |
|
38 | 38 | mkdir -p $CHARTS_BUILD_DIR 2> /dev/null |
|
39 | 39 | tar -xvf $CHARTS_TEMP_TAR_FULL -C $CHARTS_PACKAGE_UNTAR_DIR > /dev/null |
|
40 | 40 | tar -xvf $CHARTS_TEMP_TAR_FULL -C $CHARTS_BUILD_DIR > /dev/null |
|
41 | 41 | #Workaround for git archive bug |
|
42 | 42 | rm -r -f $CHARTS_PACKAGE_UNTAR_DIR/tools |
|
43 | 43 | rm -r -f $CHARTS_PACKAGE_UNTAR_DIR/tests |
|
44 | 44 | rm -r -f $CHARTS_BUILD_DIR/tools |
|
45 | 45 | rm -r -f $CHARTS_BUILD_DIR/tests |
|
46 | 46 | |
|
47 | 47 | echo Generating includes, mkspecs, and docs in $CHARTS_BUILD_DIR... |
|
48 | 48 | cd $CHARTS_BUILD_DIR |
|
49 | 49 | mkdir -p .git 2> /dev/null |
|
50 | 50 | qmake > /dev/null 2> /dev/null |
|
51 | 51 | make docs > /dev/null 2> /dev/null |
|
52 | 52 | cd $CHARTS_CURRENT_DIR |
|
53 | 53 | |
|
54 | 54 | echo Copying generated files to $CHARTS_PACKAGE_UNTAR_DIR |
|
55 | 55 | cp -r $CHARTS_BUILD_DIR/doc/qch $CHARTS_PACKAGE_UNTAR_DIR/doc/qch |
|
56 | 56 | cp -r $CHARTS_BUILD_DIR/doc/html $CHARTS_PACKAGE_UNTAR_DIR/doc/html |
|
57 | 57 | |
|
58 | 58 | echo Repackaging $CHARTS_PACKAGE_UNTAR_DIR to $CHARTS_FINAL_TAR |
|
59 | 59 | rm $CHARTS_FINAL_TAR 2> /dev/null |
|
60 | 60 | cd $CHARTS_TEMP_DIR_FULL |
|
61 | 61 | tar -cvf $CHARTS_FINAL_TAR $CHARTS_PACKAGE_UNTAR_NAME >/dev/null |
|
62 | 62 | gzip $CHARTS_FINAL_TAR >/dev/null |
|
63 | 63 | cd $CHARTS_CURRENT_DIR |
|
64 | 64 | |
|
65 | 65 | exit 0 |
General Comments 0
You need to be logged in to leave comments.
Login now