forked from linuxmuster/linuxmuster-prepare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-depends.sh
executable file
·39 lines (31 loc) · 956 Bytes
/
get-depends.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
#!/bin/sh
#
# thomas@linuxmuster.net
# 20211127
#
set -e
SUDO="$(which sudo)"
if [ -z "$SUDO" ]; then
echo "Please install sudo!"
exit 1
fi
PKGNAME="linuxmuster-prepare"
CONTROL_URL="https://raw.githubusercontent.com/linuxmuster/$PKGNAME/main/debian/control"
echo "###############################################"
echo "# Installing $PKGNAME build depends #"
echo "###############################################"
echo
if [ ! -e debian/control ]; then
echo "debian/control not found!"
exit
fi
if ! grep -q "Source: $PKGNAME" debian/control; then
echo "This is no $PKGNAME source tree!"
exit
fi
# install prerequisites
$SUDO apt-get update
$SUDO apt-get -y install bash bash-completion curl debhelper dpkg-dev || exit 1
# install build depends
BUILDDEPENDS="$(curl -s $CONTROL_URL | sed -n '/Build-Depends:/,/Package:/p' | grep -v ^Package | sed -e 's|^Build-Depends: ||' | sed -e 's|,||g')"
$SUDO apt-get -y install $BUILDDEPENDS || exit 1