make_release_packages revision 721
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner#! /bin/ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Permission is hereby granted, free of charge, to any person obtaining a
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# copy of this software and associated documentation files (the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# "Software"), to deal in the Software without restriction, including
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# without limitation the rights to use, copy, modify, merge, publish,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# distribute, and/or sell copies of the Software, and to permit persons
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# to whom the Software is furnished to do so, provided that the above
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# copyright notice(s) and this permission notice appear in all copies of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# the Software and that both the above copyright notice(s) and this
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# permission notice appear in supporting documentation.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Except as contained in this notice, the name of a copyright holder
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# shall not be used in advertising or otherwise to promote the sale, use
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or other dealings in this Software without prior written authorization
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# of the copyright holder.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# @(#)make_release_packages 1.72 09/06/02
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Create and fill a package staging area for X
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# This script should be run from the base of the build tree.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# It takes no parameters.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Example:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ./make_release_packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# To build a subset of packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ./make_release_packages packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# env PACKAGE_LIST="packages" ./make_release_packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Make sure that we aren't affected by the personal environment of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# whoever is running this script
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPATH=/usr/bin:/usr/ccs/bin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSHELL=/bin/ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexport LC_NUMERIC=C
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinMACH="$(uname -p)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDATE="$(date +0.%Y.%m.%d)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# List of official (deliverable) X-window packages for all platforms
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinXW_PACKAGE_LIST="SUNWfontconfig SUNWfontconfig-docs SUNWfontconfig-root
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWttf-google-droid
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWpciaccess SUNWpixman SUNWfreetype2 SUNWvncviewer SUNWxcursor-themes
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxorg-client-docs SUNWxorg-client-programs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxorg-clientlibs SUNWxorg-compatlinks
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxorg-graphics-ddx SUNWxorg-headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxorg-server SUNWxorg-tsol-module
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxscreensaver-hacks SUNWxscreensaver-hacks-gl
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxsun-headers SUNWxsun-server
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxvnc SUNWxwacx SUNWxwcft SUNWxwdem SUNWxwdxm
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxwfnt SUNWxwfs SUNWxwfsw SUNWxwice SUNWxwinc
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxwman SUNWxwmod SUNWxwoft SUNWxwopt SUNWxwplr
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxwplt SUNWxwpmn SUNWxwrtl SUNWxwslb SUNWxwsrv SUNWxwsvr
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNWxwts SUNWxwxft"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Some packages are only built for certain platforms currently
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase "${MACH}" in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sparc)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxwpsr"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin i386)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Localization template packages for delivery to translation teams
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ "$BUILD_L10N" != "no" ]]; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SUNW0xwplt SUNW0xwopt SUNW0xwsvr"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinelse
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XW_L10N_PACKAGES=" "
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# FSW* packages are built for the OpenSolaris (Project Indiana) deliveries
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinFSW_PACKAGE_LIST="
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-core
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-cyrillic
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-daewoo
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-ethiopic
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-4
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-9
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-10
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-13
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-14
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-iso8859-16
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-jiskan
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-syriac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin FSWxorg-fonts-vera
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ "$BUILD_FSW" != "no" ]]; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin EXTRA_PACKAGES+="${FSW_PACKAGE_LIST}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# To build a subset of packages:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# make_release_packages packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# env PACKAGE_LIST="packages" make_release_packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif (( $# > 0 )) ; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin PACKAGE_LIST="$*"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinelse
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin : ${PACKAGE_LIST:="$XW_PACKAGE_LIST $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### Functions for use later
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfunction print_and_run
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin print "$@"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$@"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprogname="$0"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfunction fatal_error
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin print -u2 "${progname}: ERROR: $*"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfunction process_includes
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin nawk \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "/^include / {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin system(\"cat $1/\" \$2)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin next
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin }
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin { print }" $2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Which platform name do we use for 64-bit?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase "${MACH}" in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sparc) PLAT_64="sparcv9" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin i386) PLAT_64="amd64" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) fatal_error "Unknown architecture - not SPARC nor i386." ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin: ${PACKAGE_DIR:="$(pwd)/proto-packages"}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSOURCE_DIR="$(pwd)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPKG_SOURCE_DIR=${SOURCE_DIR}/packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincd ${PKG_SOURCE_DIR}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Get build version from pkgversion
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ -f pkgversion ]] ; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin source ./pkgversion
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinelse
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz fatal_error "${PKG_SOURCE_DIR}/pkgversion not found. Cannot continue."
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainzfi
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ -z "${VERSION}" ]] ; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ -z "${BUILD}" ]] ; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDECIMAL_BUILD=$(( ${BUILD} / 100.0 ))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprint "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [[ "${MACH}" = "sparc" ]]; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin PROTODIR=${SOURCE_DIR}/proto-sun4-svr4
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinelse
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin PROTODIR=${SOURCE_DIR}/proto-${MACH}-svr4
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Next, create the staging area.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprint 'Removing old proto-packages and recreating'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/bin/rm -rf ${PACKAGE_DIR}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/bin/mkdir ${PACKAGE_DIR} ${PACKAGE_DIR}/logs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Now copy the package description info
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprint 'Copying package descriptions'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/bin/cp copyright depend i.* r.* ${PACKAGE_DIR} >/dev/null 2>&1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor package in ${PACKAGE_LIST} common_files ; do
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if [[ ! -d ${package} ]] ; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin print "packages/${package} not found ; skipping"
continue
fi
cd ${package}
/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
cp ../copyright ${PACKAGE_DIR}/${package}/copyright
for F in copyright.add copyright.add.${MACH} ; do
if [[ -f $F ]] ; then
chmod +w ${PACKAGE_DIR}/${package}/copyright
process_includes "${PROTODIR}/licenses" $F \
>> ${PACKAGE_DIR}/${package}/copyright
fi
done
cd ..
done
# Now move into the package staging area and build the packages.
cd ${PACKAGE_DIR}
for D in etc usr var lib licenses kernel ; do
/bin/rm -f $D
/bin/ln -s ${PROTODIR}/$D $D
done
for D in openwin ; do
/bin/rm -f $D
/bin/ln -s ${PROTODIR}/usr/$D $D
done
LOGfile=logs/package_build
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}"
for package in ${PACKAGE_LIST} ; do
print "******** Making the ${package} package ********"
if [[ ! -d ${package} ]] ; then
print "${PACKAGE_DIR}/${package} was not found ; skipping"
continue
fi
cd ${package}
date
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
print_and_run /usr/ccs/bin/make SOURCEDIR=${PKG_SOURCE_DIR} all
else
for pf in preinstall preremove postinstall postremove ; do
# If filename.tmpl exists, but filename does not,
# build filename from the .tmpl
if [[ -f "${pf}.tmpl" && ! -f "${pf}" ]] ; then
SOURCEDIR=${PKG_SOURCE_DIR} \
nawk -f ${PKG_SOURCE_DIR}/awk_procedure \
${pf}.tmpl > ${pf}
fi
done
fi
for df in depend depend_${MACH} ; do
# If filename.tmpl exists, but filename does not,
# build filename from the .tmpl
if [[ -f "${df}.tmpl" && ! -f "${df}" ]] ; then
process_includes "${PKG_SOURCE_DIR}/${package}" ${df}.tmpl > ${df}
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
ln -s prototype_com prototype_${MACH}
fi
PROTOTYPE="prototype_${MACH}"
fi
print_and_run /usr/bin/pkgmk -d ${PACKAGE_DIR}/${package} -f ${PROTOTYPE} -o ${PKGMK_VARS}
print "******** Done Making the ${package} package ********"
cd ..
done >$LOGfile 2>&1
print result log is in ${PACKAGE_DIR}/$LOGfile
print -n "Packages built: "
grep -c "Packaging complete" ${PACKAGE_DIR}/$LOGfile
print -n "Packages failed: "
grep -c "Packaging was not successful" ${PACKAGE_DIR}/$LOGfile
# Create an installdir with symlinks to built packages
cd ${PACKAGE_DIR}
mkdir installdir
cd installdir
for package in ${PACKAGE_LIST} ; do
if [[ -d ../${package}/${package} ]] ; then
ln -s ../${package}/${package} .
fi
done
if [[ -f ${PKG_SOURCE_DIR}/upgrade-X ]] ; then
cp -p ${PKG_SOURCE_DIR}/upgrade-X .
chmod a+x upgrade-X
fi
exit 0