summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-10-04 18:06:47 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-10-04 18:06:47 +0000
commit3da6cdad0023b553507797ba3e7b656e930134d4 (patch)
tree36f333984e57bf12f0fc5e14b1431a30b99dbec1
parentb789eafda708e700c733aee4195b586192b642c2 (diff)
* install_prereq is not a build script. Move it to main directory
(which is our scripts directory). * Don't run/print install command when there's nothing to install. * Fix install_prereq command in README . Merged revisions 3109-3112 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3113 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--README6
-rwxr-xr-xcontrib/scripts/install_prereq93
-rwxr-xr-xinstall_prereq (renamed from build_tools/install_prereq)6
3 files changed, 9 insertions, 96 deletions
diff --git a/README b/README
index 8f094d2..7f47d44 100644
--- a/README
+++ b/README
@@ -47,15 +47,15 @@ Build Requirements
You will need a matching kernel source tree and a working Linux build
system. Some of the programs require some additional libraries.
-The script build_tools/install_prereq should help you install the
+The script install_prereq should help you install the
required packages. To see what it suggests, run:
- build_tools/install_prereq test
+ ./install_prereq test
You can either copy/paste that code to a terminal to run it, or just
run:
- build_tools/install_prereq test
+ ./install_prereq install
Kernel Source / "Headers"
diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
deleted file mode 100755
index 5489569..0000000
--- a/contrib/scripts/install_prereq
+++ /dev/null
@@ -1,93 +0,0 @@
-#! /bin/sh
-
-# install_prereq: a script to install distribution-specific
-# prerequirements
-
-set -e
-
-usage() {
- echo "$0: a script to install distribution-specific prerequirement"
- echo 'Revision: $Id$'
- echo ""
- echo "Usage: $0: Shows this message."
- echo "Usage: $0 test Prints commands it is about to run."
- echo "Usage: $0 install Really install."
-}
-
-# Basic build system:
-PACKAGES_DEBIAN="build-essential"
-# Asterisk: basic requirements:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN bison libncurses-dev libz-dev libssl-dev"
-# Asterisk: very useful addons:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcurl-dev libspeex-dev libogg-dev libvorbis-dev libasound2-dev"
-# Asterisk: nice-to-have addons:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN libpq-dev unixodbc-dev libsqlite-dev"
-# Not so nice addon:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN libopenh323-dev"
-# Extras for 1.4:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN libsnmp-dev libiksemel-dev "
-
-PACKAGES_RH="gcc gcc-c++ bison ncurses-devel openssl-devel"
-
-KVERS=`uname -r`
-
-case "$1" in
-test) testcmd=echo ;;
-install) testcmd='' ;;
-'') usage; exit 0 ;;
-*) usage; exit 1 ;;
-esac
-
-in_test_mode() {
- test "$testcmd" != ''
-}
-
-# Fixme: should be done by apt and not by dpkg?
-check_installed_debs() {
- dpkg-query -W --showformat '${Status} ${Package}\n' "$@" 2>/dev/null \
- | awk '/ not-installed/{print $4}'
-}
-
-# parsing the output of yum is close to impossible.
-# We'll use rpm and hope for the best:
-check_installed_rpms() {
- for pack in "$@"
- do
- if ! rpm -q $pack >/dev/null 2>/dev/null
- then echo $pack
- fi
- done
-}
-
-handle_debian() {
- # echo "# Distribution is Debian or compatible"
- extra_packs=`check_installed_debs $PACKAGES_DEBIAN`
- $testcmd apt-get install -y $extra_packs
-}
-
-handle_rh() {
- # echo "# Distribution is Debian or compatible"
- extra_packs=`check_installed_rpms $PACKAGES_RH`
- $testcmd yum install -y $extra_packs
-}
-
-if in_test_mode; then
- echo "#############################################"
- echo "## $1: test mode."
- echo "## Use the commands here to install your system."
- echo "#############################################"
-fi
-
-# handle the easy case of Debians first
-if [ -r /etc/debian_version ]; then
- handle_debian
-elif [ -r /etc/redhat-release ]; then
- handle_rh
-fi
-
-echo "#############################################"
-echo "## $1 completed successfully"
-if in_test_mode; then
- echo "## (in test mode)"
-fi
-echo "#############################################"
diff --git a/build_tools/install_prereq b/install_prereq
index 56463b4..dac0189 100755
--- a/build_tools/install_prereq
+++ b/install_prereq
@@ -64,6 +64,9 @@ handle_debian() {
esac
echo "# Kernel source not found. Installing $kernel_package"
fi
+ if [ "$extra_packs$kernel_package" = '' ]; then
+ return
+ fi
$testcmd apt-get install -y $extra_packs $kernel_package
}
@@ -87,6 +90,9 @@ handle_rh() {
echo "#"
echo "# and then reboot to upgrade to the newly installed kernel."
fi
+ if [ "$extra_packs$kernel_package" = '' ]; then
+ return
+ fi
$testcmd yum install -y $extra_packs $kernel_package
}