-
Notifications
You must be signed in to change notification settings - Fork 40
/
autogen.sh
executable file
·79 lines (67 loc) · 2.06 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
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
}
parse_build_requires_from_spec_file()
{
PACKAGE=$1
rpmspec -P $PACKAGE.spec | grep "^\(Build\)\?Requires:" | \
tr -s " " | tr "," "\n" | cut -f2- -d " " | \
grep -v "\(^\|python[23]-\)"$PACKAGE | sort -u | sed -E 's/^(.*) (.*)$/"\1 \2"/' | tr \" \'
}
list_build_dependencies()
{
local BUILD_SYSTEM_DEPS_LIST="gettext-devel make tito"
echo $BUILD_SYSTEM_DEPS_LIST $(parse_build_requires_from_spec_file libreport)
}
case "$1" in
"--help"|"-h")
print_help
exit 0
;;
"sysdeps")
DEPS_LIST=$(list_build_dependencies)
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 -ifv || exit 1
echo "Running intltoolize..."
intltoolize --force --copy --automake || exit 1
if [ "$NOCONFIGURE" = "" ]; then
echo "Running configure ..."
if [ 0 -eq $# ]; then
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-debug
echo "Configured for local debugging ..."
else
./configure "$@"
fi
else
echo "Skipping configure"
fi
;;
esac