add OpenBSD to the install_prereq script

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Michiel van Baak
2009-07-26 14:00:52 +00:00
parent 7244366e7a
commit 85c3b3e3b5

View File

@@ -32,6 +32,8 @@ PACKAGES_DEBIAN="$PACKAGES_DEBIAN libsnmp-dev libiksemel-dev "
PACKAGES_RH="gcc gcc-c++ ncurses-devel openssl-devel" PACKAGES_RH="gcc gcc-c++ ncurses-devel openssl-devel"
PACKAGES_OBSD="popt gmake wget libxml libogg libvorbis curl iksemel spandsp speex iodbc freetds-0.63p1-msdblib mysql-client gmime sqlite sqlite3 jack"
KVERS=`uname -r` KVERS=`uname -r`
case "$1" in case "$1" in
@@ -61,6 +63,15 @@ check_installed_rpms() {
done done
} }
check_installed_pkgs() {
for pack in "$@"
do
if [ `pkg_info -a | grep $pack | wc -l` = 0 ]; then
echo $pack
fi
done
}
handle_debian() { handle_debian() {
# echo "# Distribution is Debian or compatible" # echo "# Distribution is Debian or compatible"
extra_packs=`check_installed_debs $PACKAGES_DEBIAN` extra_packs=`check_installed_debs $PACKAGES_DEBIAN`
@@ -74,6 +85,12 @@ handle_rh() {
$testcmd yum install -y $extra_packs $testcmd yum install -y $extra_packs
} }
handle_obsd() {
# echo "# Distribution is OpenBSD or compatible"
extra_packs=`check_installed_pkgs $PACKAGES_OBSD`
$testcmd pkg_add $extra_packs
}
if in_test_mode; then if in_test_mode; then
echo "#############################################" echo "#############################################"
echo "## $1: test mode." echo "## $1: test mode."
@@ -85,7 +102,7 @@ OS=`uname -s`
unsupported_distro='' unsupported_distro=''
# A number of distributions we don't (yet?) support. # A number of distributions we don't (yet?) support.
if [ "$OS" != 'Linux' ]; then if [ "$OS" != 'Linux' -a "$OS" != 'OpenBSD' ]; then
echo >&2 "$0: Your OS ($OS) is currently not supported. Aborting." echo >&2 "$0: Your OS ($OS) is currently not supported. Aborting."
exit 1 exit 1
fi fi
@@ -116,6 +133,8 @@ if [ -r /etc/debian_version ]; then
handle_debian handle_debian
elif [ -r /etc/redhat-release ]; then elif [ -r /etc/redhat-release ]; then
handle_rh handle_rh
elif [ "$OS" = 'OpenBSD' ]; then
handle_obsd
fi fi
if ! in_test_mode; then if ! in_test_mode; then