make_release_packages revision 725
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
#
# @(#)make_release_packages 1.73 09/06/11
#
# Create and fill a package staging area for X
#
# This script should be run from the base of the build tree.
# It takes no parameters.
#
# Example:
# ./make_release_packages
#
# To build a subset of packages
# ./make_release_packages packages
# or
# env PACKAGE_LIST="packages" ./make_release_packages
#
# Make sure that we aren't affected by the personal environment of
# whoever is running this script
export LC_NUMERIC=C
# List of official (deliverable) X-window packages for all platforms
XW_PACKAGE_LIST="SUNWfontconfig SUNWfontconfig-docs SUNWfontconfig-root
SUNWttf-google-droid
SUNWpciaccess SUNWpixman SUNWfreetype2 SUNWvncviewer SUNWxcursor-themes
SUNWxorg-client-docs SUNWxorg-client-programs
SUNWxorg-clientlibs SUNWxorg-compatlinks
SUNWxorg-graphics-ddx SUNWxorg-headers
SUNWxorg-server SUNWxorg-tsol-module
SUNWxscreensaver-hacks SUNWxscreensaver-hacks-gl
SUNWxsun-headers SUNWxsun-server
SUNWxvnc SUNWxwacx SUNWxwcft SUNWxwdem SUNWxwdxm
SUNWxwfnt SUNWxwfs SUNWxwfsw SUNWxwice SUNWxwinc
SUNWxwman SUNWxwmod SUNWxwoft SUNWxwopt SUNWxwplr
SUNWxwplt SUNWxwpmn SUNWxwrtl SUNWxwslb SUNWxwsvr
SUNWxwts SUNWxwxft"
# Some packages are only built for certain platforms currently
case "${MACH}" in
XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxwpsr"
;;
i386)
XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
;;
esac
# Localization template packages for delivery to translation teams
if [[ "$BUILD_L10N" != "no" ]]; then
XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn
SUNW0xwplt SUNW0xwopt SUNW0xwsvr"
else
XW_L10N_PACKAGES=" "
fi
# FSW* packages are built for the OpenSolaris (Project Indiana) deliveries
FSWxorg-fonts-core
FSWxorg-fonts-cyrillic
FSWxorg-fonts-daewoo
FSWxorg-fonts-ethiopic
FSWxorg-fonts-iso8859-2
FSWxorg-fonts-iso8859-3
FSWxorg-fonts-iso8859-4
FSWxorg-fonts-iso8859-9
FSWxorg-fonts-iso8859-10
FSWxorg-fonts-iso8859-13
FSWxorg-fonts-iso8859-14
FSWxorg-fonts-iso8859-16
FSWxorg-fonts-jiskan
FSWxorg-fonts-syriac
FSWxorg-fonts-vera
"
if [[ "$BUILD_FSW" != "no" ]]; then
EXTRA_PACKAGES+="${FSW_PACKAGE_LIST}"
fi
# To build a subset of packages:
# make_release_packages packages
# or
# env PACKAGE_LIST="packages" make_release_packages
#
if (( $# > 0 )) ; then
PACKAGE_LIST="$*"
else
fi
### Functions for use later
function print_and_run
{
print "$@"
"$@"
}
progname="$0"
function fatal_error
{
print -u2 "${progname}: ERROR: $*"
exit 1
}
function process_includes
{
nawk \
"/^include / {
system(\"cat $1/\" \$2)
next
}
{ print }" $2
}
# Which platform name do we use for 64-bit?
case "${MACH}" in
*) fatal_error "Unknown architecture - not SPARC nor i386." ;;
esac
cd ${PKG_SOURCE_DIR}
# Get build version from pkgversion
if [[ -f pkgversion ]] ; then
source ./pkgversion
else
fatal_error "${PKG_SOURCE_DIR}/pkgversion not found. Cannot continue."
fi
if [[ -z "${VERSION}" ]] ; then
fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
fi
if [[ -z "${BUILD}" ]] ; then
fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
fi
print "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
if [[ "${MACH}" = "sparc" ]]; then
else
fi
# Next, create the staging area.
#
print 'Removing old proto-packages and recreating'
# Now copy the package description info
print 'Copying package descriptions'
if [[ ! -d ${package} ]] ; then
print "packages/${package} not found ; skipping"
continue
fi
cd ${package}
# 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 $F ]] ; then
process_includes "${PROTODIR}/licenses" $F \
fi
done
cd ..
done
# Now move into the package staging area and build the packages.
cd ${PACKAGE_DIR}
done
done
print -- '---Building packages'
# 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}"
print "******** Making the ${package} package ********"
if [[ ! -d ${package} ]] ; then
print "${PACKAGE_DIR}/${package} was not found ; skipping"
continue
fi
cd ${package}
sed -e '/ARCH/s/ISA/'${MACH}'/' -e 's/SUNW_PRODVERS=.*$/SUNW_PRODVERS='${VERSION}/ -e 's/VERSION=.*$/VERSION='${VERSION}.${BUILD},REV=${DATE}/ pkginfo.tmpl > pkginfo
if [[ -f Makefile ]] ; then
else
# If filename.tmpl exists, but filename does not,
# build filename from the .tmpl
if [[ -f "${pf}.tmpl" && ! -f "${pf}" ]] ; then
SOURCEDIR=${PKG_SOURCE_DIR} \
fi
done
fi
# If filename.tmpl exists, but filename does not,
# build filename from the .tmpl
if [[ -f "${df}.tmpl" && ! -f "${df}" ]] ; then
fi
done
if [[ -f prototype ]] ; then
# Simple package with the same prototype on all platforms
PROTOTYPE="prototype"
else
# Package with some platform-specific settings in prototype
if [[ ! -f prototype_${MACH} ]]; then
fi
PROTOTYPE="prototype_${MACH}"
fi
print "******** Done Making the ${package} package ********"
cd ..
print -n "Packages built: "
print -n "Packages failed: "
# Create an installdir with symlinks to built packages
cd ${PACKAGE_DIR}
cd installdir
fi
done
if [[ -f ${PKG_SOURCE_DIR}/upgrade-X ]] ; then
fi
exit 0