1 | #! /bin/sh
|
---|
2 | # ***** BEGIN LICENSE BLOCK *****
|
---|
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
4 | #
|
---|
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/
|
---|
9 | #
|
---|
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
|
---|
13 | # License.
|
---|
14 | #
|
---|
15 | # The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
16 | #
|
---|
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.
|
---|
21 | #
|
---|
22 | # Contributor(s):
|
---|
23 | #
|
---|
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.
|
---|
35 | #
|
---|
36 | # ***** END LICENSE BLOCK *****
|
---|
37 |
|
---|
38 | # ------------------------------------------------------------------
|
---|
39 | # repackage.sh -- Repackage NSPR from /s/b/c to mozilla.org format
|
---|
40 | #
|
---|
41 | # syntax: repackage.sh
|
---|
42 | #
|
---|
43 | # Description:
|
---|
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.
|
---|
49 | #
|
---|
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.
|
---|
52 | #
|
---|
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.
|
---|
58 | #
|
---|
59 | # Note! Files written with Gnu tar are not readable by some non-Gnu
|
---|
60 | # versions. Sun, in particular.
|
---|
61 | #
|
---|
62 | #
|
---|
63 | #
|
---|
64 | #
|
---|
65 | # ------------------------------------------------------------------
|
---|
66 |
|
---|
67 | FROMTOP=/share/builds/components/nspr20/v4.5
|
---|
68 | TOTOP=./v4.5
|
---|
69 | NSPRDIR=nspr-4.5
|
---|
70 | SOURCETAG=NSPR_4_5_RTM
|
---|
71 |
|
---|
72 | #
|
---|
73 | # enumerate Unix object directories on /s/b/c
|
---|
74 | UNIX_OBJDIRS="
|
---|
75 | AIX4.3_64_DBG.OBJ
|
---|
76 | AIX4.3_64_OPT.OBJ
|
---|
77 | AIX4.3_DBG.OBJ
|
---|
78 | AIX4.3_OPT.OBJ
|
---|
79 | HP-UXB.11.00_64_DBG.OBJ
|
---|
80 | HP-UXB.11.00_64_OPT.OBJ
|
---|
81 | HP-UXB.11.00_DBG.OBJ
|
---|
82 | HP-UXB.11.00_OPT.OBJ
|
---|
83 | IRIX6.5_n32_PTH_DBG.OBJ
|
---|
84 | IRIX6.5_n32_PTH_OPT.OBJ
|
---|
85 | Linux2.2_x86_glibc_PTH_DBG.OBJ
|
---|
86 | Linux2.2_x86_glibc_PTH_OPT.OBJ
|
---|
87 | Linux2.4_x86_glibc_PTH_DBG.OBJ
|
---|
88 | Linux2.4_x86_glibc_PTH_OPT.OBJ
|
---|
89 | OSF1V5.0_DBG.OBJ
|
---|
90 | OSF1V5.0_OPT.OBJ
|
---|
91 | SunOS5.6_DBG.OBJ
|
---|
92 | SunOS5.6_OPT.OBJ
|
---|
93 | SunOS5.8_64_DBG.OBJ
|
---|
94 | SunOS5.8_64_OPT.OBJ
|
---|
95 | SunOS5.8_DBG.OBJ
|
---|
96 | SunOS5.8_OPT.OBJ
|
---|
97 | "
|
---|
98 | #
|
---|
99 | # enumerate Windows object directories on /s/b/c
|
---|
100 | WIN_OBJDIRS="
|
---|
101 | WIN954.0_DBG.OBJ
|
---|
102 | WIN954.0_DBG.OBJD
|
---|
103 | WIN954.0_OPT.OBJ
|
---|
104 | WINNT4.0_DBG.OBJ
|
---|
105 | WINNT4.0_DBG.OBJD
|
---|
106 | WINNT4.0_OPT.OBJ
|
---|
107 | "
|
---|
108 |
|
---|
109 | #
|
---|
110 | # Create the destination directory.
|
---|
111 | #
|
---|
112 | echo "removing directory $TOTOP"
|
---|
113 | rm -rf $TOTOP
|
---|
114 | echo "creating directory $TOTOP"
|
---|
115 | mkdir -p $TOTOP
|
---|
116 |
|
---|
117 | #
|
---|
118 | # Generate the tar.gz files for Unix platforms.
|
---|
119 | #
|
---|
120 | for OBJDIR in $UNIX_OBJDIRS; do
|
---|
121 | echo "removing directory $NSPRDIR"
|
---|
122 | rm -rf $NSPRDIR
|
---|
123 | echo "creating directory $NSPRDIR"
|
---|
124 | mkdir $NSPRDIR
|
---|
125 |
|
---|
126 | echo "creating directory $NSPRDIR/include"
|
---|
127 | mkdir $NSPRDIR/include
|
---|
128 | echo "copying $FROMTOP/$OBJDIR/include"
|
---|
129 | cp -r $FROMTOP/$OBJDIR/include $NSPRDIR
|
---|
130 |
|
---|
131 | echo "copying $FROMTOP/$OBJDIR/lib"
|
---|
132 | cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
|
---|
133 |
|
---|
134 | echo "copying $FROMTOP/$OBJDIR/bin"
|
---|
135 | cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
|
---|
136 |
|
---|
137 | echo "creating directory $TOTOP/$OBJDIR"
|
---|
138 | mkdir $TOTOP/$OBJDIR
|
---|
139 | echo "creating $TOTOP/$OBJDIR/$NSPRDIR.tar"
|
---|
140 | tar cvf $TOTOP/$OBJDIR/$NSPRDIR.tar $NSPRDIR
|
---|
141 | echo "gzipping $TOTOP/$OBJDIR/$NSPRDIR.tar"
|
---|
142 | gzip $TOTOP/$OBJDIR/$NSPRDIR.tar
|
---|
143 | done
|
---|
144 |
|
---|
145 | #
|
---|
146 | # Generate the zip files for Windows platforms.
|
---|
147 | #
|
---|
148 | for OBJDIR in $WIN_OBJDIRS; do
|
---|
149 | echo "removing directory $NSPRDIR"
|
---|
150 | rm -rf $NSPRDIR
|
---|
151 | echo "creating directory $NSPRDIR"
|
---|
152 | mkdir $NSPRDIR
|
---|
153 |
|
---|
154 | echo "creating directory $NSPRDIR/include"
|
---|
155 | mkdir $NSPRDIR/include
|
---|
156 | echo "creating directory $NSPRDIR/include/private"
|
---|
157 | mkdir $NSPRDIR/include/private
|
---|
158 | echo "creating directory $NSPRDIR/include/obsolete"
|
---|
159 | mkdir $NSPRDIR/include/obsolete
|
---|
160 |
|
---|
161 | # copy headers and adjust unix line-end to Windows line-end
|
---|
162 | # Note: Watch out for the "sed" command line.
|
---|
163 | # when editing the command, take care to preserve the "^M" as the literal
|
---|
164 | # cntl-M character! in vi, use "cntl-v cntl-m" to enter it!
|
---|
165 | #
|
---|
166 | headers=`ls $FROMTOP/$OBJDIR/include/*.h`
|
---|
167 | for header in $headers; do
|
---|
168 | sed -e 's/$/
|
---|
169 | /g' $header > $NSPRDIR/include/`basename $header`
|
---|
170 | done
|
---|
171 | headers=`ls $FROMTOP/$OBJDIR/include/obsolete/*.h`
|
---|
172 | for header in $headers; do
|
---|
173 | sed -e 's/$/
|
---|
174 | /g' $header > $NSPRDIR/include/obsolete/`basename $header`
|
---|
175 | done
|
---|
176 | headers=`ls $FROMTOP/$OBJDIR/include/private/*.h`
|
---|
177 | for header in $headers; do
|
---|
178 | sed -e 's/$/
|
---|
179 | /g' $header > $NSPRDIR/include/private/`basename $header`
|
---|
180 | done
|
---|
181 |
|
---|
182 | echo "copying $FROMTOP/$OBJDIR/lib"
|
---|
183 | cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
|
---|
184 |
|
---|
185 | echo "copying $FROMTOP/$OBJDIR/bin"
|
---|
186 | cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
|
---|
187 |
|
---|
188 | echo "creating directory $TOTOP/$OBJDIR"
|
---|
189 | mkdir $TOTOP/$OBJDIR
|
---|
190 | echo "creating $TOTOP/$OBJDIR/$NSPRDIR.zip"
|
---|
191 | zip -r $TOTOP/$OBJDIR/$NSPRDIR.zip $NSPRDIR
|
---|
192 | done
|
---|
193 |
|
---|
194 | #
|
---|
195 | # package the source from CVS
|
---|
196 | #
|
---|
197 | echo "Packaging source"
|
---|
198 | echo "removing directory $NSPRDIR"
|
---|
199 | rm -rf $NSPRDIR
|
---|
200 | echo "creating directory $NSPRDIR"
|
---|
201 | mkdir $NSPRDIR
|
---|
202 | myWD=`pwd`
|
---|
203 | cd $NSPRDIR
|
---|
204 | echo "Pulling source from CVS with tag $SOURCETAG"
|
---|
205 | cvs co -r $SOURCETAG mozilla/nsprpub
|
---|
206 | cd $myWD
|
---|
207 | mkdir $TOTOP/src
|
---|
208 | echo "Creating source tar file: $TOTOP/src/$NSPRDIR.tar"
|
---|
209 | tar cvf $TOTOP/src/$NSPRDIR.tar $NSPRDIR
|
---|
210 | echo "gzip $TOTOP/src/$NSPRDIR.tar"
|
---|
211 | gzip $TOTOP/src/$NSPRDIR.tar
|
---|
212 |
|
---|
213 | #
|
---|
214 | # Remove the working directory.
|
---|
215 | #
|
---|
216 | echo "removing directory $NSPRDIR"
|
---|
217 | rm -rf $NSPRDIR
|
---|
218 | # --- end repackage.sh ---------------------------------------------
|
---|