VirtualBox

source: vbox/trunk/src/VBox/Installer/solaris/makepackage.sh@ 8172

Last change on this file since 8172 was 8172, checked in by vboxsync, 17 years ago

rebranding

  • Property svn:eol-style set to LF
File size: 3.1 KB
Line 
1#!/bin/sh
2set -e
3# Sun xVM VirtualBox
4# VirtualBox Solaris package creation script.
5#
6# Copyright (C) 2007-2008 Sun Microsystems, Inc.
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
17# Clara, CA 95054 USA or visit http://www.sun.com if you need
18# additional information or have any questions.
19#
20
21#
22# Usage:
23# makespackage.sh $(PATH_TARGET)/install packagename $(BUILD_TARGET_ARCH)
24
25if [ -z "$3" ]; then
26 echo "Usage: $0 installdir packagename x86|amd64"
27 exit 1
28fi
29
30MY_PKGNAME=SUNWvbox
31MY_GGREP=/usr/sfw/bin/ggrep
32MY_AWK=/usr/bin/awk
33MY_GTAR=/usr/sfw/bin/gtar
34
35# check for GNU grep we use which might not ship with all Solaris
36if test ! -f "$MY_GGREP" && test ! -h "$MY_GGREP"; then
37 echo "## GNU grep not found in $MY_GGREP."
38 exit 1
39fi
40
41# check for GNU tar we use which might not ship with all Solaris
42if test ! -f "$MY_GTAR" && test ! -h "$MY_GTAR"; then
43 echo "## GNU tar not found in $MY_GTAR."
44 exit 1
45fi
46
47
48# prepare file list
49cd "$1"
50echo 'i pkginfo=./vbox.pkginfo' > prototype
51echo 'i postinstall=./postinstall.sh' >> prototype
52echo 'i preremove=./preremove.sh' >> prototype
53echo 'i space=./vbox.space' >> prototype
54echo 'e sed /etc/devlink.tab ? ? ?' >> prototype
55find . -print | $MY_GGREP -v -E 'prototype|makepackage.sh|vbox.pkginfo|postinstall.sh|preremove.sh|ReadMe.txt|vbox.space' | pkgproto >> prototype
56
57# don't grok for the sed class files
58$MY_AWK 'NF == 6 && $2 == "none" { $5 = "root"; $6 = "bin" } { print }' prototype > prototype2
59$MY_AWK 'NF == 6 && $2 == "none" { $3 = "opt/VirtualBox/"$3"="$3 } { print }' prototype2 > prototype
60
61# install the kernel module to the right place.
62if test "$3" = "x86"; then
63 $MY_AWK 'NF == 6 && $3 == "opt/VirtualBox/vboxdrv=vboxdrv" { $3 = "platform/i86pc/kernel/drv/vboxdrv=vboxdrv" } { print }' prototype > prototype2
64else
65 $MY_AWK 'NF == 6 && $3 == "opt/VirtualBox/vboxdrv=vboxdrv" { $3 = "platform/i86pc/kernel/drv/amd64/vboxdrv=vboxdrv" } { print }' prototype > prototype2
66fi
67
68$MY_AWK 'NF == 6 && $3 == "opt/VirtualBox/vboxdrv.conf=vboxdrv.conf" { $3 = "platform/i86pc/kernel/drv/vboxdrv.conf=vboxdrv.conf" } { print }' prototype2 > prototype
69
70rm prototype2
71
72# explicitly set timestamp to shutup warning
73VBOXPKG_TIMESTAMP=vbox`date '+%Y%m%d%H%M%S'`
74
75# create the package instance
76pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
77if test $? -ne 0; then
78 exit 1
79fi
80
81# translate into package datastream
82pkgtrans -s -o /var/spool/pkg `pwd`/$2 "$MY_PKGNAME"
83if test $? -ne 0; then
84 exit 1
85fi
86
87$MY_GTAR zcvf $2.tar.gz $2 autoresponse ReadMe.txt
88
89if test $? -eq 0; then
90 echo "## Packaging and transfer completed successfully!"
91fi
92rm -rf "/var/spool/pkg/$MY_PKGNAME"
93exit $?
94
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette