-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalabit-unix-build
executable file
·101 lines (87 loc) · 1.66 KB
/
balabit-unix-build
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
set -e
ZWACONF=./.zwaconf
TARGET=
get_version(){
head -1 debian/changelog | sed -e 's/.*(\([^)]*\)).*/\1/'
}
sed_file() {
while [ -n "$1" ]; do
in=$1.in
out=$1
sed \
-e "s/@VERSION@/${VERSION}/g" \
$in > $out
shift
done
}
if [ -f $ZWACONF ]; then
. $ZWACONF
fi
if [ -z "$TARGET" ]; then
TARGET=$PWD/out
fi
if [ -z "$MAKE" ];then
MAKE=make
fi
cmd=$1
shift
case "$cmd" in
get-version)
get_version
;;
prepare-dist)
VERSION=`get_version`
;;
dist-exclude-list|build-exclude-list)
echo "out obj *.aqt *.ncb *.suo *.vcproj.*.user"
;;
bootstrap)
;;
configure)
OPTIONS=`getopt -l "help,prefix:" 'p:' $*`
if [ $? -ne 0 ]; then
echo "$0: unknown flags..."
exit 1
fi
eval set -- "$OPTIONS"
while true ; do
_arg=$1
if [ -z "$_arg" ]; then
break
fi
case $1 in
--prefix)
shift
TARGET="$1"
;;
esac
shift
done
echo "TARGET=$TARGET" > $ZWACONF
if [ "$ZBS_BUILDER_TYPE" = "mingw" ]; then
./configure --prefix $TARGET
fi
;;
make)
if [ "$ZBS_BUILDER_TYPE" = "mingw" ]; then
case $1 in
install)
mkdir -p $TARGET/include $TARGET/lib $TARGET/bin
install -v regex.h $TARGET/include
install -v libregex.dll $TARGET/bin
install -v libregex.*a $TARGET/lib
;;
*) make $@;;
esac
else
echo "This module is windows only."
fi
;;
*)
echo "Unknown command: $cmd"
exit 1
;;
esac
exit 0
# vim: ts=2 sw=2 expandtab