2 # Script to build release-archives with
7 if [ -z "$version" ]; then
8 echo "Specify a version number!"
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
26 # requires a date command that knows -u for UTC time zone
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" \
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 sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e 's#/GZ#/RTC1#' -e 's/wsock32.lib/wsock32.lib bufferoverflowu.lib/g' -e 's/VC6/VC8/g' lib/Makefile.vc6 > lib/Makefile.vc8.dist
44 sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e 's#/GZ#/RTC1#' -e 's/wsock32.lib/wsock32.lib bufferoverflowu.lib/g' -e 's/VC6/VC8/g' 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"
58 for part in `echo $PATH| tr ':' ' '`; do
60 if [ -x "$path" ]; then
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
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!"
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:
101 # And the PDF versions
105 ############################################################################
107 # Now run make dist to generate a tar.gz archive
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
132 gzip -dc ../$targz | tar -xf -
133 find . | zip $zip -@ >/dev/null
139 zip="curl-$version.zip"
140 echo "Generating $zip"
144 echo "------------------"
145 echo "maketgz report:"
147 ls -l $targz $bzip2 $zip
149 md5sum $targz $bzip2 $zip
152 echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip"