2 # Script to build release-archives with
7 if [ -z "$version" ]; then
8 echo "Specify a version number!"
17 # Now we have a section to get the major, minor and patch number from the
18 # full version string. We create a single hexadecimal number from it '0xMMmmpp'
20 perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
22 numeric=`echo $libversion | perl -e "$perl"`
24 # we make curl the same version as libcurl
25 curlversion=$libversion
27 HEADER=include/curl/curl.h
30 # Replace version number in header file:
31 sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
32 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
35 # Save old header file
36 cp -p $HEADER $HEADER.old
39 mv $HEADER.new $HEADER
41 # Replace version number in header file:
42 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.new
44 echo "curl version $curlversion"
45 echo "libcurl version $libversion"
46 echo "libcurl numerical $numeric"
48 # Save old header file
49 cp -p $CHEADER $CHEADER.old
52 mv $CHEADER.new $CHEADER
57 for part in `echo $PATH| tr ':' ' '`; do
59 if [ -x "$path" ]; then
69 ############################################################################
71 # Enforce a rerun of configure (updates the VERSION)
74 echo "Re-running config.status"
75 ./config.status --recheck >/dev/null
77 ############################################################################
79 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
83 if { findprog automake >/dev/null 2>/dev/null; } then
84 echo "- Could not find or run automake, I hope you know what you're doing!"
86 echo "Runs automake --include-deps"
87 automake --include-deps Makefile >/dev/null
90 ############################################################################
92 # Make sure we have updated HTML versions of all man pages:
96 # And the PDF versions
99 ############################################################################
101 # Now run make dist to generate a tar.gz archive
104 targz="curl-$version.tar.gz"
107 ############################################################################
109 # Now make a bz2 archive from the tar.gz original
112 bzip2="curl-$version.tar.bz2"
113 echo "Generating $bzip2"
114 gzip -dc $targz | bzip2 - > $bzip2
116 ############################################################################
118 # Now make a zip archive from the tar.gz original
125 gzip -dc ../$targz | tar -xf -
126 find . | zip $zip -@ >/dev/null
132 zip="curl-$version.zip"
133 echo "Generating $zip"
137 echo "------------------"
138 echo "maketgz report:"
140 ls -l $targz $bzip2 $zip
142 md5sum $targz $bzip2 $zip
144 echo "Run these commands:"
145 echo "gpg -b -a $targz"
146 echo "gpg -b -a $bzip2"
147 echo "gpg -b -a $zip"