File: release.sh

package info (click to toggle)
wxpython4.0 4.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 221,752 kB
  • sloc: cpp: 962,555; python: 230,573; ansic: 170,731; makefile: 51,756; sh: 9,342; perl: 1,564; javascript: 584; php: 326; xml: 200
file content (85 lines) | stat: -rwxr-xr-x 2,089 bytes parent folder | download | duplicates (4)
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
84
85
#!/bin/sh
#
# This is the official script used to make wxWidgets releases.
#
# We use the git export features to track which files should be included in the
# distribution and we don't need to maintain the list of them ourselves but we
# also don't run the risk of including anything unwanted.
#
# See docs/contributing/how-to-release.md for usage instructions.

version=$1
if [ -z "$version" ]; then
    echo "Must specify the distribution version." >&2
    exit 1
fi

root="$(readlink -f $(dirname $(readlink -f $0))/../..)"
cd "$root"

if ! git diff --quiet; then
    echo "Working copy has modifications, commit or stash them." >&2
    exit 2
fi

set -e
set -x

prefix=wxWidgets-$version
destdir="$root/distrib/release/$version"

cleanup() {
    rm -rf $destdir/$prefix
}

trap cleanup INT TERM EXIT

cleanup

mkdir -p $destdir

# We use GNU tar -i option to allow successfully extracting files from several
# tar archives concatenated together, without it we'd have to pipe output of
# each git-archive separately.
(git archive --prefix=$prefix/ HEAD;
 git submodule foreach --quiet "cd $root/\$path && git archive --prefix=$prefix/\$path/ HEAD") |
tar x -C $destdir -i

cd $destdir

# Check that there are no symlinks because we don't handle them correctly
# under MSW systems currently.
if ! find . -type l -exec false {} + -quit; then
    set +x
    echo 'There are unexpected symlinks in the source tree:' >&2
    echo '' >& 2
    find . -type l -fprint /dev/stderr
    echo '' >& 2
    echo 'Please remove them or fix #22271.' >&2
    exit 2
fi

# Compile gettext catalogs.
make -C $prefix/locale -s MSGFMT=msgfmt allmo

tar cjf $prefix.tar.bz2 $prefix

cd $prefix

zip -q -r ../$prefix.zip .

7z a ../$prefix.7z . >/dev/null
7z a ../${prefix}-headers.7z include >/dev/null

# Build HTML documentation packages.
prefix_docs=$prefix-docs-html
cd "$root/docs/doxygen"
rm -rf out
./regen.sh html
cd out
mv html "$prefix_docs"
tar cjf "$destdir/$prefix_docs.tar.bz2" "$prefix_docs"
cd "$prefix_docs"
zip -q -r "$destdir/$prefix_docs.zip" .
cd "$root"
rm -rf "$root/docs/doxygen/out"