diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-04-10 20:10:47 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-04-10 20:11:33 +0300 |
commit | b6f9ef4232e189b3cae00dadf68336aa3e07f9ad (patch) | |
tree | 0fc28b828e7430e71844db4c6bcaceaac42803f2 /contrib | |
parent | d2919a6e7a8874fda287cfc4009f9915e4a26be9 (diff) | |
download | libmicrohttpd-b6f9ef4232e189b3cae00dadf68336aa3e07f9ad.tar.gz libmicrohttpd-b6f9ef4232e189b3cae00dadf68336aa3e07f9ad.zip |
contrib/make-dist.sh: added new helper script
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/make-dist.sh | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/contrib/make-dist.sh b/contrib/make-dist.sh new file mode 100755 index 00000000..c84ac2b3 --- /dev/null +++ b/contrib/make-dist.sh | |||
@@ -0,0 +1,96 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # | ||
4 | # This file creates dist tarball. | ||
5 | # Optional autotools patches are applied for better toolchains | ||
6 | # compatibility. | ||
7 | # | ||
8 | # Based on Debian SID baseline files as of April 2023. | ||
9 | # | ||
10 | |||
11 | if ! grep -Eq -e '^PRETTY_NAME="Debian GNU/Linux 12 \(bookworm\)"$' /etc/os-release | ||
12 | then | ||
13 | echo "Only Debian 'bookworm' is suppoted by this script." >&2 | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | if ! autoconf --version | head -1 | grep -Eq -e ' 2\.71$' - | ||
18 | then | ||
19 | echo "The only supported autoconf version is 2.71." >&2 | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | |||
24 | tooldir=$(dirname $BASH_SOURCE) || exit 2 | ||
25 | test -n "$tooldir" || exit 2 | ||
26 | cd "$tooldir" || exit 2 | ||
27 | tooldir="$PWD" || exit 2 | ||
28 | cd "${tooldir}/.." || exit 2 | ||
29 | rootsrcdir="$PWD" || exit 2 | ||
30 | |||
31 | # Cleanup sources | ||
32 | echo '' | ||
33 | echo '*** Perfoming initial cleanup...' | ||
34 | echo '' | ||
35 | if [[ ! -f 'Makefile' ]] || ! make maintainer-clean | ||
36 | then | ||
37 | # Makefile needed for initial cleanup | ||
38 | if [[ ! -f 'Makefile.in' ]] || [[ ! -f 'configure' ]] || ! ./configure || ! make maintainer-clean | ||
39 | then | ||
40 | rm -f po/Makefile || exit 3 | ||
41 | # Build 'configure' to build Makefile for initial cleanup | ||
42 | autoreconf -fvi || exit 3 | ||
43 | ./configure || exit 3 | ||
44 | make maintainer-clean || exit 3 | ||
45 | fi | ||
46 | fi | ||
47 | echo '' | ||
48 | echo '** Initial cleanup completed.' | ||
49 | echo '' | ||
50 | |||
51 | # Copy latest autotools files | ||
52 | echo '' | ||
53 | echo '*** Copying autotools files...' | ||
54 | echo '' | ||
55 | autoreconf -fvi || exit 4 | ||
56 | echo '' | ||
57 | echo '*** Perfoming intermediate cleanup...' | ||
58 | echo '' | ||
59 | ./configure || exit 4 | ||
60 | make distclean || exit 4 | ||
61 | rm -f ./configure ./aclocal.m4 || exit 4 | ||
62 | rm -rf ./autom4te.cache || exit 4 | ||
63 | echo '' | ||
64 | echo '** Initial intermediate completed.' | ||
65 | echo '' | ||
66 | |||
67 | # Patching local autotools files | ||
68 | echo '' | ||
69 | echo '*** Perfoming patching of local autotools files...' | ||
70 | echo '' | ||
71 | "$tooldir/fixes-libtool/apply-all.sh" || exit 5 | ||
72 | "$tooldir/fixes-autoconf/apply-all.sh" || exit 5 | ||
73 | echo '' | ||
74 | echo '** Local autotools files patched.' | ||
75 | echo '' | ||
76 | |||
77 | # Build the configure and the related files with patches | ||
78 | echo '' | ||
79 | echo '*** Building patched configure and related files...' | ||
80 | echo '' | ||
81 | autoreconf -v || exit 6 | ||
82 | echo '' | ||
83 | echo '** Patched build system ready.' | ||
84 | echo '' | ||
85 | |||
86 | # Build the configure and the related files with patches | ||
87 | echo '' | ||
88 | echo '*** Building dist tarball...' | ||
89 | echo '' | ||
90 | ./configure || exit 7 | ||
91 | make dist || exit 7 | ||
92 | echo '' | ||
93 | echo '** Dist tarball ready.' | ||
94 | echo '' | ||
95 | |||
96 | exit 0 \ No newline at end of file | ||