version 1.14, 2008/12/09 19:25:46
|
version 1.19, 2013/07/18 13:26:53
|
|
|
GREP:=grep | GREP:=grep |
ECHO:=echo | ECHO:=echo |
ECHO-E:=echo -e | ECHO-E:=echo -e |
TOG_INSTALLED_RPMS:=$(shell $(RPM) -qa|grep tog-pegasus) |
TOG_INSTALLED_RPMS:=$(shell $(RPM) -qa|grep $(PEGASUS_FLAVOR)-pegasus) |
| |
ifdef PEGASUS_BUILD_BRANCH | ifdef PEGASUS_BUILD_BRANCH |
ifeq ($(PEGASUS_BUILD_BRANCH),MAIN) | ifeq ($(PEGASUS_BUILD_BRANCH),MAIN) |
|
|
else | else |
PEGASUS_RPM_CVS_TAG:=HEAD | PEGASUS_RPM_CVS_TAG:=HEAD |
endif | endif |
|
############################################################################### |
|
## |
|
## 32 bit RedHat yield x.x like 5.5 for lsb_release -r -s whereas |
|
## 32 bit SUSE yield x like 11 |
|
## so, need to used findstring for comparing |
|
## |
|
## |
|
############################################################################### |
ifeq ($(IDISTRO),RedHatEnterpriseServer) | ifeq ($(IDISTRO),RedHatEnterpriseServer) |
DISTRO:=REDHAT | DISTRO:=REDHAT |
export PEGASUS_DISTRO_SUFFIX:= \ | export PEGASUS_DISTRO_SUFFIX:= \ |
$(if $(filter $(RELEASE),4.92 4.93 5),el5,xxx) |
$(if $(filter $(RELEASE),4.92 4.93 5 5.1 5.2 5.3),el5,$(if $(filter $(RELEASE),6 6.0),el6,$(if $(filter $(RELEASE),7 7.0),el7,xxx)) |
else | else |
ifeq ($(findstring RedHat,$(IDISTRO)),RedHat) | ifeq ($(findstring RedHat,$(IDISTRO)),RedHat) |
DISTRO:=REDHAT | DISTRO:=REDHAT |
ifeq ($(RELEASE),4) |
ifeq ($(findstring 7, $(RELEASE)),7) |
|
export PEGASUS_DISTRO_SUFFIX=rhel7 |
|
else |
|
ifeq ($(findstring 6, $(RELEASE)),6) |
|
export PEGASUS_DISTRO_SUFFIX=rhel6 |
|
else |
|
ifeq ($(findstring 5, $(RELEASE)),5) |
|
export PEGASUS_DISTRO_SUFFIX=rhel5 |
|
else |
|
ifeq ($(findstring 4, $(RELEASE)),4) |
export PEGASUS_DISTRO_SUFFIX=rhel4 | export PEGASUS_DISTRO_SUFFIX=rhel4 |
else | else |
ifeq ($(RELEASE),3) |
ifeq ($(findstring 3, $(RELEASE)),3) |
export PEGASUS_DISTRO_SUFFIX=rhel3 | export PEGASUS_DISTRO_SUFFIX=rhel3 |
else | else |
export PEGASUS_DISTRO_SUFFIX=xxx | export PEGASUS_DISTRO_SUFFIX=xxx |
endif | endif |
endif | endif |
|
endif |
|
endif |
|
endif |
else | else |
ifeq ($(findstring SUSE,$(IDISTRO)),SUSE) | ifeq ($(findstring SUSE,$(IDISTRO)),SUSE) |
DISTRO:=SUSE | DISTRO:=SUSE |
|
|
ifeq ($(RELEASE),10) | ifeq ($(RELEASE),10) |
export PEGASUS_DISTRO_SUFFIX=sles10 | export PEGASUS_DISTRO_SUFFIX=sles10 |
else | else |
|
ifeq ($(RELEASE),11) |
|
export PEGASUS_DISTRO_SUFFIX=sles11 |
|
else |
export PEGASUS_DISTRO_SUFFIX=xxx | export PEGASUS_DISTRO_SUFFIX=xxx |
endif | endif |
endif | endif |
endif | endif |
endif | endif |
endif | endif |
|
endif |
| |
############################################################################### | ############################################################################### |
# | # |
|
|
endif | endif |
TOG_PEGASUS_DIR:="" | TOG_PEGASUS_DIR:="" |
else | else |
TOG_PEGASUS_DIR:=tog-pegasus |
TOG_PEGASUS_DIR:=$(PEGASUS_FLAVOR)-pegasus |
endif | endif |
| |
VERSION:=$(PEGASUS_PRODUCT_VERSION)-$(PEGASUS_PACKAGE_VERSION) | VERSION:=$(PEGASUS_PRODUCT_VERSION)-$(PEGASUS_PACKAGE_VERSION) |
CORE_RPM:=tog-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
CORE_RPM:=$(PEGASUS_FLAVOR)-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
SDK_RPM:=tog-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
SDK_RPM:=$(PEGASUS_FLAVOR)-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
TEST_RPM:=tog-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
TEST_RPM:=$(PEGASUS_FLAVOR)-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm |
SRC_RPM:=tog-pegasus-$(VERSION).src.rpm |
SRC_RPM:=$(PEGASUS_FLAVOR)-pegasus-$(VERSION).src.rpm |
RPM_SRC_DIR:=$(shell echo tog-pegasus-$(PEGASUS_PRODUCT_VERSION)) |
RPM_SRC_DIR:=$(shell echo $(PEGASUS_FLAVOR)-pegasus-$(PEGASUS_PRODUCT_VERSION)) |
| |
USAGE = @$(ECHO) $(1) | USAGE = @$(ECHO) $(1) |
| |
|
|
endef | endef |
| |
define startCIMServer | define startCIMServer |
@/etc/init.d/tog-pegasus status > /dev/null 2>&1; \ |
@/etc/init.d/$(PEGASUS_FLAVOR)-pegasus status > /dev/null 2>&1; \ |
if [ $$? != 0 ]; then \ | if [ $$? != 0 ]; then \ |
/etc/init.d/tog-pegasus start; \ |
/etc/init.d/$(PEGASUS_FLAVOR)-pegasus start; \ |
fi | fi |
endef | endef |
| |
define stopCIMServer | define stopCIMServer |
@/etc/init.d/tog-pegasus status > /dev/null 2>&1; \ |
@/etc/init.d/$(PEGASUS_FLAVOR)-pegasus status > /dev/null 2>&1; \ |
if [ $$? == 0 ]; then \ | if [ $$? == 0 ]; then \ |
/etc/init.d/tog-pegasus stop; \ |
/etc/init.d/$(PEGASUS_FLAVOR)-pegasus stop; \ |
fi | fi |
endef | endef |
| |
|
|
@$(MV) pegasus $(RPM_SRC_DIR) | @$(MV) pegasus $(RPM_SRC_DIR) |
@$(CP) $(RPM_SRC_DIR)/rpm/tog-pegasus.spec \ | @$(CP) $(RPM_SRC_DIR)/rpm/tog-pegasus.spec \ |
$(PEGASUS_RPM_DIRECTORY)/SPECS | $(PEGASUS_RPM_DIRECTORY)/SPECS |
@tar czf tog-pegasus-$(VERSION).tar.gz $(RPM_SRC_DIR) |
@tar czf $(PEGASUS_FLAVOR)-pegasus-$(VERSION).tar.gz $(RPM_SRC_DIR) |
@$(CP) tog-pegasus-$(VERSION).tar.gz $(PEGASUS_RPM_DIRECTORY)/SOURCES/$(TOG_PEGASUS_DIR) |
@$(CP) $(PEGASUS_FLAVOR)-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 |
| |
createBINRPM: | createBINRPM: |
|
|
@$(RPMBUILD) -bb --define 'LINUX_VERSION $(PEGASUS_DISTRO_SUFFIX)' --define 'PEGASUS_BUILD_TEST_RPM 1' $(PEGASUS_RPM_DIRECTORY)/SPECS/tog-pegasus.spec | @$(RPMBUILD) -bb --define 'LINUX_VERSION $(PEGASUS_DISTRO_SUFFIX)' --define 'PEGASUS_BUILD_TEST_RPM 1' $(PEGASUS_RPM_DIRECTORY)/SPECS/tog-pegasus.spec |
| |
list: | list: |
@$(RPM) -qa|$(GREP) tog-pegasus |
@$(RPM) -qa|$(GREP) $(PEGASUS_FLAVOR)-pegasus |
| |
tests: | tests: |
# Start cimserver | # Start cimserver |
|
|
$(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts | $(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts |
| |
cleanRPM: | cleanRPM: |
$(call removeRPM,tog-pegasus-test); |
$(call removeRPM,$(PEGASUS_FLAVOR)-pegasus-test); |
-$(call startCIMServer) | -$(call startCIMServer) |
$(call removeRPM,tog-pegasus-devel); |
$(call removeRPM,$(PEGASUS_FLAVOR)-pegasus-devel); |
$(call removeRPM,tog-pegasus); |
$(call removeRPM,$(PEGASUS_FLAVOR)-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 |