make_release_packages revision 619
2d2eda71267231c2526be701fe655db125852c1ffielding#! /bin/ksh93
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Permission is hereby granted, free of charge, to any person obtaining a
2d2eda71267231c2526be701fe655db125852c1ffielding# copy of this software and associated documentation files (the
2d2eda71267231c2526be701fe655db125852c1ffielding# "Software"), to deal in the Software without restriction, including
2d2eda71267231c2526be701fe655db125852c1ffielding# without limitation the rights to use, copy, modify, merge, publish,
2d2eda71267231c2526be701fe655db125852c1ffielding# distribute, and/or sell copies of the Software, and to permit persons
2d2eda71267231c2526be701fe655db125852c1ffielding# to whom the Software is furnished to do so, provided that the above
2d2eda71267231c2526be701fe655db125852c1ffielding# copyright notice(s) and this permission notice appear in all copies of
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# the Software and that both the above copyright notice(s) and this
2d2eda71267231c2526be701fe655db125852c1ffielding# permission notice appear in supporting documentation.
2d2eda71267231c2526be701fe655db125852c1ffielding#
2d2eda71267231c2526be701fe655db125852c1ffielding# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2d2eda71267231c2526be701fe655db125852c1ffielding# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2d2eda71267231c2526be701fe655db125852c1ffielding# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
2d2eda71267231c2526be701fe655db125852c1ffielding# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
2d2eda71267231c2526be701fe655db125852c1ffielding# Except as contained in this notice, the name of a copyright holder
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# shall not be used in advertising or otherwise to promote the sale, use
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# or other dealings in this Software without prior written authorization
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# of the copyright holder.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
2d2eda71267231c2526be701fe655db125852c1ffielding# @(#)make_release_packages 1.66 09/01/27
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Create and fill a package staging area for X
64185f9824e42f21ca7b9ae6c004484215c031a7rbb#
2d2eda71267231c2526be701fe655db125852c1ffielding# This script should be run from the base of the build tree.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# It takes no parameters.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Example:
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
2d2eda71267231c2526be701fe655db125852c1ffielding# ./make_release_packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# To build a subset of packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# ./make_release_packages packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# or
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# env PACKAGE_LIST="packages" ./make_release_packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Make sure that we aren't affected by the personal environment of
2d2eda71267231c2526be701fe655db125852c1ffielding# whoever is running this script
2d2eda71267231c2526be701fe655db125852c1ffieldingPATH=/usr/bin:/usr/ccs/bin
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingSHELL=/bin/ksh93
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingexport LC_NUMERIC=C
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
2d2eda71267231c2526be701fe655db125852c1ffieldingMACH="$(uname -p)"
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingDATE="$(date +0.%Y.%m.%d)"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# List of official (deliverable) X-window packages for all platforms
2d2eda71267231c2526be701fe655db125852c1ffieldingXW_PACKAGE_LIST="SUNWfontconfig SUNWfontconfig-docs SUNWfontconfig-root
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWpciaccess SUNWpixman SUNWfreetype2 SUNWvncviewer SUNWxcursor-themes
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxorg-cfg SUNWxorg-client-docs SUNWxorg-client-programs
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxorg-clientlibs SUNWxorg-compatlinks SUNWxorg-devel-docs
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxorg-graphics-ddx SUNWxorg-headers
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxorg-server SUNWxorg-tsol-module SUNWxprint-server
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxscreensaver-hacks SUNWxscreensaver-hacks-gl SUNWxsun-server
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxvnc SUNWxwacx SUNWxwcft SUNWxwdem SUNWxwdxm
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxwfnt SUNWxwfs SUNWxwfsw SUNWxwhl SUNWxwice SUNWxwinc
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb SUNWxwman SUNWxwmod SUNWxwoft SUNWxwopt SUNWxwpft SUNWxwplr
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb SUNWxwplt SUNWxwpmn SUNWxwrtl SUNWxwslb SUNWxwsrv SUNWxwsvr
2d2eda71267231c2526be701fe655db125852c1ffielding SUNWxwts SUNWxwxft"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Some packages are only built for certain platforms currently
2d2eda71267231c2526be701fe655db125852c1ffieldingcase "${MACH}" in
2d2eda71267231c2526be701fe655db125852c1ffielding sparc)
2d2eda71267231c2526be701fe655db125852c1ffielding XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxwpsr"
2d2eda71267231c2526be701fe655db125852c1ffielding ;;
2d2eda71267231c2526be701fe655db125852c1ffielding i386)
2d2eda71267231c2526be701fe655db125852c1ffielding XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
2d2eda71267231c2526be701fe655db125852c1ffielding ;;
2d2eda71267231c2526be701fe655db125852c1ffieldingesac
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Localization template packages for delivery to translation teams
2d2eda71267231c2526be701fe655db125852c1ffieldingif [[ "$BUILD_L10N" != "no" ]]; then
2d2eda71267231c2526be701fe655db125852c1ffielding XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn
2d2eda71267231c2526be701fe655db125852c1ffielding SUNW0xwplt SUNW0xwopt SUNW0xwsvr"
2d2eda71267231c2526be701fe655db125852c1ffieldingelse
2d2eda71267231c2526be701fe655db125852c1ffielding XW_L10N_PACKAGES=" "
2d2eda71267231c2526be701fe655db125852c1ffieldingfi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# FSW* packages are built for the OpenSolaris (Project Indiana) deliveries
2d2eda71267231c2526be701fe655db125852c1ffieldingFSW_PACKAGE_LIST="
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-core
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-cyrillic
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-daewoo
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-ethiopic
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-2
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-3
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-4
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-9
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-10
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-13
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-14
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-iso8859-16
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-jiskan
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-syriac
2d2eda71267231c2526be701fe655db125852c1ffielding FSWxorg-fonts-vera
2d2eda71267231c2526be701fe655db125852c1ffielding"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingif [[ "$BUILD_FSW" != "no" ]]; then
2d2eda71267231c2526be701fe655db125852c1ffielding EXTRA_PACKAGES+="${FSW_PACKAGE_LIST}"
2d2eda71267231c2526be701fe655db125852c1ffieldingfi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# To build a subset of packages:
2d2eda71267231c2526be701fe655db125852c1ffielding# make_release_packages packages
2d2eda71267231c2526be701fe655db125852c1ffielding# or
2d2eda71267231c2526be701fe655db125852c1ffielding# env PACKAGE_LIST="packages" make_release_packages
2d2eda71267231c2526be701fe655db125852c1ffielding#
2d2eda71267231c2526be701fe655db125852c1ffieldingif (( $# > 0 )) ; then
2d2eda71267231c2526be701fe655db125852c1ffielding PACKAGE_LIST="$*"
2d2eda71267231c2526be701fe655db125852c1ffieldingelse
2d2eda71267231c2526be701fe655db125852c1ffielding : ${PACKAGE_LIST:="$XW_PACKAGE_LIST $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
2d2eda71267231c2526be701fe655db125852c1ffieldingfi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding### Functions for use later
2d2eda71267231c2526be701fe655db125852c1ffieldingfunction print_and_run
2d2eda71267231c2526be701fe655db125852c1ffielding{
2d2eda71267231c2526be701fe655db125852c1ffielding print "$@"
2d2eda71267231c2526be701fe655db125852c1ffielding "$@"
2d2eda71267231c2526be701fe655db125852c1ffielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingprogname="$0"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfunction fatal_error
2d2eda71267231c2526be701fe655db125852c1ffielding{
2d2eda71267231c2526be701fe655db125852c1ffielding print -u2 "${progname}: ERROR: $*"
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbb exit 1
2d2eda71267231c2526be701fe655db125852c1ffielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfunction process_includes
2d2eda71267231c2526be701fe655db125852c1ffielding{
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben nawk \
3ad8afcbbeb34b4b129bfeaff0f6eaf65e69ba9fwrowe "/^include / {
2d2eda71267231c2526be701fe655db125852c1ffielding system(\"cat $1/\" \$2)
2d2eda71267231c2526be701fe655db125852c1ffielding next
2d2eda71267231c2526be701fe655db125852c1ffielding }
2d2eda71267231c2526be701fe655db125852c1ffielding { print }" $2
2d2eda71267231c2526be701fe655db125852c1ffielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Which platform name do we use for 64-bit?
2d2eda71267231c2526be701fe655db125852c1ffieldingcase "${MACH}" in
2d2eda71267231c2526be701fe655db125852c1ffielding sparc) PLAT_64="sparcv9" ;;
2d2eda71267231c2526be701fe655db125852c1ffielding i386) PLAT_64="amd64" ;;
2d2eda71267231c2526be701fe655db125852c1ffielding *) fatal_error "Unknown architecture - not SPARC nor i386." ;;
2d2eda71267231c2526be701fe655db125852c1ffieldingesac
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding: ${PACKAGE_DIR:="$(pwd)/proto-packages"}
2d2eda71267231c2526be701fe655db125852c1ffieldingSOURCE_DIR="$(pwd)"
2d2eda71267231c2526be701fe655db125852c1ffieldingPKG_SOURCE_DIR=${SOURCE_DIR}/packages
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb
2d2eda71267231c2526be701fe655db125852c1ffieldingcd ${PKG_SOURCE_DIR}
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard# Get build version from pkgversion
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardif [[ -f pkgversion ]] ; then
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard source ./pkgversion
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardelse
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard fatal_error "${PKG_SOURCE_DIR}/pkgversion not found. Cannot continue."
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardfi
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard
ba03385030cfbe81ffa4d35cffbf319df153895cwroweif [[ -z "${VERSION}" ]] ; then
ba03385030cfbe81ffa4d35cffbf319df153895cwrowe fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
ba03385030cfbe81ffa4d35cffbf319df153895cwrowefi
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardif [[ -z "${BUILD}" ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
2d2eda71267231c2526be701fe655db125852c1ffieldingfi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingDECIMAL_BUILD=$(( ${BUILD} / 100.0 ))
2d2eda71267231c2526be701fe655db125852c1ffieldingprint "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingif [[ "${MACH}" = "sparc" ]]; then
2d2eda71267231c2526be701fe655db125852c1ffielding PROTODIR=${SOURCE_DIR}/proto-sun4-svr4
2d2eda71267231c2526be701fe655db125852c1ffieldingelse
2d2eda71267231c2526be701fe655db125852c1ffielding PROTODIR=${SOURCE_DIR}/proto-${MACH}-svr4
e68becff3c3ddc18723c9799b8cc2e6e9c3dbd66wrowefi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Next, create the staging area.
2d2eda71267231c2526be701fe655db125852c1ffielding#
2d2eda71267231c2526be701fe655db125852c1ffieldingprint 'Removing old proto-packages and recreating'
2d2eda71267231c2526be701fe655db125852c1ffielding/bin/rm -rf ${PACKAGE_DIR}
2d2eda71267231c2526be701fe655db125852c1ffielding/bin/mkdir ${PACKAGE_DIR} ${PACKAGE_DIR}/logs
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Now copy the package description info
2d2eda71267231c2526be701fe655db125852c1ffieldingprint 'Copying package descriptions'
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/bin/cp copyright depend i.* r.* ${PACKAGE_DIR} >/dev/null 2>&1
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfor package in ${PACKAGE_LIST} common_files ; do
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ ! -d ${package} ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding print "packages/${package} not found ; skipping"
2d2eda71267231c2526be701fe655db125852c1ffielding continue
2d2eda71267231c2526be701fe655db125852c1ffielding fi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding cd ${package}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/mkdir ${PACKAGE_DIR}/${package}
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/cp p* d* lib* i.* r.* M* ${PACKAGE_DIR}/${package} >/dev/null 2>&1
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding # We keep the master copyright in the top-level copyright file
2d2eda71267231c2526be701fe655db125852c1ffielding # Packages that need additional copyright have copyright.add files
2d2eda71267231c2526be701fe655db125852c1ffielding # that we then merge here
2d2eda71267231c2526be701fe655db125852c1ffielding cp ../copyright ${PACKAGE_DIR}/${package}/copyright
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding for F in copyright.add copyright.add.${MACH} ; do
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ -f $F ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding chmod +w ${PACKAGE_DIR}/${package}/copyright
2d2eda71267231c2526be701fe655db125852c1ffielding process_includes "${PROTODIR}/licenses" $F \
2d2eda71267231c2526be701fe655db125852c1ffielding >> ${PACKAGE_DIR}/${package}/copyright
2d2eda71267231c2526be701fe655db125852c1ffielding fi
2d2eda71267231c2526be701fe655db125852c1ffielding done
2d2eda71267231c2526be701fe655db125852c1ffielding cd ..
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbbdone
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Now move into the package staging area and build the packages.
2d2eda71267231c2526be701fe655db125852c1ffieldingcd ${PACKAGE_DIR}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfor D in etc usr var lib licenses kernel ; do
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/rm -f $D
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/ln -s ${PROTODIR}/$D $D
2d2eda71267231c2526be701fe655db125852c1ffieldingdone
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfor D in openwin ; do
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/rm -f $D
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/ln -s ${PROTODIR}/usr/$D $D
2d2eda71267231c2526be701fe655db125852c1ffieldingdone
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingLOGfile=logs/package_build
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingprint -- '---Building packages'
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Variables to pass to pkgmk for use in prototype files
2d2eda71267231c2526be701fe655db125852c1ffielding# They must start with lowercase letters to be resolved at pkgmk time
2d2eda71267231c2526be701fe655db125852c1ffieldingPKGMK_VARS="plat_64=${PLAT_64} plat=${MACH}"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingfor package in ${PACKAGE_LIST} ; do
2d2eda71267231c2526be701fe655db125852c1ffielding print "******** Making the ${package} package ********"
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ ! -d ${package} ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding print "${PACKAGE_DIR}/${package} was not found ; skipping"
2d2eda71267231c2526be701fe655db125852c1ffielding continue
2d2eda71267231c2526be701fe655db125852c1ffielding fi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding cd ${package}
2d2eda71267231c2526be701fe655db125852c1ffielding date
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim sed -e '/ARCH/s/ISA/'${MACH}'/' -e 's/SUNW_PRODVERS=.*$/SUNW_PRODVERS='${VERSION}/ -e 's/VERSION=.*$/VERSION='${VERSION}.${BUILD},REV=${DATE}/ pkginfo.tmpl > pkginfo
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim if [[ -f Makefile ]] ; then
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim print_and_run /usr/ccs/bin/make SOURCEDIR=${PKG_SOURCE_DIR} all
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim else
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim for pf in preinstall preremove postinstall postremove ; do
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim # If filename.tmpl exists, but filename does not,
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben # build filename from the .tmpl
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim if [[ -f "${pf}.tmpl" && ! -f "${pf}" ]] ; then
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb SOURCEDIR=${PKG_SOURCE_DIR} \
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb nawk -f ${PKG_SOURCE_DIR}/awk_procedure \
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb ${pf}.tmpl > ${pf}
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb fi
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb done
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb fi
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb for df in depend depend_${MACH} ; do
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb # If filename.tmpl exists, but filename does not,
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb # build filename from the .tmpl
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ -f "${df}.tmpl" && ! -f "${df}" ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding process_includes "${PKG_SOURCE_DIR}/${package}" ${df}.tmpl > ${df}
2d2eda71267231c2526be701fe655db125852c1ffielding fi
2d2eda71267231c2526be701fe655db125852c1ffielding done
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ -f prototype ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding # Simple package with the same prototype on all platforms
2d2eda71267231c2526be701fe655db125852c1ffielding PROTOTYPE="prototype"
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb else
2d2eda71267231c2526be701fe655db125852c1ffielding # Package with some platform-specific settings in prototype
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ ! -f prototype_${MACH} ]]; then
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard ln -s prototype_com prototype_${MACH}
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard fi
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard PROTOTYPE="prototype_${MACH}"
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard fi
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard
2d2eda71267231c2526be701fe655db125852c1ffielding print_and_run /usr/bin/pkgmk -d ${PACKAGE_DIR}/${package} -f ${PROTOTYPE} -o ${PKGMK_VARS}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding print "******** Done Making the ${package} package ********"
2d2eda71267231c2526be701fe655db125852c1ffielding cd ..
2d2eda71267231c2526be701fe655db125852c1ffieldingdone >$LOGfile 2>&1
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingprint result log is in ${PACKAGE_DIR}/$LOGfile
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingprint -n "Packages built: "
2d2eda71267231c2526be701fe655db125852c1ffieldinggrep -c "Packaging complete" ${PACKAGE_DIR}/$LOGfile
2d2eda71267231c2526be701fe655db125852c1ffieldingprint -n "Packages failed: "
2d2eda71267231c2526be701fe655db125852c1ffieldinggrep -c "Packaging was not successful" ${PACKAGE_DIR}/$LOGfile
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding# Create an installdir with symlinks to built packages
0e6e93183d91142d7cf9ffbf502114ff77bd9e19bencd ${PACKAGE_DIR}
2d2eda71267231c2526be701fe655db125852c1ffieldingmkdir installdir
2d2eda71267231c2526be701fe655db125852c1ffieldingcd installdir
2d2eda71267231c2526be701fe655db125852c1ffieldingfor package in ${PACKAGE_LIST} ; do
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ -d ../${package}/${package} ]] ; then
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb ln -s ../${package}/${package} .
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb fi
2d2eda71267231c2526be701fe655db125852c1ffieldingdone
2d2eda71267231c2526be701fe655db125852c1ffieldingif [[ -f ${PKG_SOURCE_DIR}/upgrade-X ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding cp -p ${PKG_SOURCE_DIR}/upgrade-X .
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbb chmod a+x upgrade-X
2d2eda71267231c2526be701fe655db125852c1ffieldingfi
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingexit 0
2d2eda71267231c2526be701fe655db125852c1ffielding