make_release_packages revision 619
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
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# 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.
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.
2d2eda71267231c2526be701fe655db125852c1ffielding# @(#)make_release_packages 1.66 09/01/27
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# Create and fill a package staging area for X
2d2eda71267231c2526be701fe655db125852c1ffielding# This script should be run from the base of the build tree.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# It takes no parameters.
2d2eda71267231c2526be701fe655db125852c1ffielding# ./make_release_packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# To build a subset of packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# ./make_release_packages packages
f062ed7bd262a37a909dd77ce5fc23b446818823fielding# env PACKAGE_LIST="packages" ./make_release_packages
2d2eda71267231c2526be701fe655db125852c1ffielding# Make sure that we aren't affected by the personal environment of
2d2eda71267231c2526be701fe655db125852c1ffielding# whoever is running this script
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# Some packages are only built for certain platforms currently
2d2eda71267231c2526be701fe655db125852c1ffielding# Localization template packages for delivery to translation teams
2d2eda71267231c2526be701fe655db125852c1ffielding SUNW0xwplt SUNW0xwopt SUNW0xwsvr"
2d2eda71267231c2526be701fe655db125852c1ffielding# FSW* packages are built for the OpenSolaris (Project Indiana) deliveries
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# To build a subset of packages:
2d2eda71267231c2526be701fe655db125852c1ffielding# make_release_packages packages
2d2eda71267231c2526be701fe655db125852c1ffielding# env PACKAGE_LIST="packages" make_release_packages
2d2eda71267231c2526be701fe655db125852c1ffielding : ${PACKAGE_LIST:="$XW_PACKAGE_LIST $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
2d2eda71267231c2526be701fe655db125852c1ffielding### Functions for use later
2d2eda71267231c2526be701fe655db125852c1ffielding system(\"cat $1/\" \$2)
2d2eda71267231c2526be701fe655db125852c1ffielding# Which platform name do we use for 64-bit?
2d2eda71267231c2526be701fe655db125852c1ffielding *) fatal_error "Unknown architecture - not SPARC nor i386." ;;
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard# Get build version from pkgversion
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardif [[ -f pkgversion ]] ; then
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddard fatal_error "${PKG_SOURCE_DIR}/pkgversion not found. Cannot continue."
ba03385030cfbe81ffa4d35cffbf319df153895cwroweif [[ -z "${VERSION}" ]] ; then
ba03385030cfbe81ffa4d35cffbf319df153895cwrowe fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
8446ff68f1907088878cfdb0d80ebaeb44b609c8stoddardif [[ -z "${BUILD}" ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
2d2eda71267231c2526be701fe655db125852c1ffieldingprint "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
2d2eda71267231c2526be701fe655db125852c1ffielding# Next, create the staging area.
2d2eda71267231c2526be701fe655db125852c1ffieldingprint 'Removing old proto-packages and recreating'
2d2eda71267231c2526be701fe655db125852c1ffielding# Now copy the package description info
2d2eda71267231c2526be701fe655db125852c1ffieldingprint 'Copying package descriptions'
2d2eda71267231c2526be701fe655db125852c1ffielding/bin/cp copyright depend i.* r.* ${PACKAGE_DIR} >/dev/null 2>&1
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ ! -d ${package} ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding print "packages/${package} not found ; skipping"
2d2eda71267231c2526be701fe655db125852c1ffielding /bin/cp p* d* lib* i.* r.* M* ${PACKAGE_DIR}/${package} >/dev/null 2>&1
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 if [[ -f $F ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding# Now move into the package staging area and build the packages.
2d2eda71267231c2526be701fe655db125852c1ffieldingprint -- '---Building packages'
2d2eda71267231c2526be701fe655db125852c1ffielding# Variables to pass to pkgmk for use in prototype files
2d2eda71267231c2526be701fe655db125852c1ffielding# They must start with lowercase letters to be resolved at pkgmk time
2d2eda71267231c2526be701fe655db125852c1ffielding print "******** Making the ${package} package ********"
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ ! -d ${package} ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding print "${PACKAGE_DIR}/${package} was not found ; skipping"
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 for pf in preinstall preremove postinstall postremove ; do
3a9bc6532fbe8439fc748d8ffedb87415904d16ajim # If filename.tmpl exists, but filename does not,
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben # build filename from the .tmpl
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb # If filename.tmpl exists, but filename does not,
b1476ba063e6d9577cd86db3db5dd98ff6bc78b9rbb # build filename from the .tmpl
2d2eda71267231c2526be701fe655db125852c1ffielding process_includes "${PKG_SOURCE_DIR}/${package}" ${df}.tmpl > ${df}
2d2eda71267231c2526be701fe655db125852c1ffielding if [[ -f prototype ]] ; then
2d2eda71267231c2526be701fe655db125852c1ffielding # Simple package with the same prototype on all platforms
2d2eda71267231c2526be701fe655db125852c1ffielding # Package with some platform-specific settings in prototype
2d2eda71267231c2526be701fe655db125852c1ffielding print_and_run /usr/bin/pkgmk -d ${PACKAGE_DIR}/${package} -f ${PROTOTYPE} -o ${PKGMK_VARS}
2d2eda71267231c2526be701fe655db125852c1ffielding print "******** Done Making the ${package} package ********"
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# Create an installdir with symlinks to built packages