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