run 'make clean' before 'make dist' to make sure the HTML files are up-to-date
[platform/upstream/curl.git] / maketgz
1 #! /bin/sh
2 # Script to build release-archives with
3 #
4
5 echo "LIB version number?"
6 read version
7
8 libversion="$version"
9
10 #
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'
13 #
14 perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
15
16 numeric=`echo $libversion | perl -e "$perl"`
17
18 echo "CURL version number?"
19 read curlversion
20
21 HEADER=include/curl/curl.h
22 CHEADER=src/version.h
23
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' \
27  $HEADER >$HEADER.new
28
29 # Save old header file
30 cp -p $HEADER $HEADER.old
31
32 # Make new header:
33 mv $HEADER.new $HEADER
34
35 # Replace version number in header file:
36 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.new
37
38 # Save old header file
39 cp -p $CHEADER $CHEADER.old
40
41 # Make new header:
42 mv $CHEADER.new $CHEADER
43
44 findprog()
45 {
46   file="$1"
47   for part in `echo $PATH| tr ':' ' '`; do
48     path="$part/$file"
49     if [ -x "$path" ]; then
50       # there it is!
51       return 1
52     fi
53   done
54
55   # no such executable
56   return 0
57 }
58
59 ############################################################################
60 #
61 # Enforce a rerun of configure (updates the VERSION)
62 #
63
64 ./config.status --recheck
65
66 ############################################################################
67 #
68 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
69 # been modified.
70 #
71
72 if { findprog automake >/dev/null 2>/dev/null; } then
73   echo "- Could not find or run automake, I hope you know what you're doing!"
74 else
75   echo "Runs automake --include-deps"
76   automake --include-deps Makefile
77 fi
78
79 ############################################################################
80 #
81 # Make sure we have updated HTML versions of all man pages:
82 #
83 make html
84
85 ############################################################################
86 #
87 # Now run make dist
88 #
89
90 make dist