-
Notifications
You must be signed in to change notification settings - Fork 126
/
packdist.sh
executable file
·64 lines (49 loc) · 1.27 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
#!/bin/sh
# only builds snapshots for now
# tarball name contains date and git short id
SRCTEST=src/main/lighttpd_worker.c
PACKAGE=lighttpd
REV=${REV}
BASEDOWNLOADURL="https://download.lighttpd.net/lighttpd/snapshots-2.0.x"
if [ ! -f ${SRCTEST} ]; then
echo "Current directory is not the source directory"
exit 1
fi
dopack=1
if [ "$1" = "--nopack" ]; then
dopack=0
shift
fi
append="$1"
function force() {
"$@" || {
echo "Command failed: $*"
exit 1
}
}
if [ ${dopack} = "1" ]; then
force ./autogen.sh
if [ -d distbuild ]; then
# make distcheck may leave readonly files
chmod u+w -R distbuild
rm -rf distbuild
fi
force mkdir distbuild
force cd distbuild
force ../configure --prefix=/usr
# force make
# force make check
force make distcheck
else
force cd distbuild
fi
version=`./config.status -V | head -n 1 | cut -d' ' -f3`
name="${PACKAGE}-${version}"
append="-snap-$(date '+%Y%m%d')${REV}-g$(git rev-list --abbrev-commit --abbrev=6 HEAD^..HEAD)"
if [ -n "${append}" ]; then
cp "${name}.tar.gz" "${name}${append}.tar.gz"
cp "${name}.tar.bz2" "${name}${append}.tar.bz2"
name="${name}${append}"
fi
force sha256sum "${name}.tar."{gz,bz2} > "${name}.sha256sum"
echo wget "${BASEDOWNLOADURL}/${name}".'{tar.gz,tar.bz2,sha256sum}; sha256sum -c '${name}'.sha256sum'