summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-deps.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/scripts/check-deps.sh b/scripts/check-deps.sh
new file mode 100755
index 0000000..7568e47
--- /dev/null
+++ b/scripts/check-deps.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+check_app()
+{
+ which $1 2>/dev/null 1>/dev/null
+ local result=$?
+
+ echo -n "Checking $1..."
+
+ if [ $result -gt 0 ]; then
+ echo 'Not found'
+ exit 1
+ else
+ echo 'Found'
+ fi
+}
+
+check_pkg()
+{
+ $pkg | grep $1 2>/dev/null 1>/dev/null
+ local result=$?
+ echo -n "Checking $1..."
+
+ if [ $result -gt 0 ]; then
+ echo 'Not found'
+ exit 1
+ else
+ echo 'Found'
+ fi
+}
+
+fedora()
+{
+ check_app gcc
+ check_app make
+ check_pkg glibc-static
+}
+
+osname=`cat /etc/os-release | grep ^ID= | sed -E 's/.*=(.*)/\1/'`
+osver=`cat /etc/os-release | grep ^VERSION_ID= | sed -E 's/.*=(.*)/\1/g'`
+
+case $osname in
+ fedora)
+ pkg="dnf list installed"
+ fedora
+ ;;
+ freebsd)
+ ;;
+esac
+
+echo
+echo 'You can proceed building Alex GNU/Linux'