File: makerelease.sh

package info (click to toggle)
grantlee5 5.3.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,004 kB
  • sloc: cpp: 25,617; javascript: 6,043; python: 299; sh: 97; perl: 37; ruby: 24; makefile: 20
file content (80 lines) | stat: -rwxr-xr-x 2,142 bytes parent folder | download | duplicates (8)
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
#! /bin/bash

if [ -n "$1" ]
then
  version=$1
else
  echo "This script takes one required argument- a version string, and an optional argument for the tarball name fragment."
  exit
fi
if [ -n "$2" ]
then
  name_fragment=$2
else
  name_fragment=$1
fi

tempDir="/tmp/grantlee-release"

if [ ! -d "$tempDir" ]
then
  mkdir $tempDir
fi

echo Creating $tempDir/grantlee-$name_fragment.tar.gz

git archive --format=tar --prefix=grantlee-$name_fragment/ $version | gzip > $tempDir/grantlee-$name_fragment.tar.gz

rm -rf $tempDir/grantlee-$name_fragment/
echo Unpacking to $tempDir/grantlee-$name_fragment
tar -C $tempDir -xvf $tempDir/grantlee-$name_fragment.tar.gz

if [ "$?" -ne "0" ]
then
  echo "Error creating tar archive."
  exit
fi

oldDir=$PWD

echo Creating build directory
mkdir -p $tempDir/grantlee-$name_fragment/build && cd $tempDir/grantlee-$name_fragment/build

cp $oldDir/scripts/qttags.tag $tempDir/grantlee-$name_fragment/scripts
cp $oldDir/scripts/libstdc++.tag $tempDir/grantlee-$name_fragment/scripts
cp $oldDir/scripts/libstdc++-longnames.tag $tempDir/grantlee-$name_fragment/scripts

echo Building.
cmake -DCMAKE_INSTALL_PREFIX=../prefix ..
make && make install

echo "Testing"
make test
LC_ALL=de make test

echo Copying archive to $oldDir/grantlee-$name_fragment.tar.gz
cp $tempDir/grantlee-$name_fragment.tar.gz $oldDir

qch_version_string=`echo $name_fragment | sed 's/\.//g'`

echo "Creating Docs"
make docs
sed -i 's/at your option, any later version.<\/p>/at your option, any later version.<\/p>\
<p>A version of this documentation suitable for viewing in Qt Assistant is available <a href\=\"http:\/\/www.grantlee.org\/grantlee-'${qch_version_string}'.qch\">here<\/a>.<\/p>/' apidox/index.html

tar -czf $oldDir/apidox.tar.gz apidox

cp $tempDir/grantlee-$name_fragment/build/grantlee-$qch_version_string.qch $oldDir

make cccc
tar -czf $oldDir/cccc.tar.gz cccc

echo Building with Coverage
cmake -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_INSTALL_PREFIX=../prefix ..
make
make install
make coverage
tar -czf $oldDir/coverage.tar.gz coverage

cd $oldDir
gpg -u D02D6509 --detach-sign --armor grantlee-$name_fragment.tar.gz