1 | #!/bin/sh
|
---|
2 | # $Id$
|
---|
3 | ## @file
|
---|
4 | # Use this script in conjunction with snapshot-ose.sh
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox base platform packages, as
|
---|
11 | # available from https://www.virtualbox.org.
|
---|
12 | #
|
---|
13 | # This program is free software; you can redistribute it and/or
|
---|
14 | # modify it under the terms of the GNU General Public License
|
---|
15 | # as published by the Free Software Foundation, in version 3 of the
|
---|
16 | # License.
|
---|
17 | #
|
---|
18 | # This program is distributed in the hope that it will be useful, but
|
---|
19 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | # General Public License for more details.
|
---|
22 | #
|
---|
23 | # You should have received a copy of the GNU General Public License
|
---|
24 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 | #
|
---|
26 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
27 | #
|
---|
28 |
|
---|
29 | vboxdir=`pwd`
|
---|
30 | if [ ! -r "$vboxdir/Config.kmk" -o ! -r "$vboxdir/Doxyfile.Core" ]; then
|
---|
31 | echo "Is $vboxdir really a VBox tree?"
|
---|
32 | exit 1
|
---|
33 | fi
|
---|
34 | if [ -r "$vboxdir/src/VBox/RDP/server/server.cpp" ]; then
|
---|
35 | echo "Found RDP stuff, refused to build OSE tarball!"
|
---|
36 | exit 1
|
---|
37 | fi
|
---|
38 | vermajor=`grep "^VBOX_VERSION_MAJOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
39 | verminor=`grep "^VBOX_VERSION_MINOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
40 | verbuild=`grep "^VBOX_VERSION_BUILD *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
41 | verpre=`grep "^VBOX_VERSION_PRERELEASE *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
42 | verpub=`grep "^VBOX_BUILD_PUBLISHER *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
43 | verstr="$vermajor.$verminor.$verbuild"
|
---|
44 | [ -n "$verpre" ] && verstr="$verstr"_"$verpre"
|
---|
45 | [ -n "$verpub" ] && verstr="$verstr$verpub"
|
---|
46 | rootpath=`cd ..;pwd`
|
---|
47 | rootname="VirtualBox-$verstr"
|
---|
48 | if [ $# -eq 1 ]; then
|
---|
49 | tarballname="$1"
|
---|
50 | else
|
---|
51 | tarballname="$rootpath/$rootname.tar.bz2"
|
---|
52 | fi
|
---|
53 | rm -f "$rootpath/$rootname"
|
---|
54 | ln -s `basename "$vboxdir"` "$rootpath/$rootname"
|
---|
55 | if [ $? -ne 0 ]; then
|
---|
56 | echo "Cannot create root directory link!"
|
---|
57 | exit 1
|
---|
58 | fi
|
---|
59 | tar \
|
---|
60 | --create \
|
---|
61 | --bzip2 \
|
---|
62 | --dereference \
|
---|
63 | --owner 0 \
|
---|
64 | --group 0 \
|
---|
65 | --totals \
|
---|
66 | --exclude=.svn \
|
---|
67 | --exclude="$rootname/out" \
|
---|
68 | --exclude="$rootname/env.sh" \
|
---|
69 | --exclude="$rootname/configure.log" \
|
---|
70 | --exclude="$rootname/build.log" \
|
---|
71 | --exclude="$rootname/AutoConfig.kmk" \
|
---|
72 | --exclude="$rootname/LocalConfig.kmk" \
|
---|
73 | --exclude="$rootname/prebuild" \
|
---|
74 | --directory "$rootpath" \
|
---|
75 | --file "$tarballname" \
|
---|
76 | "$rootname"
|
---|
77 | echo "Successfully created $tarballname"
|
---|
78 | rm -f "$rootpath/$rootname"
|
---|