-
Notifications
You must be signed in to change notification settings - Fork 22
/
autogen.sh
executable file
·61 lines (50 loc) · 1.35 KB
/
autogen.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
#!/bin/sh
set -x
print_help()
{
cat << EOH
Prepares the source tree for configuration
Usage:
autogen.sh [sysdeps [--install]]
Options:
sysdeps prints out all dependencies
--install install all dependencies ('sudo yum install \$DEPS')
EOH
}
build_depslist()
{
PACKAGE=$1
TEMPFILE=$(mktemp -u --suffix=.spec)
sed 's/@@SATYR_VERSION@@/1/' < $PACKAGE.spec.in | sed 's/@.*@//' > $TEMPFILE
rpmspec -P $TEMPFILE | grep "^\(Build\)\?Requires:" | \
tr -s " " | tr "," "\n" | cut -f2- -d " " | \
grep -v "\(^\|python[23]-\)"$PACKAGE | sort -u | \
sed -E -e 's/^(.*) (.*)$/"\1 \2"/' -e 's|([[:alpha:]]+\(.+\))|"\1"|' | \
tr \" \'
rm $TEMPFILE
}
case "$1" in
"--help"|"-h")
print_help
exit 0
;;
"sysdeps")
DEPS_LIST=$(build_depslist satyr)
if [ "$2" == "--install" ]; then
set -x verbose
eval sudo dnf --assumeyes install --setopt=strict=0 $DEPS_LIST
set +x verbose
else
echo $DEPS_LIST
fi
exit 0
;;
*)
echo "Running gen-version"
./gen-version
echo "Running autoreconf"
autoreconf --install --force
echo "Running configure"
./configure "$@"
;;
esac