1 | #!/bin/sh
|
---|
2 | # $Id$
|
---|
3 | ## @file
|
---|
4 | # Use this script in conjunction with snapshot-ose.sh
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2006-2020 Oracle Corporation
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | # available from http://www.virtualbox.org. This file is free software;
|
---|
12 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | # General Public License (GPL) as published by the Free Software
|
---|
14 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | #
|
---|
18 |
|
---|
19 | vboxdir=`pwd`
|
---|
20 | if [ ! -r "$vboxdir/Config.kmk" -o ! -r "$vboxdir/Doxyfile.Core" ]; then
|
---|
21 | echo "Is $vboxdir really a VBox tree?"
|
---|
22 | exit 1
|
---|
23 | fi
|
---|
24 | if [ -r "$vboxdir/src/VBox/RDP/server/server.cpp" ]; then
|
---|
25 | echo "Found RDP stuff, refused to build OSE tarball!"
|
---|
26 | exit 1
|
---|
27 | fi
|
---|
28 | vermajor=`grep "^VBOX_VERSION_MAJOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
29 | verminor=`grep "^VBOX_VERSION_MINOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
30 | verbuild=`grep "^VBOX_VERSION_BUILD *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
31 | verpre=`grep "^VBOX_VERSION_PRERELEASE *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
32 | verpub=`grep "^VBOX_BUILD_PUBLISHER *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
33 | verstr="$vermajor.$verminor.$verbuild"
|
---|
34 | [ -n "$verpre" ] && verstr="$verstr"_"$verpre"
|
---|
35 | [ -n "$verpub" ] && verstr="$verstr$verpub"
|
---|
36 | rootpath=`cd ..;pwd`
|
---|
37 | rootname="VirtualBox-$verstr"
|
---|
38 | if [ $# -eq 1 ]; then
|
---|
39 | tarballname="$1"
|
---|
40 | else
|
---|
41 | tarballname="$rootpath/$rootname.tar.bz2"
|
---|
42 | fi
|
---|
43 | rm -f "$rootpath/$rootname"
|
---|
44 | ln -s `basename "$vboxdir"` "$rootpath/$rootname"
|
---|
45 | if [ $? -ne 0 ]; then
|
---|
46 | echo "Cannot create root directory link!"
|
---|
47 | exit 1
|
---|
48 | fi
|
---|
49 | tar \
|
---|
50 | --create \
|
---|
51 | --bzip2 \
|
---|
52 | --dereference \
|
---|
53 | --owner 0 \
|
---|
54 | --group 0 \
|
---|
55 | --totals \
|
---|
56 | --exclude=.svn \
|
---|
57 | --exclude="$rootname/out" \
|
---|
58 | --exclude="$rootname/env.sh" \
|
---|
59 | --exclude="$rootname/configure.log" \
|
---|
60 | --exclude="$rootname/build.log" \
|
---|
61 | --exclude="$rootname/AutoConfig.kmk" \
|
---|
62 | --exclude="$rootname/LocalConfig.kmk" \
|
---|
63 | --exclude="$rootname/prebuild" \
|
---|
64 | --directory "$rootpath" \
|
---|
65 | --file "$tarballname" \
|
---|
66 | "$rootname"
|
---|
67 | echo "Successfully created $tarballname"
|
---|
68 | rm -f "$rootpath/$rootname"
|
---|