1
by Domenico Andreoli
Import upstream version 7.9.5 |
1 |
#! /bin/sh
|
2 |
# Script to build release-archives with
|
|
3 |
#
|
|
4 |
||
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
5 |
version=$1 |
6 |
||
7 |
if [ -z "$version" ]; then |
|
8 |
echo "Specify a version number!" |
|
9 |
exit
|
|
10 |
fi
|
|
1
by Domenico Andreoli
Import upstream version 7.9.5 |
11 |
|
12 |
libversion="$version" |
|
13 |
||
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
14 |
# we make curl the same version as libcurl
|
15 |
curlversion=$libversion |
|
16 |
||
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"` |
|
19 |
patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"` |
|
20 |
||
1.1.2
by LaMont Jones
Import upstream version 7.12.3 |
21 |
numeric=`perl -e 'printf("%02x%02x%02x\n", '"$major, $minor, $patch);"` |
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
22 |
|
23 |
HEADER=include/curl/curlver.h |
|
1
by Domenico Andreoli
Import upstream version 7.9.5 |
24 |
CHEADER=src/version.h |
25 |
||
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
26 |
# requires a date command that knows -u for UTC time zone
|
27 |
datestamp=`date -u` |
|
28 |
||
1
by Domenico Andreoli
Import upstream version 7.9.5 |
29 |
# Replace version number in header file:
|
30 |
sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \ |
|
31 |
-e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \ |
|
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
32 |
-e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \ |
33 |
-e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \ |
|
34 |
-e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \ |
|
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
35 |
-e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \ |
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
36 |
$HEADER >$HEADER.dist |
1
by Domenico Andreoli
Import upstream version 7.9.5 |
37 |
|
38 |
# Replace version number in header file:
|
|
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
39 |
sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist |
40 |
||
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
41 |
echo "generate VC8 makefiles" |
42 |
# Generate VC8 versions from the VC6 Makefile versions
|
|
1.1.9
by Matthias Klose
Import upstream version 7.17.1 |
43 |
perl -pe 's%/GX /DWIN32 /YX%/EHsc /DWIN32%;' -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' lib/Makefile.vc6 > lib/Makefile.vc8.dist |
44 |
perl -pe "s%/GX /DWIN32 /YX%/EHsc /DWIN32%;" -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' -e 's/^#MANIFESTTOOL/MANIFESTTOOL/' src/Makefile.vc6 > src/Makefile.vc8.dist |
|
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
45 |
|
1.1.2
by LaMont Jones
Import upstream version 7.12.3 |
46 |
# Replace version number in plist file:
|
47 |
PLIST=lib/libcurl.plist |
|
48 |
sed "s/7\.12\.3/$libversion/g" $PLIST > $PLIST.dist |
|
49 |
||
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
50 |
echo "curl version $curlversion" |
51 |
echo "libcurl version $libversion" |
|
52 |
echo "libcurl numerical $numeric" |
|
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
53 |
echo "datestamp $datestamp" |
1
by Domenico Andreoli
Import upstream version 7.9.5 |
54 |
|
55 |
findprog()
|
|
56 |
{
|
|
57 |
file="$1" |
|
58 |
for part in `echo $PATH| tr ':' ' '`; do |
|
59 |
path="$part/$file" |
|
60 |
if [ -x "$path" ]; then |
|
61 |
# there it is!
|
|
62 |
return 1 |
|
63 |
fi
|
|
64 |
done
|
|
65 |
||
66 |
# no such executable
|
|
67 |
return 0 |
|
68 |
}
|
|
69 |
||
1.1.7
by Matthias Klose
Import upstream version 7.16.2 |
70 |
echo "maketgz: cp lib/config.h.in src/config.h.in" |
71 |
cp lib/config.h.in src/config.h.in |
|
72 |
||
1
by Domenico Andreoli
Import upstream version 7.9.5 |
73 |
############################################################################
|
74 |
#
|
|
75 |
# Enforce a rerun of configure (updates the VERSION)
|
|
76 |
#
|
|
77 |
||
78 |
echo "Re-running config.status" |
|
79 |
./config.status --recheck >/dev/null |
|
80 |
||
81 |
############################################################################
|
|
82 |
#
|
|
83 |
# automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
|
|
84 |
# been modified.
|
|
85 |
#
|
|
86 |
||
87 |
if { findprog automake >/dev/null 2>/dev/null; } then |
|
88 |
echo "- Could not find or run automake, I hope you know what you're doing!" |
|
89 |
else
|
|
90 |
echo "Runs automake --include-deps" |
|
91 |
automake --include-deps Makefile >/dev/null |
|
92 |
fi
|
|
93 |
||
94 |
############################################################################
|
|
95 |
#
|
|
96 |
# Make sure we have updated HTML versions of all man pages:
|
|
97 |
#
|
|
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
98 |
echo "make html" |
99 |
make -s html |
|
100 |
||
101 |
# And the PDF versions
|
|
102 |
echo "make pdf" |
|
103 |
make -s pdf |
|
1
by Domenico Andreoli
Import upstream version 7.9.5 |
104 |
|
105 |
############################################################################
|
|
106 |
#
|
|
107 |
# Now run make dist to generate a tar.gz archive
|
|
108 |
#
|
|
109 |
||
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
110 |
echo "make dist" |
1
by Domenico Andreoli
Import upstream version 7.9.5 |
111 |
targz="curl-$version.tar.gz" |
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
112 |
make -s dist VERSION=$version |
1
by Domenico Andreoli
Import upstream version 7.9.5 |
113 |
|
114 |
############################################################################
|
|
115 |
#
|
|
116 |
# Now make a bz2 archive from the tar.gz original
|
|
117 |
#
|
|
118 |
||
119 |
bzip2="curl-$version.tar.bz2" |
|
120 |
echo "Generating $bzip2" |
|
121 |
gzip -dc $targz | bzip2 - > $bzip2 |
|
122 |
||
123 |
############################################################################
|
|
124 |
#
|
|
125 |
# Now make a zip archive from the tar.gz original
|
|
126 |
#
|
|
127 |
makezip ()
|
|
128 |
{
|
|
129 |
rm -rf $tempdir
|
|
130 |
mkdir $tempdir
|
|
131 |
cd $tempdir |
|
132 |
gzip -dc ../$targz | tar -xf - |
|
133 |
find . | zip $zip -@ >/dev/null |
|
134 |
mv $zip ../
|
|
135 |
cd ..
|
|
136 |
rm -rf $tempdir
|
|
137 |
}
|
|
138 |
||
139 |
zip="curl-$version.zip" |
|
140 |
echo "Generating $zip" |
|
141 |
tempdir=".builddir" |
|
142 |
makezip |
|
143 |
||
144 |
echo "------------------" |
|
145 |
echo "maketgz report:" |
|
146 |
echo "" |
|
147 |
ls -l $targz $bzip2 $zip |
|
148 |
||
1.1.1
by Domenico Andreoli
Import upstream version 7.12.0.is.7.11.2 |
149 |
md5sum $targz $bzip2 $zip |
150 |
||
1.1.9
by Matthias Klose
Import upstream version 7.17.1 |
151 |
echo "Run this:" |
152 |
echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip" |