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 # Replace version number in header file:
27 sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
28 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
29 -e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
30 -e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \
31 -e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
34 # Replace version number in header file:
35 sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist
37 # Replace version number in plist file:
38 PLIST=lib/libcurl.plist
39 sed "s/7\.12\.3/$libversion/g" $PLIST > $PLIST.dist
41 echo "curl version $curlversion"
42 echo "libcurl version $libversion"
43 echo "libcurl numerical $numeric"
48 for part in `echo $PATH| tr ':' ' '`; do
50 if [ -x "$path" ]; then
60 ############################################################################
62 # Enforce a rerun of configure (updates the VERSION)
65 echo "Re-running config.status"
66 ./config.status --recheck >/dev/null
68 ############################################################################
70 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
74 if { findprog automake >/dev/null 2>/dev/null; } then
75 echo "- Could not find or run automake, I hope you know what you're doing!"
77 echo "Runs automake --include-deps"
78 automake --include-deps Makefile >/dev/null
81 ############################################################################
83 # Make sure we have updated HTML versions of all man pages:
88 # And the PDF versions
92 ############################################################################
94 # Now run make dist to generate a tar.gz archive
98 targz="curl-$version.tar.gz"
99 make -s dist VERSION=$version
101 ############################################################################
103 # Now make a bz2 archive from the tar.gz original
106 bzip2="curl-$version.tar.bz2"
107 echo "Generating $bzip2"
108 gzip -dc $targz | bzip2 - > $bzip2
110 ############################################################################
112 # Now make a zip archive from the tar.gz original
119 gzip -dc ../$targz | tar -xf -
120 find . | zip $zip -@ >/dev/null
126 zip="curl-$version.zip"
127 echo "Generating $zip"
131 echo "------------------"
132 echo "maketgz report:"
134 ls -l $targz $bzip2 $zip
136 md5sum $targz $bzip2 $zip
138 echo "Run these commands:"
139 echo "gpg -b -a $targz"
140 echo "gpg -b -a $bzip2"
141 echo "gpg -b -a $zip"