VirtualBox

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

Last change on this file since 24345 was 21475, checked in by vboxsync, 15 years ago

Solaris/Additions: fixed OpenGL to work again.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1#!/bin/sh
2# Sun VirtualBox
3# VirtualBox Solaris Guest Additions package creation script.
4#
5# Copyright (C) 2008-2009 Sun Microsystems, Inc.
6#
7# This file is part of VirtualBox Open Source Edition (OSE), as
8# available from http://www.virtualbox.org. This file is free software;
9# you can redistribute it and/or modify it under the terms of the GNU
10# General Public License (GPL) as published by the Free Software
11# Foundation, in version 2 as it comes in the "COPYING" file of the
12# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14#
15# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
16# Clara, CA 95054 USA or visit http://www.sun.com if you need
17# additional information or have any questions.
18#
19
20#
21# Usage:
22# makespackage.sh $(PATH_TARGET)/install packagename svnrev
23
24if test -z "$3"; then
25 echo "Usage: $0 installdir packagename svnrev"
26 exit 1
27fi
28
29VBOX_INSTALLED_DIR=$1
30VBOX_PKGFILENAME=$2
31VBOX_SVN_REV=$3
32
33VBOX_PKGNAME=SUNWvboxguest
34VBOX_AWK=/usr/bin/awk
35VBOX_GGREP=/usr/sfw/bin/ggrep
36VBOX_AWK=/usr/bin/awk
37
38# check for GNU grep we use which might not ship with all Solaris
39if test ! -f "$VBOX_GGREP" && test ! -h "$VBOX_GGREP"; then
40 echo "## GNU grep not found in $VBOX_GGREP."
41 exit 1
42fi
43
44# bail out on non-zero exit status
45set -e
46
47# Fixup filelist using awk, the parameters must be in awk syntax
48# params: filename condition action
49filelist_fixup()
50{
51 "$VBOX_AWK" 'NF == 6 && '"$2"' { '"$3"' } { print }' "$1" > "tmp-$1"
52 mv -f "tmp-$1" "$1"
53}
54
55# prepare file list
56cd "$VBOX_INSTALLED_DIR"
57echo 'i pkginfo=./vboxguest.pkginfo' > prototype
58echo 'i postinstall=./postinstall.sh' >> prototype
59echo 'i preremove=./preremove.sh' >> prototype
60echo 'i space=./vboxguest.space' >> prototype
61echo 'i depend=./vboxguest.depend' >> prototype
62if test -f "./vboxguest.copyright"; then
63 echo 'i copyright=./vboxguest.copyright' >> prototype
64fi
65find . -print | $VBOX_GGREP -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh|vboxguest.space|vboxguest.depend|vboxguest.copyright' | pkgproto >> prototype
66
67# don't grok for the class files
68filelist_fixup prototype '$2 == "none"' '$5 = "root"; $6 = "bin"'
69filelist_fixup prototype '$2 == "none"' '$3 = "opt/VirtualBoxAdditions/"$3"="$3'
70
71# VBoxService requires suid
72filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxService=VBoxService"' '$4 = "4755"'
73filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxService=amd64/VBoxService"' '$4 = "4755"'
74
75# 32-bit vboxguest
76filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest"' '$3 = "usr/kernel/drv/vboxguest=vboxguest"; $6="sys"'
77
78# 64-bit vboxguest
79filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/vboxguest=amd64/vboxguest"' '$3 = "usr/kernel/drv/amd64/vboxguest=amd64/vboxguest"; $6="sys"'
80
81# vboxguest module config file
82filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf"' '$3 = "usr/kernel/drv/vboxguest.conf=vboxguest.conf"'
83
84# vboxfsmount binary (always 32-bit on combined package)
85filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxfsmount=vboxfsmount"' '$3 = "etc/fs/vboxfs/mount=vboxfsmount"; $6="sys"'
86
87# this is required for amd64-specific package where we do not build 32-bit binaries
88filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/vboxfsmount=amd64/vboxfsmount"' '$3 = "etc/fs/vboxfs/mount=amd64/vboxfsmount"; $6="sys"'
89
90# crogl 32-bit opengl fixup
91filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGL.so=VBoxOGL.so"' '$3 = "usr/lib/VBoxOGL.so=VBoxOGL.so"; $6="sys"'
92filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLcrutil.so=VBoxOGLcrutil.so"' '$3 = "usr/lib/VBoxOGLcrutil.so=VBoxOGLcrutil.so"; $6="sys"'
93filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLfeedbackspu.so=VBoxOGLfeedbackspu.so"' '$3 = "usr/lib/VBoxOGLfeedbackspu.so=VBoxOGLfeedbackspu.so"; $6="sys"'
94filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLpassthroughspu.so=VBoxOGLpassthroughspu.so"' '$3 = "usr/lib/VBoxOGLpassthroughspu.so=VBoxOGLpassthroughspu.so"; $6="sys"'
95filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLarrayspu.so=VBoxOGLarrayspu.so"' '$3 = "usr/lib/VBoxOGLarrayspu.so=VBoxOGLarrayspu.so"; $6="sys"'
96filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLerrorspu.so=VBoxOGLerrorspu.so"' '$3 = "usr/lib/VBoxOGLerrorspu.so=VBoxOGLerrorspu.so"; $6="sys"'
97filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxOGLpackspu.so=VBoxOGLpackspu.so"' '$3 = "usr/lib/VBoxOGLpackspu.so=VBoxOGLpackspu.so"; $6="sys"'
98
99# crogl 64-bit opengl fixup
100filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGL.so=amd64/VBoxOGL.so"' '$3 = "usr/lib/amd64/VBoxOGL.so=amd64/VBoxOGL.so"; $6="sys"'
101filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLcrutil.so=amd64/VBoxOGLcrutil.so"' '$3 = "usr/lib/amd64/VBoxOGLcrutil.so=amd64/VBoxOGLcrutil.so"; $6="sys"'
102filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLfeedbackspu.so=amd64/VBoxOGLfeedbackspu.so"' '$3 = "usr/lib/amd64/VBoxOGLfeedbackspu.so=amd64/VBoxOGLfeedbackspu.so"; $6="sys"'
103filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLpassthroughspu.so=amd64/VBoxOGLpassthroughspu.so"' '$3 = "usr/lib/amd64/VBoxOGLpassthroughspu.so=amd64/VBoxOGLpassthroughspu.so"; $6="sys"'
104filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLarrayspu.so=amd64/VBoxOGLarrayspu.so"' '$3 = "usr/lib/amd64/VBoxOGLarrayspu.so=amd64/VBoxOGLarrayspu.so"; $6="sys"'
105filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLerrorspu.so=amd64/VBoxOGLerrorspu.so"' '$3 = "usr/lib/amd64/VBoxOGLerrorspu.so=amd64/VBoxOGLerrorspu.so"; $6="sys"'
106filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxOGLpackspu.so=amd64/VBoxOGLpackspu.so"' '$3 = "usr/lib/amd64/VBoxOGLpackspu.so=amd64/VBoxOGLpackspu.so"; $6="sys"'
107
108
109filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml"' '$3 = "var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml"'
110echo " --- start of prototype ---"
111cat prototype
112echo " --- end of prototype --- "
113
114# explicitly set timestamp to shutup warning
115VBOXPKG_TIMESTAMP=vboxguest`date '+%Y%m%d%H%M%S'`_r$VBOX_SVN_REV
116
117# create the package instance
118pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
119
120# translate into package datastream
121pkgtrans -s -o /var/spool/pkg `pwd`/$VBOX_PKGFILENAME "$VBOX_PKGNAME"
122
123rm -rf "/var/spool/pkg/$VBOX_PKGNAME"
124exit $?
125
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