2 # Script to build release-archives with
5 echo "LIB version number?"
11 # Now we have a section to get the major, minor and patch number from the
12 # full version string. We create a single hexadecimal number from it '0xMMmmpp'
14 perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
16 numeric=`echo $libversion | perl -e "$perl"`
18 echo "CURL version number?"
21 HEADER=include/curl/curl.h
24 # Replace version number in header file:
25 sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
26 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
29 # Save old header file
30 cp -p $HEADER $HEADER.old
33 mv $HEADER.new $HEADER
35 # Replace version number in header file:
36 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.new
38 # Save old header file
39 cp -p $CHEADER $CHEADER.old
42 mv $CHEADER.new $CHEADER
47 for part in `echo $PATH| tr ':' ' '`; do
49 if [ -x "$path" ]; then
59 ############################################################################
61 # Enforce a rerun of configure (updates the VERSION)
64 echo "Re-running config.status"
65 ./config.status --recheck >/dev/null
67 ############################################################################
69 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
73 if { findprog automake >/dev/null 2>/dev/null; } then
74 echo "- Could not find or run automake, I hope you know what you're doing!"
76 echo "Runs automake --include-deps"
77 automake --include-deps Makefile >/dev/null
80 ############################################################################
82 # Make sure we have updated HTML versions of all man pages:
86 ############################################################################
88 # Now run make dist to generate a tar.gz archive
91 targz="curl-$version.tar.gz"
94 ############################################################################
96 # Now make a bz2 archive from the tar.gz original
99 bzip2="curl-$version.tar.bz2"
100 echo "Generating $bzip2"
101 gzip -dc $targz | bzip2 - > $bzip2
103 ############################################################################
105 # Now make a zip archive from the tar.gz original
112 gzip -dc ../$targz | tar -xf -
113 find . | zip $zip -@ >/dev/null
119 zip="curl-$version.zip"
120 echo "Generating $zip"
124 echo "------------------"
125 echo "maketgz report:"
127 ls -l $targz $bzip2 $zip