make_release_packages revision 355
c80e152862cc3e3207dc837fde7116bd4c0e4b9dTinderbox User# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
8d1b3ceb4d491ce32572f1702f37ed585eede993Evan Hunt# Permission is hereby granted, free of charge, to any person obtaining a
d77cb075aae5595e460e3299bfc1e8ea5d42b560Evan Hunt# copy of this software and associated documentation files (the
d77cb075aae5595e460e3299bfc1e8ea5d42b560Evan Hunt# "Software"), to deal in the Software without restriction, including
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# to whom the Software is furnished to do so, provided that the above
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# the Software and that both the above copyright notice(s) and this
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# permission notice appear in supporting documentation.
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
002f1373374a0b72fc0329baa682917929bef168Tony Finch# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
002f1373374a0b72fc0329baa682917929bef168Tony Finch# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
73cf0ba4e82c6baef638ecc4e31321223f841d28Mark Andrews# Except as contained in this notice, the name of a copyright holder
73cf0ba4e82c6baef638ecc4e31321223f841d28Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
d8351dfc9b725b0d727be7acab6247d7d501d9a0Mark Andrews# or other dealings in this Software without prior written authorization
d8351dfc9b725b0d727be7acab6247d7d501d9a0Mark Andrews# of the copyright holder.
3a29ce9c08dd31709c73e7187aebda0d360c537bEvan Hunt# @(#)make_release_packages 1.56 08/03/07
5c78f1f50e53d8e2ed51a187efc2c9a0f43b4b1bMark Andrews# Create and fill a package staging area for X
f1740da065d4555039fe8bb53beb4153e3f94de3Mark Andrews# This script should be run from the base of the build tree.
f1740da065d4555039fe8bb53beb4153e3f94de3Mark Andrews# It takes no parameters.
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# cd /export/home/hammer1/WORKSPACES_S493_ALPHA2.1
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# ./make_release_packages
ad309e8dfa0601d6053aaa12770a98a6940f89deEvan Hunt# To build a subset of packages
ad309e8dfa0601d6053aaa12770a98a6940f89deEvan Hunt# env PACKAGE_LIST="packages" ./make_release_packages
fc04365d2f83f197c8a54545dd9cd4ce6a209940Mark Andrews# Make sure that we aren't affected by the personal environment of
fc04365d2f83f197c8a54545dd9cd4ce6a209940Mark Andrews# whoever is running this script
7cbac360bf98c0a52b2d6866ad887616c32d4d3aMark AndrewsPATH=/opt/SUNWspro/bin:/opt/SUNWguide/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:.
1cf118a656f5fd210787908b845362077fc507f8Evan Hunt# List of official (deliverable) X-window packages
1cf118a656f5fd210787908b845362077fc507f8Evan HuntXW_PACKAGE_LIST="SUNWxwcft SUNWxwdem SUNWxwdim SUNWxwfs SUNWxwinc \
1cf118a656f5fd210787908b845362077fc507f8Evan Hunt SUNWxwice SUNWxwopt SUNWxwpmn SUNWxwsrc SUNWxwacx SUNWxwdxm \
1cf118a656f5fd210787908b845362077fc507f8Evan Hunt SUNWxwhl SUNWi1of SUNWxwfa SUNWxwpft SUNWxwsrv SUNWxwoft \
1cf118a656f5fd210787908b845362077fc507f8Evan Hunt SUNWfontconfig SUNWfontconfig-root SUNWfontconfig-docs SUNWxwsvr \
6fb3db01acad7f5c1f4e23789fb0f2ce56cc07deMukund Sivaraman SUNWxscreensaver-hacks SUNWfreetype2 SUNWxwxft \
6fb3db01acad7f5c1f4e23789fb0f2ce56cc07deMukund Sivaraman SUNWxorg-clientlibs SUNWxorg-devel-docs SUNWxorg-headers \
6fb3db01acad7f5c1f4e23789fb0f2ce56cc07deMukund Sivaraman SUNWxorg-client-docs SUNWxorg-client-programs SUNWxorg-compatlinks \
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman SUNWxprint-server SUNWxcursor-themes SUNWvncviewer"
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman# L10N packages are normally only built on sparc since they only have text
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman# files that are the same for both platforms
4a53e3c2b83c476a93148eaee0272649beb221caMark Andrewsif [ "$MACH" = "sparc" -o "x$BUILD_L10N" = "xyes" ]; then
4a53e3c2b83c476a93148eaee0272649beb221caMark Andrews XW_L10N_PACKAGES="SUNW0xacx SUNW0xman SUNW0xpmn SUNW0xwfa SUNW0xwplt \
4a53e3c2b83c476a93148eaee0272649beb221caMark Andrews SUNW0xwopt SUNW0xwsvr"
4221d9cd1d02311fbf9b5f08a038f5af78b10b4aEvan Hunt# Which platform name do we use for 64-bit?
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont echo "Unknown architecture - not SPARC nor i386."
929329d2d66a7e1083c70a9c918381935bf12799Mukund Sivaraman# Trusted Extensions packages
ec29d217ba3a2bf3e617a7b5b6708ae221bee999Mark Andrews# Packages with platform-specific prototype files, including those with
afefd754734f896bf3e0590177fff83e7cdfdf35Mark Andrews# 64-bit libraries
afefd754734f896bf3e0590177fff83e7cdfdf35Mark AndrewsXW_PLT_PACKAGE="SUNWxwplt SUNWxwplr SUNWxwfnt SUNWxwrtl SUNWxwslb \
afefd754734f896bf3e0590177fff83e7cdfdf35Mark Andrews SUNWxwmod SUNWxscreensaver-hacks-gl SUNWxwman SUNWxwfsw \
f0353a586c2bfbae999193cb644b6bc94c7944d8Mark Andrews SUNWxorg-server SUNWxorg-graphics-ddx SUNWxorg-doc SUNWxorg-cfg \
f0353a586c2bfbae999193cb644b6bc94c7944d8Mark Andrews SUNWxsun-server SUNWxvnc $TSOL_PACKAGE"
7ff28f5befbee76048a23e504dcd3f9a44ce6209Evan Hunt# Some packages are only built for certain platforms currently
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews# To build a subset of packages
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews# PACKAGE_LIST="packages" make_release_packages
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews: ${PACKAGE_LIST:="$XW_PACKAGE_LIST $XW_PLT_PACKAGE $EXTRA_PACKAGES $XW_L10N_PACKAGES"}
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrews# Get build version from pkgversion
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrewsif [ -f pkgversion ] ; then
cb616c6d5c2ece1fac37fa6e0bca2b53d4043098Mark Andrews echo "Error: $SOURCEDIR/packages/pkgversion not found. Cannot continue."
534057c9f91a3eb6e0541f3526459c716239b337Mark Andrews echo "VERSION not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
0f14b041328c062b1fa391887376388dfc8b2fe5Mark Andrews echo "BUILD not set in $SOURCEDIR/packages/pkgversion - run newPkRev"
1848d38f441ebf70ab21f6151bc3487a92d25b63Mark AndrewsDECIMAL_BUILD=`echo ${BUILD} | awk '{print $1 / 100.0}'`
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrewsecho "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
e01ef6f01c7e8f80122cd80a2e011425a0135489Mark Andrews# Next, create the staging area. Make sure that the logs directory
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# is writeable by everyone because it is likely that we will need to
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# write into it as root across an NFS link...
124cc0660c7eff8021c2422fb47441e9ca08b3f9Tinderbox Userecho 'Removing old proto-packages and recreating'
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# Now copy the package description info
bf459d24a117ae2c54c37016430b41cd6d73491cMark Andrewsecho 'Copying package descriptions'
bf459d24a117ae2c54c37016430b41cd6d73491cMark Andrews# We can't just use `sccs get SCCS' because it will punt if it hits
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# a file which is being edited (writeable).
f53e0bda467d96dfeeba1b4da30c37b37766bb75Evan Hunt/bin/cp copyright depend i.* r.* $PACKAGE_DIR >/dev/null 2>&1
64d7fa3ec4785b390665860aa6bdae304b3c1d24Mark Andrews # See above about sccs usage
75505befa93c993aa5d2df24a2b64eac0c34cbffMark Andrews /bin/cp p* d* lib* i.* r.* M* $PACKAGE_DIR/$package >/dev/null 2>&1
a38f07c73790170842e4523b4a474d01ca0dede1Michał Kępień # We keep the master copyright in the top-level copyright file
a38f07c73790170842e4523b4a474d01ca0dede1Michał Kępień # Packages that need additional copyright have copyright.add files
a38f07c73790170842e4523b4a474d01ca0dede1Michał Kępień # that we then merge here
39d5523a8afc73cbdb4fa426de2ce071267a5d6fMark Andrews cp ../copyright $PACKAGE_DIR/$package/copyright
39d5523a8afc73cbdb4fa426de2ce071267a5d6fMark Andrews if [ -f copyright.add ] ; then
1f4a3c7088594d1b64cd734eb69e1fd023fde8bfMichał Kępień'BEGIN { PROTODIR = ENVIRON [ "PROTODIR" ]; }
91827e6fd3851a5fe129ef5409ff45833ca01a0eMark Andrews system("cat " PROTODIR "/licenses/" $2)
35aae5884f410180706a89a9715bf9a85eeeb4b7Michał Kępień copyright.add >> $PACKAGE_DIR/$package/copyright
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# Now move into the package staging area and build the packages.
c7e57ce1b0bca9bc7da14bec485f7a7e3e4c761fMichał Kępieńecho '---Building packages'
c7e57ce1b0bca9bc7da14bec485f7a7e3e4c761fMichał KępieńXW_PLT_PAT="`echo $XW_PLT_PACKAGE | tr ' ' '|'`"
3ed16e796dba90c96933c8a8a3f5b9404d8d3e61Mark Andrews# Variables to pass to pkgmk for use in prototype files
3ed16e796dba90c96933c8a8a3f5b9404d8d3e61Mark Andrews# They must start with lowercase letters to be resolved at pkgmk time
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo "******** Making the $package package ********"
eeb919b6f572e033d97cf001e4cd44aaff54e5dcMichał Kępień cat pkginfo.tmpl | sed -e '/ARCH/s/ISA/'$MACH'/' -e 's/SUNW_PRODVERS=.*$/SUNW_PRODVERS='${VERSION}/ -e 's/VERSION=.*$/VERSION='${VERSION}.${BUILD},REV=${DATE}/ > pkginfo
eeb919b6f572e033d97cf001e4cd44aaff54e5dcMichał Kępień if [ -f Makefile ]; then
a55438eda32ecebf43ead45b216662b7923a465fMark Andrews /usr/ccs/bin/make SOURCEDIR=$SOURCEDIR/packages all
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt eval "case $package in
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt if [ ! -f prototype_$MACH ]; then
9789e54e55b61b669fb31a8b70e9655e8357dda2Mark Andrews ln -s prototype_com prototype_$MACH
f8362536c647625e602c8450a778a2b7ba90c9f4Mark Andrews echo /usr/bin/pkgmk -f prototype_$MACH -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
f8362536c647625e602c8450a778a2b7ba90c9f4Mark Andrews /usr/bin/pkgmk -f prototype_$MACH -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
24231e53a5c3079431f84dcddfee1e761fec7329Mark Andrews echo /usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
24231e53a5c3079431f84dcddfee1e761fec7329Mark Andrews /usr/bin/pkgmk -d $PACKAGE_DIR/$package -o ${PKGMK_VARS}
4b669b69bae7dedda2faa09a7ade247499c1d49cMichał Kępień echo "******** Done Making the $package package ********"
01967d183990e44752fe61f193dab9c04c3afd9cEvan Huntgrep -c "Packaging was not successful" $PACKAGE_DIR/$LOGfile
01967d183990e44752fe61f193dab9c04c3afd9cEvan Hunt# Create an installdir with symlinks to SUNW* pkgs