From e9de694a600f0bb68384ab003cd38cac6f32561d Mon Sep 17 00:00:00 2001
From: mxi1 <mxi1@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Date: Mon, 17 Jan 2011 09:01:37 +0000
Subject: [PATCH] for defect 3138248, add one checkpoint to check whether
 dhcp-server is installed on SuSE or not, which doesn't affect RedHat.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8678 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
---
 xCAT/xCAT.spec | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec
index 224574b4b..055fc3dd4 100644
--- a/xCAT/xCAT.spec
+++ b/xCAT/xCAT.spec
@@ -64,6 +64,21 @@ tar -xf postscripts.tar
 
 %build
 
+%pre
+if [ -e "/etc/SuSE-release" ]; then
+    # In SuSE, dhcp-server provides the dhcp server, which is different from the RedHat.
+    # When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't 
+    # have such one package.
+    # so there's only one solution, Yes, it looks ugly.
+    rpm -q dhcp-server >/dev/null
+    if [ $? != 0 ]; then
+        echo ""
+        echo "!! On SuSE, the dhcp-server package should be installed before installing xCAT !!"
+        exit -1;
+    fi
+fi
+
+
 %install
 mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d
 mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d