2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is the Netscape Portable Runtime (NSPR).
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998-2001
20 # the Initial Developer. All Rights Reserved.
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
38 # ------------------------------------------------------------------
39 # repackage.sh -- Repackage NSPR from /s/b/c to mozilla.org format
41 # syntax: repackage.sh
44 # repackage.sh creates NSPR binary distributions for mozilla.org from
45 # the internal binary distributions in /share/builds/components/nspr20.
46 # There are reasons why we can't just push the internal binary distributions
47 # to mozilla.org. External developers prefer to use the common archive
48 # file format for their platforms, rather than the jar files we use internally.
50 # On Unix, we create a tar.gz file. On Windows, we create a zip file.
51 # For example: NSPR 4.1.1, these would be nspr-4.1.1.tar.gz and nspr-4.1.1.zip.
53 # When unpacked, nspr-4.1.1.tar.gz or nspr-4.1.1.zip should expand to a
54 # nspr-4.1.1 directory that contains three subdirectories: include, lib,
55 # and bin. The header files, with the correct line endings for the
56 # platform, are in nspr-4.1.1/include. The libraries are in nspr-4.1.1/lib.
57 # The executable programs are in nspr-4.1.1/bin.
59 # Note! Files written with Gnu tar are not readable by some non-Gnu
60 # versions. Sun, in particular.
65 # ------------------------------------------------------------------
67 FROMTOP
=/share
/builds
/components
/nspr20
/v4.7
.4
70 SOURCETAG
=NSPR_4_7_4_RTM
73 # enumerate Unix object directories on /s/b/c
75 HP-UXB.11.11_64_DBG.OBJ
76 HP-UXB.11.11_64_OPT.OBJ
79 HP-UXB.11.23_ia64_32_DBG.OBJ
80 HP-UXB.11.23_ia64_32_OPT.OBJ
81 HP-UXB.11.23_ia64_64_DBG.OBJ
82 HP-UXB.11.23_ia64_64_OPT.OBJ
83 Linux2.4_x86_glibc_PTH_DBG.OBJ
84 Linux2.4_x86_glibc_PTH_OPT.OBJ
85 Linux2.6_x86_64_glibc_PTH_DBG.OBJ
86 Linux2.6_x86_64_glibc_PTH_OPT.OBJ
87 Linux2.6_x86_glibc_PTH_DBG.OBJ
88 Linux2.6_x86_glibc_PTH_OPT.OBJ
95 # enumerate Windows object directories on /s/b/c
106 # Create the destination directory.
108 echo "removing directory $TOTOP"
110 echo "creating directory $TOTOP"
114 # Generate the tar.gz files for Unix platforms.
116 for OBJDIR
in $UNIX_OBJDIRS; do
117 echo "removing directory $NSPRDIR"
119 echo "creating directory $NSPRDIR"
122 echo "creating directory $NSPRDIR/include"
123 mkdir
$NSPRDIR/include
124 echo "copying $FROMTOP/$OBJDIR/include"
125 cp -r $FROMTOP/$OBJDIR/include
$NSPRDIR
127 echo "copying $FROMTOP/$OBJDIR/lib"
128 cp -r $FROMTOP/$OBJDIR/lib
$NSPRDIR
130 echo "copying $FROMTOP/$OBJDIR/bin"
131 cp -r $FROMTOP/$OBJDIR/bin
$NSPRDIR
133 echo "creating directory $TOTOP/$OBJDIR"
135 echo "creating $TOTOP/$OBJDIR/$NSPRDIR.tar"
136 tar cvf
$TOTOP/$OBJDIR/$NSPRDIR.
tar $NSPRDIR
137 echo "gzipping $TOTOP/$OBJDIR/$NSPRDIR.tar"
138 gzip $TOTOP/$OBJDIR/$NSPRDIR.
tar
142 # Generate the zip files for Windows platforms.
144 for OBJDIR
in $WIN_OBJDIRS; do
145 echo "removing directory $NSPRDIR"
147 echo "creating directory $NSPRDIR"
150 echo "creating directory $NSPRDIR/include"
151 mkdir
$NSPRDIR/include
152 echo "creating directory $NSPRDIR/include/private"
153 mkdir
$NSPRDIR/include
/private
154 echo "creating directory $NSPRDIR/include/obsolete"
155 mkdir
$NSPRDIR/include
/obsolete
157 # copy headers and adjust unix line-end to Windows line-end
158 # Note: Watch out for the "sed" command line.
159 # when editing the command, take care to preserve the "^M" as the literal
160 # cntl-M character! in vi, use "cntl-v cntl-m" to enter it!
162 headers
=`ls $FROMTOP/$OBJDIR/include/*.h`
163 for header
in $headers; do
164 sed -e 's/$/
/g' $header > $NSPRDIR/include
/`basename $header`
166 headers
=`ls $FROMTOP/$OBJDIR/include/obsolete/*.h`
167 for header
in $headers; do
168 sed -e 's/$/
/g' $header > $NSPRDIR/include
/obsolete
/`basename $header`
170 headers
=`ls $FROMTOP/$OBJDIR/include/private/*.h`
171 for header
in $headers; do
172 sed -e 's/$/
/g' $header > $NSPRDIR/include
/private
/`basename $header`
175 echo "copying $FROMTOP/$OBJDIR/lib"
176 cp -r $FROMTOP/$OBJDIR/lib
$NSPRDIR
178 echo "copying $FROMTOP/$OBJDIR/bin"
179 cp -r $FROMTOP/$OBJDIR/bin
$NSPRDIR
181 echo "creating directory $TOTOP/$OBJDIR"
182 mkdir
-p $TOTOP/$OBJDIR
183 echo "creating $TOTOP/$OBJDIR/$NSPRDIR.zip"
184 zip -r $TOTOP/$OBJDIR/$NSPRDIR.
zip $NSPRDIR
188 # package the source from CVS
190 echo "Packaging source"
191 echo "removing directory $NSPRDIR"
193 echo "creating directory $NSPRDIR"
197 echo "Pulling source from CVS with tag $SOURCETAG"
198 cvs co
-r $SOURCETAG mozilla
/nsprpub
201 echo "Creating source tar file: $TOTOP/src/$NSPRDIR.tar"
202 tar cvf
$TOTOP/src
/$NSPRDIR.
tar $NSPRDIR
203 echo "gzip $TOTOP/src/$NSPRDIR.tar"
204 gzip $TOTOP/src
/$NSPRDIR.
tar
207 # Remove the working directory.
209 echo "removing directory $NSPRDIR"
211 # --- end repackage.sh ---------------------------------------------