From b24eaff1bfded58dab4e2cb3a8dfde73a7a72f51 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 14 Oct 2006 11:28:25 +0000 Subject: * added check for requireed perl-modules before the installation process. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@458 95ad53e4-c205-0410-b2fa-d234c58c8868 --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0a39934a..40241dc2 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,10 @@ ifeq ($(SLX_TEMP_PATH),) SLX_TEMP_PATH = /tmp endif +ifeq ($(SLX_INSTALL_LOG),) + SLX_INSTALL_LOG = install.log +endif + tarball: @OPENSLX_SVN_SNAPSHOT=$$( echo $${OPENSLX_SVN_SNAPSHOT} | \ tr [:upper:] [:lower:]); \ @@ -79,6 +83,28 @@ tarball: popd >/dev/null install: + @echo "Checking installation requirements..."; \ + echo $$(date) >${SLX_INSTALL_LOG}; \ + if ! perl -e '$$x=2' 2>>${SLX_INSTALL_LOG} ; then \ + echo " Perl is required, please install it."; \ + exit 1; \ + fi; \ + # many of the following modules are part of core perl, but we check \ + # for them just to be sure... \ + for m in Carp DBI Fcntl FindBin Getopt::Long Pod::Usage ; do \ + if ! perl -e "use $$m" 2>>${SLX_INSTALL_LOG} ; then \ + echo " The perl-module '$$m' is required, please install it."; \ + exit 1; \ + fi; \ + done; \ + # specific database modules are optional, but we tell the user if \ + # support for a database is missing: \ + for m in CSV mysql SQLite; do \ + if ! perl -e "use DBD::$$m" 2>>${SLX_INSTALL_LOG} ; then \ + echo -e " 'DBD::$$m' not found, so $$m-databases will not be\ +supported."; \ + fi; \ + done; @echo "Installing OpenSLX project files" @mkdir -p $(SLX_CONFIG_PATH) \ -p $(SLX_BASE_PATH)/lib \ -- cgit v1.2.3-55-g7522