make_release_packages revision 46
1194N/A#! /bin/sh
1194N/A#
1194N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1194N/A#
1194N/A# Permission is hereby granted, free of charge, to any person obtaining a
1194N/A# copy of this software and associated documentation files (the
1194N/A# "Software"), to deal in the Software without restriction, including
1194N/A# without limitation the rights to use, copy, modify, merge, publish,
1194N/A# distribute, and/or sell copies of the Software, and to permit persons
1194N/A# to whom the Software is furnished to do so, provided that the above
1194N/A# copyright notice(s) and this permission notice appear in all copies of
1194N/A# the Software and that both the above copyright notice(s) and this
1194N/A# permission notice appear in supporting documentation.
1194N/A#
1194N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1194N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1194N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1194N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1220N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1194N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1194N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1194N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1194N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1194N/A#
1194N/A# Except as contained in this notice, the name of a copyright holder
1194N/A# shall not be used in advertising or otherwise to promote the sale, use
1194N/A# or other dealings in this Software without prior written authorization
1194N/A# of the copyright holder.
1194N/A#
1195N/A# @(#)make_release_packages 1.45 08/04/06 06/08/04
1195N/A#
1194N/A# Create and fill a package staging area for X
1194N/A#
1194N/A# This script should be run from the base of the build tree.
1194N/A# It takes no parameters.
1194N/A#
1194N/A# Example:
1194N/A# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
1194N/A# ./make_release_packages
1194N/A#
1194N/A# To build a subset of packages
1194N/A# env PACKAGE_LIST="packages" ./make_release_packages
1194N/A#
1194N/A
1194N/A# Make sure that we aren't affected by the personal environment of
1194N/A# whoever is running this script
1194N/APATH=/opt/SUNWspro/bin:/opt/SUNWguide/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:.
1194N/ASHELL=/bin/sh
1194N/A
1194N/AMACH=`uname -p`
1194N/ADATE=`date +0.%Y.%m.%d`
1194N/A
1194N/A# List of official (deliverable) X-window packages
1194N/AXW_PACKAGE_LIST="SUNWxwcft SUNWxwdem SUNWxwdim SUNWxwfs SUNWxwinc \
1194N/A SUNWxwice SUNWxwopt SUNWxwpmn SUNWxwsrc SUNWxwacx SUNWxwdxm \
1194N/A SUNWxwhl SUNWi1of SUNWxwfa SUNWxwpft SUNWxwsrv SUNWxwoft \
1194N/A SUNWfontconfig SUNWfontconfig-root SUNWfontconfig-docs SUNWxwsvr \
1194N/A SUNWxscreensaver-hacks SUNWfreetype2 SUNWxwxft SUNWxwfsw \
1194N/A SUNWxprint-server"
1194N/A
1194N/A# L10N packages are normally only built on sparc since they only have text
1194N/A# files that are the same for both platforms
1194N/Aif [ "$MACH" = "sparc" -o "x$BUILD_L10N" = "xyes" ]; then
1194N/A XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn SUNW0xwfa SUNW0xwplt \
1194N/A SUNW0xwopt SUNW0xwsvr"
1194N/Aelse
1194N/A XW_L10N_PACKAGES=" "
1194N/Afi
1194N/A
1194N/A# Which platform name do we use for 64-bit?
1194N/Aif [ "$MACH" = "sparc" ]; then
1194N/A PLAT_64="sparcv9"
1194N/Aelse
1194N/A if [ "$MACH" = "i386" ]; then
1194N/A PLAT_64="amd64"
1194N/A else
1194N/A echo "Unknown architecture - not SPARC nor i386."
1194N/A exit 1
1194N/A fi
1194N/Afi
1194N/A
1194N/A#
1194N/A# Trusted Extensions packages do not get built by default.
1194N/A# export BUILD_XTSOL=yes and run this script to build
1194N/A#
1194N/Aif [ x$BUILD_XTSOL = xyes ] ; then
1194N/A TSOL_PACKAGE="SUNWxwts"
1195N/Afi
1195N/A
1195N/A# Packages with platform-specific prototype files, including those with
1195N/A# 64-bit libraries
1195N/AXW_PLT_PACKAGE="SUNWxwplt SUNWxwplr SUNWxwfnt SUNWxwrtl SUNWxwslb \
1195N/A SUNWxwmod SUNWxscreensaver-hacks-gl SUNWxwman \
1195N/A SUNWxsun-server SUNWxsun-keytables $TSOL_PACKAGE"
1195N/A
1195N/A# Some packages are only built for sparc currently
1195N/Aif [ "$MACH" = "sparc" ]; then
1195N/A XW_PLT_PACKAGE="$XW_PLT_PACKAGE SUNWxwpsr"
1195N/Afi
1195N/A
1195N/AEXTRA_PACKAGES=" "
1195N/A
1195N/A# To build a subset of packages
1195N/A# PACKAGE_LIST="packages" make_release_packages
1195N/A#
1195N/A: ${PACKAGE_LIST:="$XW_PACKAGE_LIST $XW_PLT_PACKAGE $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
1195N/A
1194N/A: ${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