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