Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / maketgz
bloba378826a7009c7a2b8d32ed04c8308c0f33acd47
1 #! /bin/sh
2 # Script to build release-archives with
5 version=$1
7 if [ -z "$version" ]; then
8 echo "Specify a version number!"
9 exit
12 libversion="$version"
14 # we make curl the same version as libcurl
15 curlversion=$libversion
17 major=`echo $libversion |cut -d. -f1 | sed -e "s/[^0-9]//g"`
18 minor=`echo $libversion |cut -d. -f2 | sed -e "s/[^0-9]//g"`
19 patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
21 numeric=`perl -e 'printf("%02x%02x%02x\n", '"$major, $minor, $patch);"`
23 HEADER=include/curl/curlver.h
24 CHEADER=src/version.h
26 # requires a date command that knows -u for UTC time zone
27 datestamp=`date -u`
29 # Replace version number in header file:
30 sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
31 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
32 -e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
33 -e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \
34 -e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
35 -e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \
36 $HEADER >$HEADER.dist
38 # Replace version number in header file:
39 sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist
41 echo "generate VC8 makefiles"
42 # Generate VC8 versions from the VC6 Makefile versions
43 perl -pe 's%/GX /DWIN32 /YX%/EHsc /DWIN32%;' -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' lib/Makefile.vc6 > lib/Makefile.vc8.dist
44 perl -pe "s%/GX /DWIN32 /YX%/EHsc /DWIN32%;" -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' -e 's/^#MANIFESTTOOL/MANIFESTTOOL/' src/Makefile.vc6 > src/Makefile.vc8.dist
46 # Replace version number in plist file:
47 PLIST=lib/libcurl.plist
48 sed "s/7\.12\.3/$libversion/g" $PLIST > $PLIST.dist
50 echo "curl version $curlversion"
51 echo "libcurl version $libversion"
52 echo "libcurl numerical $numeric"
53 echo "datestamp $datestamp"
55 findprog()
57 file="$1"
58 for part in `echo $PATH| tr ':' ' '`; do
59 path="$part/$file"
60 if [ -x "$path" ]; then
61 # there it is!
62 return 1
64 done
66 # no such executable
67 return 0
70 echo "maketgz: cp lib/config.h.in src/config.h.in"
71 cp lib/config.h.in src/config.h.in
73 ############################################################################
75 # Enforce a rerun of configure (updates the VERSION)
78 echo "Re-running config.status"
79 ./config.status --recheck >/dev/null
81 ############################################################################
83 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
84 # been modified.
87 if { findprog automake >/dev/null 2>/dev/null; } then
88 echo "- Could not find or run automake, I hope you know what you're doing!"
89 else
90 echo "Runs automake --include-deps"
91 automake --include-deps Makefile >/dev/null
94 ############################################################################
96 # Make sure we have updated HTML versions of all man pages:
98 echo "make html"
99 make -s html
101 # And the PDF versions
102 echo "make pdf"
103 make -s pdf
105 ############################################################################
107 # Now run make dist to generate a tar.gz archive
110 echo "make dist"
111 targz="curl-$version.tar.gz"
112 make -s dist VERSION=$version
114 ############################################################################
116 # Now make a bz2 archive from the tar.gz original
119 bzip2="curl-$version.tar.bz2"
120 echo "Generating $bzip2"
121 gzip -dc $targz | bzip2 - > $bzip2
123 ############################################################################
125 # Now make a zip archive from the tar.gz original
127 makezip ()
129 rm -rf $tempdir
130 mkdir $tempdir
131 cd $tempdir
132 gzip -dc ../$targz | tar -xf -
133 find . | zip $zip -@ >/dev/null
134 mv $zip ../
135 cd ..
136 rm -rf $tempdir
139 zip="curl-$version.zip"
140 echo "Generating $zip"
141 tempdir=".builddir"
142 makezip
144 echo "------------------"
145 echo "maketgz report:"
146 echo ""
147 ls -l $targz $bzip2 $zip
149 md5sum $targz $bzip2 $zip
151 echo "Run this:"
152 echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip"