version 1.7, 2008/10/16 17:59:48
|
version 1.9, 2008/11/18 19:32:21
|
|
|
| |
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 |
|
|
SDK_RPM:=tog-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm | SDK_RPM:=tog-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
TEST_RPM:=tog-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm | TEST_RPM:=tog-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
SRC_RPM:=tog-pegasus-$(VERSION).src.rpm | SRC_RPM:=tog-pegasus-$(VERSION).src.rpm |
|
RPM_SRC_DIR:=$(shell echo tog-pegasus-$(PEGASUS_PRODUCT_VERSION)) |
| |
USAGE = @$(ECHO) $(1) | USAGE = @$(ECHO) $(1) |
| |
|
|
$(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 |
|
|
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 |
| |
|
|
@$(ECHO) "PEGASUS_PRODUCT_VERSION is not defined" | @$(ECHO) "PEGASUS_PRODUCT_VERSION is not defined" |
@exit 2 | @exit 2 |
endif | endif |
@$(MV) pegasus tog-pegasus-$(PEGASUS_PRODUCT_VERSION) |
@$(MV) pegasus $(RPM_SRC_DIR) |
@$(CP) tog-pegasus-$(PEGASUS_PRODUCT_VERSION)/rpm/tog-pegasus.spec $(PEGASUS_RPM_DIRECTORY)/SPECS |
@$(CP) $(RPM_SRC_DIR)/rpm/tog-pegasus.spec \ |
@tar czf tog-pegasus-$(VERSION).tar.gz tog-pegasus-$(PEGASUS_PRODUCT_VERSION) |
$(PEGASUS_RPM_DIRECTORY)/SPECS |
|
@tar czf tog-pegasus-$(VERSION).tar.gz $(RPM_SRC_DIR) |
@$(CP) tog-pegasus-$(VERSION).tar.gz $(PEGASUS_RPM_DIRECTORY)/SOURCES/$(TOG_PEGASUS_DIR) | @$(CP) tog-pegasus-$(VERSION).tar.gz $(PEGASUS_RPM_DIRECTORY)/SOURCES/$(TOG_PEGASUS_DIR) |
@$(RPMBUILD) -bs $(PEGASUS_RPM_DIRECTORY)/SPECS/tog-pegasus.spec | @$(RPMBUILD) -bs $(PEGASUS_RPM_DIRECTORY)/SPECS/tog-pegasus.spec |
| |
|
|
# Start cimserver | # Start cimserver |
-$(CIMSERVER_STOP_SERVICE) | -$(CIMSERVER_STOP_SERVICE) |
$(CIMSERVER_START_SERVICE) | $(CIMSERVER_START_SERVICE) |
@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) | @$(CIMSERVER_STOP_SERVICE) |
@check_for_core |
$(call checkForCores,./,-maxdepth 1) |
| |
@$(ECHO) "+++++ Starting cimserver +++++" | @$(ECHO) "+++++ Starting cimserver +++++" |
$(CIMSERVER_START_SERVICE) | $(CIMSERVER_START_SERVICE) |
@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: |
|
|
-$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS)) | -$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS)) |
-$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS)) | -$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS)) |
-$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS)) | -$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS)) |
-$(RM) -Rf tog-pegasus-$(PEGASUS_PRODUCT_VERSION).old |
-$(RM) -Rf $(RPM_SRC_DIR).old |
@if test -d tog-pegasus-$(PEGASUS_RPM_VERSION); then \ |
ifneq ($(wildcard $(RPM_SRC_DIR)), ) |
$(MV) tog-pegasus-$(PEGASUS_PRODUCT_VERSION) tog-pegasus-$(PEGASUS_PRODUCT_VERSION).old; \ |
$(MV) $(RPM_SRC_DIR) $(RPM_SRC_DIR).old |
fi |
endif |
| |
buildRPM: cleanRPM createSRCRPM createBINRPM | buildRPM: cleanRPM createSRCRPM createBINRPM |
| |