makepackage.sh revision 2872b8298aa68343cc843450f6035a94ab9d636a
ee29f83d0638dba8e0380d7f594fe2d726d9403cvboxsync# Sun xVM VirtualBox
0569fe99ac6ea5da1bf4775fe3523165ac39c030vboxsync# VirtualBox Solaris Guest Additions package creation script.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Copyright (C) 2008 Sun Microsystems, Inc.
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# available from http://www.virtualbox.org. This file is free software;
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# you can redistribute it and/or modify it under the terms of the GNU
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# General Public License (GPL) as published by the Free Software
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# additional information or have any questions.
3b58b08293698f7f081b5558c52e80741a4a6763vboxsync# makespackage.sh $(PATH_TARGET)/install packagename svnrev
3b58b08293698f7f081b5558c52e80741a4a6763vboxsyncif test -z "$3"; then
3b58b08293698f7f081b5558c52e80741a4a6763vboxsync echo "Usage: $0 installdir packagename svnrev"
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync# check for GNU grep we use which might not ship with all Solaris
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncif test ! -f "$VBOX_GGREP" && test ! -h "$VBOX_GGREP"; then
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync echo "## GNU grep not found in $VBOX_GGREP."
6e793fadebda53870ee54ac9dcdbe30d612f22b5vboxsync# bail out on non-zero exit status
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync# Fixup filelist using awk, the parameters must be in awk syntax
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync# params: filename condition action
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync "$VBOX_AWK" 'NF == 6 && '"$2"' { '"$3"' } { print }' "$1" > "tmp-$1"
1bfc7215a51c113dafd83953d96ab4897d2d3690vboxsync# prepare file list
f09a9ba0e70c09ac2c9728909fbf45cb7f81195dvboxsyncif test -f "./vboxguest.copyright"; then
f09a9ba0e70c09ac2c9728909fbf45cb7f81195dvboxsync echo 'i copyright=./vboxguest.copyright' >> prototype
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncfind . -print | $VBOX_GGREP -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh|vboxguest.space|vboxguest.copyright' | pkgproto >> prototype
cfd41a3683178a30bac4417128b4673806653797vboxsync# don't grok for the class files
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncfilelist_fixup prototype '$2 == "none"' '$5 = "root"; $6 = "bin"'
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncfilelist_fixup prototype '$2 == "none"' '$3 = "opt/VirtualBoxAdditions/"$3"="$3'
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync# VBoxService requires suid
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/VBoxService=VBoxService"' '$4 = "4755"'
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxService=amd64/VBoxService"' '$4 = "4755"'
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# 32-bit vboxguest
da6bcae46a663366ea0e6dc42ac221f327efd01fvboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest"' '$3 = "usr/kernel/drv/vboxguest=vboxguest"; $6="sys"'
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# 64-bit vboxguest
da6bcae46a663366ea0e6dc42ac221f327efd01fvboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/vboxguest=amd64/vboxguest"' '$3 = "usr/kernel/drv/amd64/vboxguest=amd64/vboxguest"; $6="sys"'
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# vboxguest module config file
da6bcae46a663366ea0e6dc42ac221f327efd01fvboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf"' '$3 = "usr/kernel/drv/vboxguest.conf=vboxguest.conf"'
2872b8298aa68343cc843450f6035a94ab9d636avboxsync# vboxfsmount binary (always 32-bit on combined package)
2872b8298aa68343cc843450f6035a94ab9d636avboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxfsmount=vboxfsmount"' '$3 = "etc/fs/vboxfs/mount=vboxfsmount"; $6="sys"'
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# this is required for amd64-specific package where we do not build 32-bit binaries
2872b8298aa68343cc843450f6035a94ab9d636avboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/vboxfsmount=vboxfsmount"' '$3 = "etc/fs/vboxfs/mount=amd64/vboxfsmount"; $6="sys"'
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncfilelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml"' '$3 = "var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml"'
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncecho " --- start of prototype ---"
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsyncecho " --- end of prototype --- "
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync# explicitly set timestamp to shutup warning
3b58b08293698f7f081b5558c52e80741a4a6763vboxsyncVBOXPKG_TIMESTAMP=vboxguest`date '+%Y%m%d%H%M%S'`_r$VBOX_SVN_REV
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync# create the package instance
1bfc7215a51c113dafd83953d96ab4897d2d3690vboxsync# translate into package datastream