-
Notifications
You must be signed in to change notification settings - Fork 7
/
release.sh
executable file
·56 lines (43 loc) · 1.33 KB
/
release.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
#!/bin/sh
set -eu
umask 022
curdir="$(readlink -f "$0")"
curdir="$(dirname "$curdir")"
cd "$curdir"
omake -s distclean
pkg="$(omake -s echo-pkg)"
find . -type f \( -name '*~' -o -name '*.omc' -o -name '.omakedb*' \) -delete
mtmpf="$(mktemp -d)"
trap "rm -rf \"${mtmpf}\"" EXIT
if which gtar >/dev/null 2>&1 ; then
tar=gtar
else
tar=tar
fi
stash="$(git stash create)"
git archive --format=tar ${stash:-HEAD} | ( cd "$mtmpf" ; tar -xf- )
cd src
omake -s error.ml uwt-error.h error_val.ml map_error.h configure
cp -p config.h.in configure uwt-error.h error.ml error_val.ml map_error.h "${mtmpf}/src"
cd ..
cd libuv
mkdir -p "${mtmpf}/libuv"
git archive --format=tar HEAD | ( cd "${mtmpf}/libuv" ; tar -xf- )
./autogen.sh
cp -rp Makefile.in aclocal.m4 ar-lib compile config.guess config.sub configure depcomp install-sh ltmain.sh m4 missing "${mtmpf}/libuv/."
cd ..
if which gfind >/dev/null 2>&1 ; then
find=gfind
else
find=find
fi
cd "$mtmpf"
touch src/configure libuv/configure
rm -rf .git* libuv/.git*
$find . -type f ! -executable ! -perm 644 -exec chmod 644 {} \+
$find . -type f -executable ! -perm 755 -exec chmod 755 {} \+
$find . -type d ! -perm 755 -exec chmod 755 {} \+
$tar --transform "s|^.|${pkg}|" --format=ustar --numeric-owner -chf- . | \
gzip -9 > "${curdir}/${pkg}.tar.gz"
#omake all >/dev/null 2>&1
#omake test