-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackdist.sh
executable file
·86 lines (67 loc) · 2.7 KB
/
packdist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# may take one argument for prereleases like
# ./packdist.sh [--nopack] -rc1-r10
builddir=distbuild
tmpdir=$(mktemp --tmpdir -d packdist-XXXXXXX)
trap 'rm -rf "${tmpdir}"' EXIT
append="$1"
force() {
"$@" || {
echo "Command failed: $*"
exit 1
}
}
self=$(dirname "$(readlink -f "$0")")
force cd "${self}"
if [ -d "${builddir}" ]; then
# make distcheck may leave readonly files
chmod u+w -R "${builddir}"
rm -rf "${builddir}"
fi
force meson setup "${builddir}"
# meson dist ensures tree isn't dirty, and also compiles/tests
force meson dist -C "${builddir}" --formats gztar
package=$(meson introspect "${builddir}" --projectinfo | jq -r '.descriptive_name')
version=$(meson introspect "${builddir}" --projectinfo | jq -r '.version')
name="${package}-${version}"
if [ -z "${package}" -o -z "${version}" ]; then
echo >&2 "Failed extracting package name and/or version"
exit 1
fi
# meson dist isn't reproducable (meson offers dist hooks and probably uses current time;
# git archive uses timestamps from git commit).
# so use git archive instead of meson dist, but show tardiff (should be empty; timestamps not shown).
# (still use meson dist for compile/tests run)
force git archive --format tar -o "${builddir}/${name}.tar" --prefix "${name}/" HEAD
force gzip -n --keep "${builddir}/${name}.tar"
force xz --keep "${builddir}/${name}.tar"
force rm "${builddir}/${name}.tar"
echo "Diff git -> meson dist tar.gz"
force tardiff --modified --autoskip "${builddir}/${name}.tar.gz" "${builddir}/meson-dist/${name}.tar.gz"
force cd "${builddir}"
downloadbaseurl="https://download.lighttpd.net/multiwatch/releases-1.x"
if [ -n "${append}" ]; then
cp "${name}.tar.xz" "${name}${append}.tar.xz"
cp "${name}.tar.gz" "${name}${append}.tar.gz"
name="${name}${append}"
downloadbaseurl="https://download.lighttpd.net/multiwatch/MISSING"
fi
force sha256sum "${name}.tar."{xz,gz} > "${name}.sha256sum"
force gpg -a --output "${name}.tar.xz.asc" --detach-sig "${name}.tar.xz"
force gpg -a --output "${name}.tar.gz.asc" --detach-sig "${name}.tar.gz"
(
echo "h1. Downloads"
echo
echo "* ${downloadbaseurl}/${name}.tar.xz"
echo "** GPG signature: ${downloadbaseurl}/${name}.tar.xz.asc"
echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
echo "* SHA256 checksums: ${downloadbaseurl}/${name}.sha256sum"
echo "* ${downloadbaseurl}/${name}.tar.gz"
echo "** GPG signature: ${downloadbaseurl}/${name}.tar.gz.asc"
echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
) > DOWNLOADS
echo -------
cat DOWNLOADS
echo -------
echo "scp ${builddir}/${name}.{tar*,sha256sum} lighttpd.net:download/multiwatch/releases-1.x/"
echo wget "${downloadbaseurl}/${name}".'{tar.xz,tar.gz,sha256sum}; sha256sum -c '${name}'.sha256sum'