-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·51 lines (42 loc) · 1.34 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
#!/bin/sh
print_help()
{
cat << EOH
Prepares the source tree for configuration
Usage:
autogen.sh [sydeps [--install-yum|--install-dnf]]
Options:
sysdeps prints out all dependencies
--install-yum install all dependencies ('sudo yum install \$DEPS')
--install-dnf install all dependencies ('sudo dnf install \$DEPS')
EOH
}
build_depslist()
{
DEPS_LIST=`grep "^\(Build\)\?Requires:" *.spec.in | grep -v "%{name}" | tr -s " " | tr "," "\n" | cut -f2 -d " " | grep -v "^abrt" | sort -u | while read br; do if [ "%" = ${br:0:1} ]; then grep "%define $(echo $br | sed -e 's/%{\(.*\)}/\1/')" *.spec.in | tr -s " " | cut -f3 -d" "; else echo $br ;fi ; done | tr "\n" " "`
}
case "$1" in
"--help"|"-h")
print_help
exit 0
;;
"sysdeps")
build_depslist
if [ "$2" == "--install" ] || [ "$2" == "--install-dnf" ]; then
set -x verbose
sudo dnf install --setopt=strict=0 $DEPS_LIST
set +x verbose
elif [ "$2" == "--install-yum" ]; then
set -x verbose
sudo yum install $DEPS_LIST
set +x verbose
else
echo $DEPS_LIST
fi
exit 0
;;
*)
./gen-version
autoreconf -i -f
;;
esac