summaryrefslogtreecommitdiff
path: root/packaging/checks.sh
blob: 63e88701f332b53371e39e71a97aef7fbd68a661 (plain)
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
#! /bin/sh

# We check for the presence of the tools necessary to build a release on a
# Debian based OS.

TOOLS_STOP=0

checker () {
	if [ ! `which $1` ]
	then
		echo "$1 is missing, please install it" 
		TOOLS_STOP=1 
		NEW_NAME=`echo $1 | sed -e 's/-/_/g'`
		eval "$NEW_NAME=1" 
	else
		echo "$1 found"
	fi
};

echo ~~~~~~~~~~~~ Looking for mandatory programs ~~~~~~~~~~~~ 

for i in cdbs-edit-patch reprepro rpm elinks wget zip gpg rsync
do
  checker $i
done
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~ DONE  ~~~~~~~~~~~~~~~~~~~~~~~ 

if [ 1 = $TOOLS_STOP ] 
then
	[ $cdbs_edit_patch ] && cdbs_edit_patch="cdbs "
	[ $reprepro ] && reprepro="reprepro "
	[ $rpm ] && rpm="rpm "
	[ $elinks ] && elinks="elinks "
	[ $wget ] && wget="wget "
	[ $zip ] && zip="zip "
	[ $gpg ] && gpg="gpg "
	[ $rsync ] && rsync="rsync "

	echo
	echo We suggest you run the command
	echo "apt-get install ${cdbs_edit_patch}${reprepro}${rpm}${elinks}${wget}${zip}${gpg}${rsync}"
	echo
fi

exit $TOOLS_STOP