make_release_packages revision 247
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Permission is hereby granted, free of charge, to any person obtaining a
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# copy of this software and associated documentation files (the
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# "Software"), to deal in the Software without restriction, including
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# without limitation the rights to use, copy, modify, merge, publish,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# distribute, and/or sell copies of the Software, and to permit persons
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# to whom the Software is furnished to do so, provided that the above
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# copyright notice(s) and this permission notice appear in all copies of
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# the Software and that both the above copyright notice(s) and this
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# permission notice appear in supporting documentation.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Except as contained in this notice, the name of a copyright holder
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# shall not be used in advertising or otherwise to promote the sale, use
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# or other dealings in this Software without prior written authorization
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# of the copyright holder.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# @(#)make_release_packages 1.55 07/11/06
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Create and fill a package staging area for X
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# This script should be run from the base of the build tree.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# It takes no parameters.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# ./make_release_packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# To build a subset of packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# env PACKAGE_LIST="packages" ./make_release_packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Make sure that we aren't affected by the personal environment of
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# whoever is running this script
5c099afa7c9361afc2f4477fec0e3018588d7840Allan FosterPATH=/opt/SUNWspro/bin:/opt/SUNWguide/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# List of official (deliverable) X-window packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan FosterXW_PACKAGE_LIST="SUNWxwcft SUNWxwdem SUNWxwdim SUNWxwfs SUNWxwinc \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxwice SUNWxwopt SUNWxwpmn SUNWxwsrc SUNWxwacx SUNWxwdxm \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxwhl SUNWi1of SUNWxwfa SUNWxwpft SUNWxwsrv SUNWxwoft \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWfontconfig SUNWfontconfig-root SUNWfontconfig-docs SUNWxwsvr \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxscreensaver-hacks SUNWfreetype2 SUNWxwxft \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxorg-clientlibs SUNWxorg-devel-docs SUNWxorg-headers \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxorg-client-docs SUNWxorg-client-programs SUNWxorg-compatlinks \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxprint-server SUNWxcursor-themes SUNWvncviewer"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# L10N packages are normally only built on sparc since they only have text
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# files that are the same for both platforms
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterif [ "$MACH" = "sparc" -o "x$BUILD_L10N" = "xyes" ]; then
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn SUNW0xwfa SUNW0xwplt \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNW0xwopt SUNW0xwsvr"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Which platform name do we use for 64-bit?
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster echo "Unknown architecture - not SPARC nor i386."
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Trusted Extensions packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Packages with platform-specific prototype files, including those with
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# 64-bit libraries
5c099afa7c9361afc2f4477fec0e3018588d7840Allan FosterXW_PLT_PACKAGE="SUNWxwplt SUNWxwplr SUNWxwfnt SUNWxwrtl SUNWxwslb \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxwmod SUNWxscreensaver-hacks-gl SUNWxwman SUNWxwfsw \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxorg-server SUNWxorg-graphics-ddx SUNWxorg-doc SUNWxorg-cfg \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SUNWxsun-server SUNWxvnc $TSOL_PACKAGE"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Some packages are only built for certain platforms currently
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# To build a subset of packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# PACKAGE_LIST="packages" make_release_packages
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster: ${PACKAGE_LIST:="$XW_PACKAGE_LIST $XW_PLT_PACKAGE $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Get build version from pkgversion
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterif [ -f pkgversion ] ; then
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster echo "Error: $SOURCEDIR/packages/pkgversion not found. Cannot continue."
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster echo "VERSION not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster echo "BUILD not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan FosterDECIMAL_BUILD=`echo ${BUILD} | awk '{print $1 / 100.0}'`
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterecho "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Next, create the staging area. Make sure that the logs directory
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# is writeable by everyone because it is likely that we will need to
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# write into it as root across an NFS link...
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterecho 'Removing old proto-packages and recreating'
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Now copy the package description info
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterecho 'Copying package descriptions'
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# We can't just use `sccs get SCCS' because it will punt if it hits
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# a file which is being edited (writeable).
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster/bin/cp copyright depend i.* r.* $PACKAGE_DIR >/dev/null 2>&1
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster # See above about sccs usage
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /bin/cp p* d* lib* i.* r.* M* $PACKAGE_DIR/$package >/dev/null 2>&1
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster # We keep the master copyright in the top-level copyright file
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster # Packages that need additional copyright have copyright.add files
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster # that we then merge here
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if [ -f copyright.add ] ; then
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster cat ../copyright copyright.add > $PACKAGE_DIR/$package/copyright
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster cp ../copyright $PACKAGE_DIR/$package/copyright
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster# Now move into the package staging area and build the packages.
cd $package
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
eval "case $package in
if [ ! -f prototype_$MACH ]; then
ln -s prototype_com prototype_$MACH
echo /usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
/usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
echo "******** Done Making the $package package ********"
cd $PACKAGE_DIR
cd installdir