make_release_packages revision 235
1173N/A#! /bin/sh
2362N/A#
1173N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1173N/A#
1173N/A# Permission is hereby granted, free of charge, to any person obtaining a
1173N/A# copy of this software and associated documentation files (the
2362N/A# "Software"), to deal in the Software without restriction, including
1173N/A# without limitation the rights to use, copy, modify, merge, publish,
2362N/A# distribute, and/or sell copies of the Software, and to permit persons
1173N/A# to whom the Software is furnished to do so, provided that the above
1173N/A# copyright notice(s) and this permission notice appear in all copies of
1173N/A# the Software and that both the above copyright notice(s) and this
1173N/A# permission notice appear in supporting documentation.
1173N/A#
1173N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1173N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1173N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1173N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1173N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1173N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
2362N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2362N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2362N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1173N/A#
1173N/A# Except as contained in this notice, the name of a copyright holder
1173N/A# shall not be used in advertising or otherwise to promote the sale, use
1173N/A# or other dealings in this Software without prior written authorization
1173N/A# of the copyright holder.
1173N/A#
1173N/A# @(#)make_release_packages 1.54 07/10/10
1173N/A#
1173N/A# Create and fill a package staging area for X
1173N/A#
1173N/A# This script should be run from the base of the build tree.
1173N/A# It takes no parameters.
1173N/A#
1173N/A# Example:
1173N/A# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
1173N/A# ./make_release_packages
1173N/A#
1173N/A# To build a subset of packages
1173N/A# env PACKAGE_LIST="packages" ./make_release_packages
1173N/A#
1173N/A
1173N/A# Make sure that we aren't affected by the personal environment of
1173N/A# whoever is running this script
1173N/APATH=/opt/SUNWspro/bin:/opt/SUNWguide/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:.
3964N/ASHELL=/bin/sh
3964N/A
3964N/AMACH=`uname -p`
3964N/ADATE=`date +0.%Y.%m.%d`
3964N/A
3964N/A# List of official (deliverable) X-window packages
1173N/AXW_PACKAGE_LIST="SUNWxwcft SUNWxwdem SUNWxwdim SUNWxwfs SUNWxwinc \
3964N/A SUNWxwice SUNWxwopt SUNWxwpmn SUNWxwsrc SUNWxwacx SUNWxwdxm \
3964N/A SUNWxwhl SUNWi1of SUNWxwfa SUNWxwpft SUNWxwsrv SUNWxwoft \
3964N/A SUNWfontconfig SUNWfontconfig-root SUNWfontconfig-docs SUNWxwsvr \
1173N/A SUNWxscreensaver-hacks SUNWfreetype2 SUNWxwxft \
1173N/A SUNWxorg-clientlibs SUNWxorg-devel-docs SUNWxorg-headers \
1173N/A SUNWxorg-client-docs SUNWxorg-client-programs SUNWxorg-compatlinks \
1173N/A SUNWxprint-server SUNWxcursor-themes"
1173N/A
1173N/A# L10N packages are normally only built on sparc since they only have text
1173N/A# files that are the same for both platforms
1173N/Aif [ "$MACH" = "sparc" -o "x$BUILD_L10N" = "xyes" ]; then
1173N/A XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn SUNW0xwfa SUNW0xwplt \
1173N/A SUNW0xwopt SUNW0xwsvr"
1173N/Aelse
1173N/A XW_L10N_PACKAGES=" "
1173N/Afi
1173N/A
1173N/A# Which platform name do we use for 64-bit?
1173N/Aif [ "$MACH" = "sparc" ]; then
1173N/A PLAT_64="sparcv9"
1173N/Aelse
1173N/A if [ "$MACH" = "i386" ]; then
1173N/A PLAT_64="amd64"
1173N/A else
1173N/A echo "Unknown architecture - not SPARC nor i386."
1173N/A exit 1
1173N/A fi
1173N/Afi
1173N/A
1173N/A#
1173N/A# Trusted Extensions packages
1173N/A#
1173N/A
1173N/ATSOL_PACKAGE="SUNWxwts SUNWxorg-tsol-module"
1173N/A
1173N/A# Packages with platform-specific prototype files, including those with
1173N/A# 64-bit libraries
1173N/AXW_PLT_PACKAGE="SUNWxwplt SUNWxwplr SUNWxwfnt SUNWxwrtl SUNWxwslb \
1173N/A SUNWxwmod SUNWxscreensaver-hacks-gl SUNWxwman SUNWxwfsw \
1173N/A SUNWxorg-server SUNWxorg-graphics-ddx SUNWxorg-doc SUNWxorg-cfg \
1173N/A SUNWxsun-server SUNWxvnc $TSOL_PACKAGE"
1173N/A
1173N/A# Some packages are only built for certain platforms currently
1173N/Aif [ "$MACH" = "sparc" ]; then
1173N/A XW_PLT_PACKAGE="$XW_PLT_PACKAGE SUNWxwpsr"
1173N/Aelse
1173N/A XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
1173N/Afi
1173N/A
1173N/AEXTRA_PACKAGES=" "
1173N/A
1173N/A# To build a subset of packages
1173N/A# PACKAGE_LIST="packages" make_release_packages
#
: ${PACKAGE_LIST:="$XW_PACKAGE_LIST $XW_PLT_PACKAGE $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
: ${PACKAGE_DIR:=`pwd`/proto-packages}
SOURCEDIR=`pwd`
cd $SOURCEDIR/packages
# Get build version from pkgversion
if [ -f pkgversion ] ; then
. pkgversion
else
echo "Error: $SOURCEDIR/packages/pkgversion not found. Cannot continue."
exit 1
fi
if [ "x${VERSION}" = "x" ] ; then
echo "VERSION not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
exit 1
fi
if [ "x${BUILD}" = "x" ] ; then
echo "BUILD not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
exit 1
fi
DECIMAL_BUILD=`echo ${BUILD} | awk '{print $1 / 100.0}'`
echo "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
# Next, create the staging area. Make sure that the logs directory
# is writeable by everyone because it is likely that we will need to
# write into it as root across an NFS link...
#
echo 'Removing old proto-packages and recreating'
/bin/rm -rf $PACKAGE_DIR
/bin/mkdir $PACKAGE_DIR
/bin/mkdir $PACKAGE_DIR/logs
/bin/chmod a+w $PACKAGE_DIR/logs
# Now copy the package description info
echo 'Copying package descriptions'
# We can't just use `sccs get SCCS' because it will punt if it hits
# a file which is being edited (writeable).
#
for F in SCCS/s.*
do
/usr/ccs/bin/get -s $F
done
/bin/cp copyright depend i.* r.* $PACKAGE_DIR >/dev/null 2>&1
for package in $PACKAGE_LIST common_files
do
cd $package
# See above about sccs usage
for F in SCCS/s.*
do
/usr/ccs/bin/get $F >/dev/null 2>&1
done
/bin/mkdir $PACKAGE_DIR/$package
/bin/cp p* d* lib* i.* r.* M* $PACKAGE_DIR/$package >/dev/null 2>&1
# We keep the master copyright in the top-level copyright file
# Packages that need additional copyright have copyright.add files
# that we then merge here
if [ -f copyright.add ] ; then
cat ../copyright copyright.add > $PACKAGE_DIR/$package/copyright
else
cp ../copyright $PACKAGE_DIR/$package/copyright
fi
cd ..
done
# Now move into the package staging area and build the packages.
cd $PACKAGE_DIR
if [ "$MACH" = "sparc" ]; then
PROTODIR=$SOURCEDIR/proto-sun4-svr4
else
PROTODIR=$SOURCEDIR/proto-${MACH}-svr4
fi
for D in etc usr var lib ; do
/bin/rm -f $D
/bin/ln -s $PROTODIR/$D $D
done
for D in openwin dt sfw bin ; do
/bin/rm -f $D
/bin/ln -s $PROTODIR/usr/$D $D
done
LOGfile=logs/package_build
echo '---Building packages'
XW_PLT_PAT="`echo $XW_PLT_PACKAGE | tr ' ' '|'`"
# Variables to pass to pkgmk for use in prototype files
# They must start with lowercase letters to be resolved at pkgmk time
PKGMK_VARS="plat_64=${PLAT_64} plat=${MACH}"
for package in $PACKAGE_LIST
do
cd $package
date
echo "******** Making the $package package ********"
cat pkginfo.tmpl | sed -e '/ARCH/s/ISA/'$MACH'/' -e 's/SUNW_PRODVERS=.*$/SUNW_PRODVERS='${VERSION}/ -e 's/VERSION=.*$/VERSION='${VERSION}.${BUILD},REV=${DATE}/ > pkginfo
if [ -f Makefile ]; then
echo make all
/usr/ccs/bin/make SOURCEDIR=$SOURCEDIR/packages all
fi
eval "case $package in
$XW_PLT_PAT)
if [ ! -f prototype_$MACH ]; then
ln -s prototype_com prototype_$MACH
fi
echo /usr/bin/pkgmk -f prototype_$MACH -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
/usr/bin/pkgmk -f prototype_$MACH -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
;;
*)
echo /usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
/usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
;;
esac"
echo "******** Done Making the $package package ********"
cd ..
done >$LOGfile 2>&1
echo result log is in $PACKAGE_DIR/$LOGfile
printf "Packages built: "
grep -c "Packaging complete" $PACKAGE_DIR/$LOGfile
printf "Packages failed: "
grep -c "Packaging was not successful" $PACKAGE_DIR/$LOGfile
# Create an installdir with symlinks to SUNW* pkgs
cd $PACKAGE_DIR
mkdir installdir
cd installdir
ln -s ../SUNW*/SUNW* .
if [ -f $SOURCEDIR/packages/upgrade-X ] ; then
cp -p $SOURCEDIR/packages/upgrade-X .
chmod a+x upgrade-X
fi
exit