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 # If we have autoconf we can just as well update configure.in to contain our
62 # brand new version number:
65 #if { findprog autoconf >/dev/null 2>/dev/null; } then
66 # echo "- No autoconf found, we leave configure as it is"
68 # # Replace version number in configure.in file:
72 # sed 's/^AM_INIT_AUTOMAKE.*/AM_INIT_AUTOMAKE(curl,"'$version'")/g' $CONF >$CONF.new
75 # cp -p $CONF $CONF.old
77 # # Make new configure.in
80 # # Update the configure script
81 # echo "Runs autoconf"
85 ############################################################################
87 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
91 if { findprog automake >/dev/null 2>/dev/null; } then
92 echo "- Could not find or run automake, I hope you know what you're doing!"
94 echo "Runs automake --include-deps"
95 automake --include-deps
98 ############################################################################
100 # Now run make first to make the file dates decent and make sure that it
101 # compiles just before release!
112 # Get the left part of the dash (-)
113 new=`echo $orig | cut -d- -f1`
115 # Build new directory name
118 # Tell the world what we're doing
119 echo "Copying files into distribution archive";
122 echo "Directory already exists!"
129 # Copy all relevant files, with path and permissions!
130 tar -cf - `cat FILES` | (cd $n; tar -xBpf -)
132 # Create the distribution root Makefile from Makefile.dist
133 cp -p Makefile.dist $n/Makefile
135 ############################################################################
137 # Replace @SHELL@ with /bin/sh in the Makefile.in files!
139 echo "Replace @SHELL@ with /bin/sh in the Makefile.in files"
141 for file in Makefile.in lib/Makefile.in src/Makefile.in; do
143 sed "s:@SHELL@:/bin/sh:g" $in >$temp
148 # Tell the world what we're doing
149 echo "creates $n.tar.gz";
151 # Make a tar archive of it all
157 # Make it world readable
158 chmod a+r $n.tar.gz ;
160 # Delete the temp dir