Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 148 lines (115 sloc) 3.227 kb
ae1912c @bagder Initial revision
authored
1 #! /bin/sh
2 # Script to build release-archives with
3 #
4
ce7326e @bagder 1. read the version from the command line
authored
5 version=$1
6
7 if [ -z "$version" ]; then
8 echo "Specify a version number!"
9 exit
10 fi
11
12 echo $version
ae1912c @bagder Initial revision
authored
13
14 libversion="$version"
15
96dde76 @bagder moved here from the newlib branch
authored
16 #
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'
19 #
9ce5827 @bagder made it split the version number on - too to make 7.7-blabla make a bett...
authored
20 perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
96dde76 @bagder moved here from the newlib branch
authored
21
22 numeric=`echo $libversion | perl -e "$perl"`
23
ce7326e @bagder 1. read the version from the command line
authored
24 # we make curl the same version as libcurl
25 curlversion=$libversion
ae1912c @bagder Initial revision
authored
26
27 HEADER=include/curl/curl.h
28 CHEADER=src/version.h
29
30 # Replace version number in header file:
96dde76 @bagder moved here from the newlib branch
authored
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' \
33 $HEADER >$HEADER.new
ae1912c @bagder Initial revision
authored
34
35 # Save old header file
36 cp -p $HEADER $HEADER.old
37
38 # Make new header:
39 mv $HEADER.new $HEADER
40
41 # Replace version number in header file:
42 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.new
43
e6367ab @bagder generate and include PDF versions of the docs in the release archive
authored
44 echo "curl version $curlversion"
45 echo "libcurl version $libversion"
46 echo "libcurl numerical $numeric"
47
ae1912c @bagder Initial revision
authored
48 # Save old header file
49 cp -p $CHEADER $CHEADER.old
50
51 # Make new header:
52 mv $CHEADER.new $CHEADER
53
54 findprog()
55 {
56 file="$1"
57 for part in `echo $PATH| tr ':' ' '`; do
58 path="$part/$file"
59 if [ -x "$path" ]; then
60 # there it is!
61 return 1
62 fi
63 done
64
65 # no such executable
66 return 0
67 }
68
69 ############################################################################
70 #
fe84071 @bagder adjusted to use 'make dist' when building the package
authored
71 # Enforce a rerun of configure (updates the VERSION)
ae1912c @bagder Initial revision
authored
72 #
fe84071 @bagder adjusted to use 'make dist' when building the package
authored
73
888d39e @bagder generate bzip2 and zip files too
authored
74 echo "Re-running config.status"
75 ./config.status --recheck >/dev/null
ae1912c @bagder Initial revision
authored
76
77 ############################################################################
78 #
79 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
80 # been modified.
81 #
82
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!"
85 else
86 echo "Runs automake --include-deps"
888d39e @bagder generate bzip2 and zip files too
authored
87 automake --include-deps Makefile >/dev/null
ae1912c @bagder Initial revision
authored
88 fi
89
90 ############################################################################
91 #
05d9c9b @bagder run 'make clean' before 'make dist' to make sure the HTML files are up-t...
authored
92 # Make sure we have updated HTML versions of all man pages:
93 #
94 make html
95
e6367ab @bagder generate and include PDF versions of the docs in the release archive
authored
96 # And the PDF versions
97 make pdf
98
05d9c9b @bagder run 'make clean' before 'make dist' to make sure the HTML files are up-t...
authored
99 ############################################################################
100 #
888d39e @bagder generate bzip2 and zip files too
authored
101 # Now run make dist to generate a tar.gz archive
ae1912c @bagder Initial revision
authored
102 #
103
888d39e @bagder generate bzip2 and zip files too
authored
104 targz="curl-$version.tar.gz"
fe84071 @bagder adjusted to use 'make dist' when building the package
authored
105 make dist
888d39e @bagder generate bzip2 and zip files too
authored
106
107 ############################################################################
108 #
109 # Now make a bz2 archive from the tar.gz original
110 #
111
112 bzip2="curl-$version.tar.bz2"
113 echo "Generating $bzip2"
114 gzip -dc $targz | bzip2 - > $bzip2
115
116 ############################################################################
117 #
118 # Now make a zip archive from the tar.gz original
119 #
120 makezip ()
121 {
122 rm -rf $tempdir
123 mkdir $tempdir
124 cd $tempdir
125 gzip -dc ../$targz | tar -xf -
126 find . | zip $zip -@ >/dev/null
127 mv $zip ../
128 cd ..
129 rm -rf $tempdir
130 }
131
132 zip="curl-$version.zip"
133 echo "Generating $zip"
134 tempdir=".builddir"
135 makezip
136
137 echo "------------------"
138 echo "maketgz report:"
139 echo ""
140 ls -l $targz $bzip2 $zip
141
1c7dfda @bagder output the md5sum as the last step
authored
142 md5sum $targz $bzip2 $zip
4da0428 @bagder Remind about the gpg command lines
authored
143
144 echo "Run these commands:"
145 echo "gpg -b -a $targz"
146 echo "gpg -b -a $bzip2"
147 echo "gpg -b -a $zip"
Something went wrong with that request. Please try again.