make_release_packages revision 577
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "Software"), to deal in the Software without restriction, including
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without limitation the rights to use, copy, modify, merge, publish,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# distribute, and/or sell copies of the Software, and to permit persons
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# to whom the Software is furnished to do so, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copyright notice(s) and this permission notice appear in all copies of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the Software and that both the above copyright notice(s) and this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# permission notice appear in supporting documentation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Except as contained in this notice, the name of a copyright holder
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# shall not be used in advertising or otherwise to promote the sale, use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or other dealings in this Software without prior written authorization
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# of the copyright holder.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# @(#)make_release_packages 1.63 08/10/30
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Create and fill a package staging area for X
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This script should be run from the base of the build tree.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# It takes no parameters.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ./make_release_packages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# To build a subset of packages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ./make_release_packages packages
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater# env PACKAGE_LIST="packages" ./make_release_packages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Make sure that we aren't affected by the personal environment of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# whoever is running this script
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater# List of official (deliverable) X-window packages for all platforms
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic UpdaterXW_PACKAGE_LIST="SUNWfontconfig SUNWfontconfig-docs SUNWfontconfig-root
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein SUNWpciaccess SUNWpixman SUNWfreetype2 SUNWvncviewer SUNWxcursor-themes
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxorg-cfg SUNWxorg-client-docs SUNWxorg-client-programs
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxorg-clientlibs SUNWxorg-compatlinks SUNWxorg-devel-docs
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxorg-doc SUNWxorg-graphics-ddx SUNWxorg-headers
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxorg-server SUNWxorg-tsol-module SUNWxprint-server
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxscreensaver-hacks SUNWxscreensaver-hacks-gl SUNWxsun-server
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNWxvnc SUNWxwacx SUNWxwcft SUNWxwdem SUNWxwdim SUNWxwdxm
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein SUNWxwfnt SUNWxwfs SUNWxwfsw SUNWxwhl SUNWxwice SUNWxwinc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein SUNWxwman SUNWxwmod SUNWxwoft SUNWxwopt SUNWxwpft SUNWxwplr
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews SUNWxwplt SUNWxwpmn SUNWxwrtl SUNWxwslb SUNWxwsrv SUNWxwsvr
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein SUNWxwts SUNWxwxft"
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater# Some packages are only built for certain platforms currently
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxwpsr"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein XW_PACKAGE_LIST="$XW_PACKAGE_LIST SUNWxorg-mesa"
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater# Localization template packages for delivery to translation teams
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater SUNW0xwplt SUNW0xwopt SUNW0xwsvr"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FSW* packages are built for the OpenSolaris (Project Indiana) deliveries
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-core
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-cyrillic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-daewoo
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-ethiopic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-iso8859-2
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-iso8859-3
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-iso8859-4
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-iso8859-9
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein FSWxorg-fonts-iso8859-10
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-iso8859-13
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-iso8859-14
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-iso8859-16
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-jiskan
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-syriac
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater FSWxorg-fonts-vera
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater# To build a subset of packages:
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater# make_release_packages packages
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater# env PACKAGE_LIST="packages" make_release_packages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein : ${PACKAGE_LIST:="$XW_PACKAGE_LIST $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater### Functions for use later
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Which platform name do we use for 64-bit?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein *) fatal_error "Unknown architecture - not SPARC nor i386." ;;
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater# Get build version from pkgversion
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinif [[ -f pkgversion ]] ; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein fatal_error "${PKG_SOURCE_DIR}/pkgversion not found. Cannot continue."
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinif [[ -z "${VERSION}" ]] ; then
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic Updater fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updaterif [[ -z "${BUILD}" ]] ; then
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinprint "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Next, create the staging area.
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updaterprint 'Removing old proto-packages and recreating'
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater# Now copy the package description info
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updaterprint 'Copying package descriptions'
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews/bin/cp copyright depend i.* r.* ${PACKAGE_DIR} >/dev/null 2>&1
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater /bin/cp p* d* lib* i.* r.* M* ${PACKAGE_DIR}/${package} >/dev/null 2>&1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # We keep the master copyright in the top-level copyright file
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Packages that need additional copyright have copyright.add files
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # that we then merge here
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp ../copyright ${PACKAGE_DIR}/${package}/copyright
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater for F in copyright.add copyright.add.${MACH} ; do
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater if [[ -f $F ]] ; then
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater chmod +w ${PACKAGE_DIR}/${package}/copyright
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein 'BEGIN { PROTODIR = ENVIRON [ "PROTODIR" ]; }
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /^include / {
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater system("cat " PROTODIR "/licenses/" $2)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein { print }' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Now move into the package staging area and build the packages.
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsprint -- '---Building packages'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Variables to pass to pkgmk for use in prototype files
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# They must start with lowercase letters to be resolved at pkgmk time
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews print "******** Making the ${package} package ********"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sed -e '/ARCH/s/ISA/'${MACH}'/' -e 's/SUNW_PRODVERS=.*$/SUNW_PRODVERS='${VERSION}/ -e 's/VERSION=.*$/VERSION='${VERSION}.${BUILD},REV=${DATE}/ pkginfo.tmpl > pkginfo
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews if [[ -f Makefile ]] ; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews print_and_run /usr/ccs/bin/make SOURCEDIR=${PKG_SOURCE_DIR} all
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater for pf in preinstall preremove postinstall postremove ; do
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater # If filename.tmpl exists, but filename does not,
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater # build filename from the .tmpl
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews if [[ -f "${pf}.tmpl" && ! -f "${pf}" ]] ; then
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater if [[ -f prototype ]] ; then
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater # Simple package with the same prototype on all platforms
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Package with some platform-specific settings in prototype
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print_and_run /usr/bin/pkgmk -d ${PACKAGE_DIR}/${package} -f ${PROTOTYPE} -o ${PKGMK_VARS}
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "******** Done Making the ${package} package ********"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinprint -n "Packages built: "
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingrep -c "Packaging complete" ${PACKAGE_DIR}/$LOGfile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinprint -n "Packages failed: "
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingrep -c "Packaging was not successful" ${PACKAGE_DIR}/$LOGfile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Create an installdir with symlinks to built packages
cd ${PACKAGE_DIR}
cd installdir