make_release_packages
changeset 355 a3a81e9c227d
parent 247 eec255d17972
child 368 2e973147eca2
--- a/make_release_packages	Fri Mar 07 15:38:30 2008 -0800
+++ b/make_release_packages	Fri Mar 07 15:12:44 2008 -0800
@@ -27,7 +27,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 # 
-# @(#)make_release_packages	1.55 07/11/06
+# @(#)make_release_packages	1.56 08/03/07
 #
 #	Create and fill a package staging area for X
 #
@@ -134,6 +134,12 @@
 DECIMAL_BUILD=`echo ${BUILD} | awk '{print $1 / 100.0}'`
 echo "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
 
+if [ "$MACH" = "sparc" ]; then
+    PROTODIR=$SOURCEDIR/proto-sun4-svr4
+else
+    PROTODIR=$SOURCEDIR/proto-${MACH}-svr4
+fi
+
 #   Next, create the staging area.  Make sure that the logs directory
 #   is writeable by everyone because it is likely that we will need to
 #   write into it as root across an NFS link...
@@ -174,10 +180,18 @@
     # 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
+    
     if [ -f copyright.add ] ; then
-	cat ../copyright copyright.add > $PACKAGE_DIR/$package/copyright
-    else
-	cp ../copyright $PACKAGE_DIR/$package/copyright
+	chmod +w $PACKAGE_DIR/$package/copyright
+	PROTODIR=$PROTODIR nawk \
+'BEGIN   { PROTODIR = ENVIRON [ "PROTODIR" ]; }
+/^include / {
+        system("cat " PROTODIR "/licenses/" $2)
+        next
+}
+{ print }' \
+	    copyright.add >> $PACKAGE_DIR/$package/copyright
     fi
     cd ..
 done
@@ -186,13 +200,7 @@
 #   Now move into the package staging area and build the packages.
 cd $PACKAGE_DIR
 
-if [ "$MACH" = "sparc" ]; then
-    PROTODIR=$SOURCEDIR/proto-sun4-svr4
-else
-    PROTODIR=$SOURCEDIR/proto-${MACH}-svr4
-fi
-
-for D in etc usr var lib ; do
+for D in etc usr var lib licenses ; do
     /bin/rm -f $D
     /bin/ln -s $PROTODIR/$D $D
 done