]>
git.ipfire.org Git - thirdparty/curl.git/blob - maketgz
2 # Script to build release-archives with. Note that this requires a checkout
3 # from git and you should first run ./buildconf and build curl once.
5 #***************************************************************************
7 # Project ___| | | | _ \| |
9 # | (__| |_| | _ <| |___
10 # \___|\___/|_| \_\_____|
12 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
14 # This software is licensed as described in the file COPYING, which
15 # you should have received as part of this distribution. The terms
16 # are also available at https://curl.se/docs/copyright.html.
18 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
19 # copies of the Software, and permit persons to whom the Software is
20 # furnished to do so, under the terms of the COPYING file.
22 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
23 # KIND, either express or implied.
25 # SPDX-License-Identifier: curl
27 ###########################################################################
31 if [ -z "$version" ]; then
32 echo "Specify a version number!"
36 if [ "xonly" = "x$2" ]; then
37 echo "Setup version number only!"
43 # we make curl the same version as libcurl
44 curlversion
=$libversion
46 major
=`echo $libversion | cut -d. -f1 | sed -e "s/[^0-9]//g"`
47 minor
=`echo $libversion | cut -d. -f2 | sed -e "s/[^0-9]//g"`
48 patch=`echo $libversion | cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
50 if test -z "$patch"; then
51 echo "invalid version number? needs to be z.y.z"
56 # As a precaution, remove all *.dist files that may be lying around, to reduce
57 # the risk of old leftovers getting shipped. The root 'Makefile.dist' is the
59 echo "removing all old *.dist files"
60 find .
-name "*.dist" -a ! -name Makefile.dist
-exec rm {} \
;
62 numeric
=`perl -e 'printf("%02x%02x%02x\n", '"$major, $minor, $patch);"`
64 HEADER
=include
/curl
/curlver.h
65 CHEADER
=src
/tool_version.h
66 PLIST
=lib
/libcurl.plist
69 if test -z "$only"; then
71 # when not setting up version numbers locally
72 for a
in $HEADER $CHEADER $PLIST; do
76 CHEADER
="$CHEADER$ext"
80 # requires a date command that knows + for format
81 datestamp
=`date +"%F"`
83 # Replace version number in header file:
85 -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
86 -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
87 -e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
88 -e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \
89 -e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
90 -e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \
94 # Replace version number in header file:
95 sed -i.bak
's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER
98 # Replace version number in plist file:
99 sed "s/@CURL_PLIST_VERSION@/$curlversion/g" < $PLISTO.
in >$PLIST
101 if test -n "$only"; then
106 echo "curl version $curlversion"
107 echo "libcurl version $libversion"
108 echo "libcurl numerical $numeric"
109 echo "datestamp $datestamp"
113 for part
in `echo $PATH| tr ':' ' '`; do
115 if [ -x "$path" ]; then
125 ############################################################################
127 # Enforce a rerun of configure (updates the VERSION)
130 echo "Re-running config.status"
131 .
/config.status
--recheck >/dev
/null
133 ############################################################################
135 # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
139 if { findprog automake
>/dev
/null
2>/dev
/null
; } then
140 echo "- Could not find or run automake, I hope you know what you're doing!"
142 echo "Runs automake --include-deps"
143 automake
--include-deps Makefile
>/dev
/null
146 ############################################################################
148 # Modify the man pages to display the version number and date.
151 echo "update man pages"
152 .
/scripts
/updatemanpages.pl
$version >/dev
/null
154 # make the generated file newer than the man page
155 touch src
/tool_hugehelp.c
157 ############################################################################
159 # Update the IDE files
163 echo "produce CHANGES"
164 git log
--pretty=fuller
--no-color --date=short
--decorate=full
-1000 | .
/scripts
/log2changes.pl
> CHANGES.dist
166 ############################################################################
168 # Now run make dist to generate a tar.gz archive
172 targz
="curl-$version.tar.gz"
173 make -sj dist VERSION
=$version
176 if test "$res" != 0; then
177 echo "make dist failed"
181 ############################################################################
183 # Now make a bz2 archive from the tar.gz original
186 bzip2="curl-$version.tar.bz2"
187 echo "Generating $bzip2"
188 gzip -dc $targz |
bzip2 --best > $bzip2
190 ############################################################################
192 # Now make an xz archive from the tar.gz original
195 xz
="curl-$version.tar.xz"
196 echo "Generating $xz"
197 gzip -dc $targz | xz
-6e - > $xz
199 ############################################################################
201 # Now make a zip archive from the tar.gz original
207 gzip -dc ..
/$targz |
tar -xf -
208 find . |
zip $zip -@
>/dev
/null
214 zip="curl-$version.zip"
215 echo "Generating $zip"
219 echo "------------------"
220 echo "maketgz report:"
222 ls -l $targz $bzip2 $zip $xz
225 echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip && gpg -b -a $xz"