version 1.8, 2008/10/20 23:54:50
|
version 1.14, 2008/12/09 19:25:46
|
|
|
#//%2006//////////////////////////////////////////////////////////////////////// |
#//%LICENSE//////////////////////////////////////////////////////////////// |
#// | #// |
#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
#// Licensed to The Open Group (TOG) under one or more contributor license |
#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
#// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with |
#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
#// this work for additional information regarding copyright ownership. |
#// IBM Corp.; EMC Corporation, The Open Group. |
#// Each contributor licenses this file to you under the OpenPegasus Open |
#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
#// Source License; you may not use this file except in compliance with the |
#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
#// License. |
#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
#// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
#// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
#// EMC Corporation; Symantec Corporation; The Open Group. |
|
#// | #// |
#// Permission is hereby granted, free of charge, to any person obtaining a copy |
#// Permission is hereby granted, free of charge, to any person obtaining a |
#// of this software and associated documentation files (the "Software"), to |
#// copy of this software and associated documentation files (the "Software"), |
#// deal in the Software without restriction, including without limitation the |
#// to deal in the Software without restriction, including without limitation |
#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
#// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
#// sell copies of the Software, and to permit persons to whom the Software is |
#// and/or sell copies of the Software, and to permit persons to whom the |
#// furnished to do so, subject to the following conditions: |
#// Software is furnished to do so, subject to the following conditions: |
#// | #// |
#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
#// The above copyright notice and this permission notice shall be included |
#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
#// in all copies or substantial portions of the Software. |
#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
|
#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
|
#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
#// | #// |
#//============================================================================== |
#// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|
#// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
#// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
#// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
#// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
#// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
#// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
#// |
|
#////////////////////////////////////////////////////////////////////////// |
############################################################################### | ############################################################################### |
## | ## |
## RPM Makefile for building tog-pegasus rpms | ## RPM Makefile for building tog-pegasus rpms |
|
|
CP:=cp | CP:=cp |
GREP:=grep | GREP:=grep |
ECHO:=echo | ECHO:=echo |
|
ECHO-E:=echo -e |
TOG_INSTALLED_RPMS:=$(shell $(RPM) -qa|grep tog-pegasus) | TOG_INSTALLED_RPMS:=$(shell $(RPM) -qa|grep tog-pegasus) |
CIMSERVER_START_SERVICE:=$(PEGASUS_SBIN_DIR)/cimserver |
|
CIMSERVER_STOP_SERVICE:=$(PEGASUS_SBIN_DIR)/cimserver -s |
|
| |
ifdef PEGASUS_BUILD_BRANCH | ifdef PEGASUS_BUILD_BRANCH |
ifeq ($(PEGASUS_BUILD_BRANCH),MAIN) | ifeq ($(PEGASUS_BUILD_BRANCH),MAIN) |
|
|
| |
ifeq ($(IDISTRO),RedHatEnterpriseServer) | ifeq ($(IDISTRO),RedHatEnterpriseServer) |
DISTRO:=REDHAT | DISTRO:=REDHAT |
export PEGASUS_DISTRO_SUFFIX:=$(if $(filter $(RELEASE),4.92 4.93 5),el5,\ |
export PEGASUS_DISTRO_SUFFIX:= \ |
xxx) |
$(if $(filter $(RELEASE),4.92 4.93 5),el5,xxx) |
else | else |
ifeq ($(findstring RedHat,$(IDISTRO)),RedHat) | ifeq ($(findstring RedHat,$(IDISTRO)),RedHat) |
DISTRO:=REDHAT | DISTRO:=REDHAT |
|
|
$(USAGE)"PEGASUS_BUILD_BRANCH - pegasus branch to build" | $(USAGE)"PEGASUS_BUILD_BRANCH - pegasus branch to build" |
$(USAGE)" HEAD is used if MAIN is specified" | $(USAGE)" HEAD is used if MAIN is specified" |
| |
|
CORE_PATTERN = \"core*\" |
|
define checkForCores |
|
@if [ "`find $1 $2 -name $(CORE_PATTERN)`" != "" ]; \ |
|
then echo "*** One or more core files found:" \ |
|
"`find $1 $2 -name $(CORE_PATTERN)`"; \ |
|
exit 1; fi; |
|
@if [ "$(PEGASUS_CORE_DIR)" != "" ] && \ |
|
[ "`find $(PEGASUS_CORE_DIR) -maxdepth 1 -name $(CORE_PATTERN)`" \ |
|
!= "" ]; then echo "*** One or more core files found:" \ |
|
"`find $(PEGASUS_CORE_DIR) -maxdepth 1 -name $(CORE_PATTERN)`";\ |
|
exit 1; fi |
|
endef |
|
|
|
define removeRPM |
|
@if [ -n "`rpm -qa | grep $1-[0-9]`" ]; then \ |
|
rpm -e `rpm -qa | grep $1-[0-9]`; \ |
|
fi |
|
endef |
|
|
|
define startCIMServer |
|
@/etc/init.d/tog-pegasus status > /dev/null 2>&1; \ |
|
if [ $$? != 0 ]; then \ |
|
/etc/init.d/tog-pegasus start; \ |
|
fi |
|
endef |
|
|
|
define stopCIMServer |
|
@/etc/init.d/tog-pegasus status > /dev/null 2>&1; \ |
|
if [ $$? == 0 ]; then \ |
|
/etc/init.d/tog-pegasus stop; \ |
|
fi |
|
endef |
|
|
|
|
exportSRC: | exportSRC: |
@cvs -d:pserver:anon@cvs.opengroup.org:/cvs/MSB export -r $(PEGASUS_RPM_CVS_TAG) pegasus | @cvs -d:pserver:anon@cvs.opengroup.org:/cvs/MSB export -r $(PEGASUS_RPM_CVS_TAG) pegasus |
| |
|
enableSQLiteRepository: |
|
$(ECHO-E) "" \ |
|
>> pegasus/env_var_Linux.status |
|
$(ECHO-E) "PEGASUS_USE_SQLITE_REPOSITORY = true" \ |
|
>> pegasus/env_var_Linux.status |
|
ifdef SQLITE_HOME |
|
$(ECHO-E) "SQLITE_HOME = $(SQLITE_HOME)" \ |
|
>> pegasus/env_var_Linux.status |
|
endif |
|
|
createSRCRPM: | createSRCRPM: |
| |
ifndef PEGASUS_PRODUCT_VERSION | ifndef PEGASUS_PRODUCT_VERSION |
|
|
| |
tests: | tests: |
# Start cimserver | # Start cimserver |
-$(CIMSERVER_STOP_SERVICE) |
-$(call stopCIMServer) |
$(CIMSERVER_START_SERVICE) |
$(call startCIMServer) |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
# Run some sanity tests | # Run some sanity tests |
# osinfo, cimserver -v, cimprovider -l -s, cimconfig -l -c etc | # osinfo, cimserver -v, cimprovider -l -s, cimconfig -l -c etc |
@$(ECHO) "+++++ Running sanity checks +++++" | @$(ECHO) "+++++ Running sanity checks +++++" |
@$(ECHO) "+++++ Running osinfo +++++" | @$(ECHO) "+++++ Running osinfo +++++" |
$(PEGASUS_BIN_DIR)/osinfo | $(PEGASUS_BIN_DIR)/osinfo |
-@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Running cimserver -v +++++" | @$(ECHO) "+++++ Running cimserver -v +++++" |
$(PEGASUS_SBIN_DIR)/cimserver -v | $(PEGASUS_SBIN_DIR)/cimserver -v |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Running cimconfig +++++" | @$(ECHO) "+++++ Running cimconfig +++++" |
$(PEGASUS_SBIN_DIR)/cimconfig -l -c | $(PEGASUS_SBIN_DIR)/cimconfig -l -c |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Running cimprovider +++++" | @$(ECHO) "+++++ Running cimprovider +++++" |
$(PEGASUS_BIN_DIR)/cimprovider -l -s | $(PEGASUS_BIN_DIR)/cimprovider -l -s |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Stopping cimserver +++++" | @$(ECHO) "+++++ Stopping cimserver +++++" |
@$(CIMSERVER_STOP_SERVICE) |
@$(call stopCIMServer) |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Starting cimserver +++++" | @$(ECHO) "+++++ Starting cimserver +++++" |
$(CIMSERVER_START_SERVICE) |
$(call startCIMServer) |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
# Run samples | # Run samples |
@$(ECHO) "+++++ Running samples +++++" | @$(ECHO) "+++++ Running samples +++++" |
|
|
$(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile setupSDK | $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile setupSDK |
$(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile testSDK | $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile testSDK |
$(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile unsetupSDK | $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile unsetupSDK |
@check_for_core |
$(call checkForCores,$(PEGASUS_SAMPLES_DIR),) |
| |
# Install the test RPM after running SDK tests. This is because | # Install the test RPM after running SDK tests. This is because |
# the test RPM over-writes the repository. | # the test RPM over-writes the repository. |
|
|
$(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(TEST_RPM) | $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(TEST_RPM) |
$(MAKE) --directory=$(PEGASUS_TEST_DIR) -f Makefile setupTEST | $(MAKE) --directory=$(PEGASUS_TEST_DIR) -f Makefile setupTEST |
$(MAKE) --directory=$(PEGASUS_TEST_DIR) -f Makefile tests | $(MAKE) --directory=$(PEGASUS_TEST_DIR) -f Makefile tests |
@check_for_core |
$(call checkForCores,$(PEGASUS_TEST_DIR),) |
| |
# Install rpms | # Install rpms |
install: | install: |
|
|
$(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts | $(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts |
| |
cleanRPM: | cleanRPM: |
-$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS)) |
$(call removeRPM,tog-pegasus-test); |
-$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS)) |
-$(call startCIMServer) |
-$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS)) |
$(call removeRPM,tog-pegasus-devel); |
|
$(call removeRPM,tog-pegasus); |
-$(RM) -Rf $(RPM_SRC_DIR).old | -$(RM) -Rf $(RPM_SRC_DIR).old |
ifneq ($(wildcard $(RPM_SRC_DIR)), ) | ifneq ($(wildcard $(RPM_SRC_DIR)), ) |
$(MV) $(RPM_SRC_DIR) $(RPM_SRC_DIR).old | $(MV) $(RPM_SRC_DIR) $(RPM_SRC_DIR).old |