OLD | NEW |
1 #! /bin/sh | 1 #! /bin/sh |
2 | 2 |
3 # This script takes the result of "make dist" and: | 3 # This script takes the result of "make dist" and: |
4 # 1) Unpacks it. | 4 # 1) Unpacks it. |
5 # 2) Ensures all contents are user-writable. Some version control systems | 5 # 2) Ensures all contents are user-writable. Some version control systems |
6 # keep code read-only until you explicitly ask to edit it, and the normal | 6 # keep code read-only until you explicitly ask to edit it, and the normal |
7 # "make dist" process does not correct for this, so the result is that | 7 # "make dist" process does not correct for this, so the result is that |
8 # the entire dist is still marked read-only when unpacked, which is | 8 # the entire dist is still marked read-only when unpacked, which is |
9 # annoying. So, we fix it. | 9 # annoying. So, we fix it. |
10 # 3) Convert MSVC project files to MSVC 2005, so that anyone who has version | 10 # 3) Convert MSVC project files to MSVC 2005, so that anyone who has version |
11 # 2005 *or* 2008 can open them. (In version control, we keep things in | 11 # 2005 *or* 2008 can open them. (In version control, we keep things in |
12 # MSVC 2008 format since that's what we use in development.) | 12 # MSVC 2008 format since that's what we use in development.) |
13 # 4) Uses the result to create .tar.gz, .tar.bz2, and .zip versions and | 13 # 4) Uses the result to create .tar.gz, .tar.bz2, and .zip versions and |
14 # deposites them in the "dist" directory. In the .zip version, all | 14 # deposites them in the "dist" directory. In the .zip version, all |
15 # non-testdata .txt files are converted to Windows-style line endings. | 15 # non-testdata .txt files are converted to Windows-style line endings. |
16 # 5) Cleans up after itself. | 16 # 5) Cleans up after itself. |
17 | 17 |
18 if [ "$1" == "" ]; then | 18 if [ "$1" == "" ]; then |
19 echo "USAGE: $0 DISTFILE" >&2 | 19 echo "USAGE: $0 DISTFILE" >&2 |
20 exit 1 | 20 exit 1 |
21 fi | 21 fi |
22 | 22 |
23 if [ ! -e $1 ]; then | 23 if [ ! -e $1 ]; then |
24 echo $1": File not found." >&2 | 24 echo $1": File not found." >&2 |
25 exit 1 | 25 exit 1 |
26 fi | 26 fi |
27 | 27 |
28 set -ex | 28 set -ex |
29 | 29 |
30 LANGUAGES="cpp csharp java javanano js objectivec python ruby" | 30 LANGUAGES="cpp csharp java javanano js objectivec python ruby php" |
31 BASENAME=`basename $1 .tar.gz` | 31 BASENAME=`basename $1 .tar.gz` |
32 VERSION=${BASENAME:9} | 32 VERSION=${BASENAME:9} |
33 | 33 |
34 # Create a directory called "dist", copy the tarball there and unpack it. | 34 # Create a directory called "dist", copy the tarball there and unpack it. |
35 mkdir dist | 35 mkdir dist |
36 cp $1 dist | 36 cp $1 dist |
37 cd dist | 37 cd dist |
38 tar zxvf $BASENAME.tar.gz | 38 tar zxvf $BASENAME.tar.gz |
39 rm $BASENAME.tar.gz | 39 rm $BASENAME.tar.gz |
40 | 40 |
(...skipping 14 matching lines...) Expand all Loading... |
55 | 55 |
56 for LANG in $LANGUAGES; do | 56 for LANG in $LANGUAGES; do |
57 # Build the dist again in .zip | 57 # Build the dist again in .zip |
58 ./configure DIST_LANG=$LANG | 58 ./configure DIST_LANG=$LANG |
59 make dist-zip | 59 make dist-zip |
60 mv $BASENAME.zip ../protobuf-$LANG-$VERSION.zip | 60 mv $BASENAME.zip ../protobuf-$LANG-$VERSION.zip |
61 done | 61 done |
62 | 62 |
63 cd .. | 63 cd .. |
64 rm -rf $BASENAME | 64 rm -rf $BASENAME |
OLD | NEW |