2 # Script to build release-archives with
7 if [ -z "$version" ]; then
8 echo "Specify a version number!"
15 # Now we have a section to get the major, minor and patch number from the
16 # full version string. We create a single hexadecimal number from it '0xMMmmpp'
18 perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
20 numeric=`echo $libversion | perl -e "$perl"`
22 # we make curl the same version as libcurl
23 curlversion=$libversion
25 HEADER=include/curl/curl.h
28 # Replace version number in header file:
29 sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
30 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
33 # Replace version number in header file:
34 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist
36 echo "curl version $curlversion"
37 echo "libcurl version $libversion"
38 echo "libcurl numerical $numeric"
43 for part in `echo $PATH| tr ':' ' '`; do
45 if [ -x "$path" ]; then
55 ############################################################################
57 # Enforce a rerun of configure (updates the VERSION)
60 echo "Re-running config.status"
61 ./config.status --recheck >/dev/null
63 ############################################################################
65 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
69 if { findprog automake >/dev/null 2>/dev/null; } then
70 echo "- Could not find or run automake, I hope you know what you're doing!"
72 echo "Runs automake --include-deps"
73 automake --include-deps Makefile >/dev/null
76 ############################################################################
78 # Make sure we have updated HTML versions of all man pages:
82 # And the PDF versions
85 ############################################################################
87 # Now run make dist to generate a tar.gz archive
90 targz="curl-$version.tar.gz"
91 make -s dist VERSION=$version
93 ############################################################################
95 # Now make a bz2 archive from the tar.gz original
98 bzip2="curl-$version.tar.bz2"
99 echo "Generating $bzip2"
100 gzip -dc $targz | bzip2 - > $bzip2
102 ############################################################################
104 # Now make a zip archive from the tar.gz original
111 gzip -dc ../$targz | tar -xf -
112 find . | zip $zip -@ >/dev/null
118 zip="curl-$version.zip"
119 echo "Generating $zip"
123 echo "------------------"
124 echo "maketgz report:"
126 ls -l $targz $bzip2 $zip
128 md5sum $targz $bzip2 $zip
130 echo "Run these commands:"
131 echo "gpg -b -a $targz"
132 echo "gpg -b -a $bzip2"
133 echo "gpg -b -a $zip"