-
Notifications
You must be signed in to change notification settings - Fork 1
/
autobuild.sh
executable file
·57 lines (48 loc) · 1008 Bytes
/
autobuild.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
#!/bin/bash
#
# rebuild from scratch
# note: run inside build container
#
set -e -u
provision_packages() {
echo "# $FUNCNAME"
if pacman -Q dovecot && pacman -Q pigeonhole ; then
return 0
fi
sudo pacman --sync --noconfirm \
dovecot \
pigeonhole \
base-devel
}
generate_configure() {
echo "# $FUNCNAME"
autoreconf \
--force \
--install
}
generate_makefile() {
echo "# $FUNCNAME"
"${0%/*}"/configure \
--prefix=/usr \
--disable-static \
--with-moduledir=/usr/lib/dovecot/modules
}
run_build_cycle() {
echo "# $FUNCNAME"
make
sudo make install
make check
}
package_binary() {
echo "# $FUNCNAME"
local package="${0%/*}/package"
mkdir -p "$package"
make DESTDIR="$package" install
local binary="${0%/*}/binary.tar.gz"
tar czvf "$binary" --exclude='*.la' -C "$package" "."
}
provision_packages
generate_configure
generate_makefile
run_build_cycle
package_binary