Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 138 lines (110 sloc) 3.342 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
ae1912c @bagder Initial revision
authored
12 libversion="$version"
13
ce7326e @bagder 1. read the version from the command line
authored
14 # we make curl the same version as libcurl
15 curlversion=$libversion
ae1912c @bagder Initial revision
authored
16
472c4d8 @bagder Insert the major, minor and patch numbers into the curl/curl.h header as
authored
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"`
11e8600 @bagder cut the patch number before a '-' too, to enable '7.11.0-pre1' to use
authored
19 patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
472c4d8 @bagder Insert the major, minor and patch numbers into the curl/curl.h header as
authored
20
21 numeric=`echo "obase=16; $major*256*256 + $minor*256 + $patch" | bc`
22
ae1912c @bagder Initial revision
authored
23 HEADER=include/curl/curl.h
24 CHEADER=src/version.h
25
26 # Replace version number in header file:
96dde76 @bagder moved here from the newlib branch
authored
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' \
472c4d8 @bagder Insert the major, minor and patch numbers into the curl/curl.h header as
authored
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' \
ffc58c6 @bagder newer, nicer
authored
32 $HEADER >$HEADER.dist
ae1912c @bagder Initial revision
authored
33
34 # Replace version number in header file:
ffc58c6 @bagder newer, nicer
authored
35 sed 's/#define CURL_VERSION.*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist
ae1912c @bagder Initial revision
authored
36
e6367ab @bagder generate and include PDF versions of the docs in the release archive
authored
37 echo "curl version $curlversion"
38 echo "libcurl version $libversion"
39 echo "libcurl numerical $numeric"
40
ae1912c @bagder Initial revision
authored
41 findprog()
42 {
43 file="$1"
44 for part in `echo $PATH| tr ':' ' '`; do
45 path="$part/$file"
46 if [ -x "$path" ]; then
47 # there it is!
48 return 1
49 fi
50 done
51
52 # no such executable
53 return 0
54 }
55
56 ############################################################################
57 #
fe84071 @bagder adjusted to use 'make dist' when building the package
authored
58 # Enforce a rerun of configure (updates the VERSION)
ae1912c @bagder Initial revision
authored
59 #
fe84071 @bagder adjusted to use 'make dist' when building the package
authored
60
888d39e @bagder generate bzip2 and zip files too
authored
61 echo "Re-running config.status"
62 ./config.status --recheck >/dev/null
ae1912c @bagder Initial revision
authored
63
64 ############################################################################
65 #
66 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
67 # been modified.
68 #
69
70 if { findprog automake >/dev/null 2>/dev/null; } then
71 echo "- Could not find or run automake, I hope you know what you're doing!"
72 else
73 echo "Runs automake --include-deps"
888d39e @bagder generate bzip2 and zip files too
authored
74 automake --include-deps Makefile >/dev/null
ae1912c @bagder Initial revision
authored
75 fi
76
77 ############################################################################
78 #
05d9c9b @bagder run 'make clean' before 'make dist' to make sure the HTML files are u…
authored
79 # Make sure we have updated HTML versions of all man pages:
80 #
a7de09a @bagder some outputs for easier debugging
authored
81 echo "make html"
ffc58c6 @bagder newer, nicer
authored
82 make -s html
05d9c9b @bagder run 'make clean' before 'make dist' to make sure the HTML files are u…
authored
83
e6367ab @bagder generate and include PDF versions of the docs in the release archive
authored
84 # And the PDF versions
a7de09a @bagder some outputs for easier debugging
authored
85 echo "make pdf"
ffc58c6 @bagder newer, nicer
authored
86 make -s pdf
e6367ab @bagder generate and include PDF versions of the docs in the release archive
authored
87
05d9c9b @bagder run 'make clean' before 'make dist' to make sure the HTML files are u…
authored
88 ############################################################################
89 #
888d39e @bagder generate bzip2 and zip files too
authored
90 # Now run make dist to generate a tar.gz archive
ae1912c @bagder Initial revision
authored
91 #
92
a7de09a @bagder some outputs for easier debugging
authored
93 echo "make dist"
888d39e @bagder generate bzip2 and zip files too
authored
94 targz="curl-$version.tar.gz"
ffc58c6 @bagder newer, nicer
authored
95 make -s dist VERSION=$version
888d39e @bagder generate bzip2 and zip files too
authored
96
97 ############################################################################
98 #
99 # Now make a bz2 archive from the tar.gz original
100 #
101
102 bzip2="curl-$version.tar.bz2"
103 echo "Generating $bzip2"
104 gzip -dc $targz | bzip2 - > $bzip2
105
106 ############################################################################
107 #
108 # Now make a zip archive from the tar.gz original
109 #
110 makezip ()
111 {
112 rm -rf $tempdir
113 mkdir $tempdir
114 cd $tempdir
115 gzip -dc ../$targz | tar -xf -
116 find . | zip $zip -@ >/dev/null
117 mv $zip ../
118 cd ..
119 rm -rf $tempdir
120 }
121
122 zip="curl-$version.zip"
123 echo "Generating $zip"
124 tempdir=".builddir"
125 makezip
126
127 echo "------------------"
128 echo "maketgz report:"
129 echo ""
130 ls -l $targz $bzip2 $zip
131
1c7dfda @bagder output the md5sum as the last step
authored
132 md5sum $targz $bzip2 $zip
4da0428 @bagder Remind about the gpg command lines
authored
133
134 echo "Run these commands:"
135 echo "gpg -b -a $targz"
136 echo "gpg -b -a $bzip2"
137 echo "gpg -b -a $zip"
Something went wrong with that request. Please try again.