(file) Return to RPMMakefile CVS log (file) (dir) Up to [Pegasus] / pegasus / rpm

Diff for /pegasus/rpm/RPMMakefile between version 1.1.2.2 and 1.16

version 1.1.2.2, 2007/04/18 21:13:06 version 1.16, 2008/12/16 18:55:38
Line 1 
Line 1 
 #//%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
Line 38 
Line 36 
 ############################################################################### ###############################################################################
  
  
   include pegasus/env_var_Linux.status
   
 RELEASE:=$(shell lsb_release -r -s) RELEASE:=$(shell lsb_release -r -s)
 IDISTRO:=$(shell lsb_release -i -s) IDISTRO:=$(shell lsb_release -i -s)
 PLATFORM:=$(shell /bin/rpm --eval %_target_cpu) PLATFORM:=$(shell /bin/rpm --eval %_target_cpu)
 BRANCH:=$(PEGASUS_BUILD_BRANCH) BRANCH:=$(PEGASUS_BUILD_BRANCH)
 RPM:=rpm RPM:=rpm
   ifndef PEGASUS_RPM_BUILD_DEBUG
 RPMBUILD:=rpmbuild RPMBUILD:=rpmbuild
   else
       RPMBUILD:=rpmbuild -vv
   endif
 RM:=rm RM:=rm
 MV:=mv MV:=mv
 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)
 REMOVE_PEGASUS_DIRECTORY:=$(RM) -Rf pegasus.old; $(MV) pegasus pegasus.old  
   
 ifndef PEGASUS_SRC_RELEASE  
     PEGASUS_SRC_RELEASE:=1  
 endif  
  
 ifdef PEGASUS_BUILD_BRANCH ifdef PEGASUS_BUILD_BRANCH
     ifeq ($(PEGASUS_BUILD_BRANCH),MAIN)     ifeq ($(PEGASUS_BUILD_BRANCH),MAIN)
Line 68 
Line 68 
  
 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 5.1 5.2 5.3),el5,xxx)
 else else
     ifeq ($(findstring RedHat,$(IDISTRO)),RedHat)     ifeq ($(findstring RedHat,$(IDISTRO)),RedHat)
         DISTRO:=REDHAT         DISTRO:=REDHAT
Line 120 
Line 120 
   TOG_PEGASUS_DIR:=tog-pegasus   TOG_PEGASUS_DIR:=tog-pegasus
 endif endif
  
 VERSION:=$(PEGASUS_RPM_VERSION)-$(PEGASUS_SRC_RELEASE)  VERSION:=$(PEGASUS_PRODUCT_VERSION)-$(PEGASUS_PACKAGE_VERSION)
 CORE_RPM:=tog-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm CORE_RPM:=tog-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
 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)
  
Line 138 
Line 139 
         $(USAGE)"                       rpm from the source rpm"         $(USAGE)"                       rpm from the source rpm"
         $(USAGE)"buildRPM             - createSRCRPM createBINRPM"         $(USAGE)"buildRPM             - createSRCRPM createBINRPM"
         $(USAGE)"buildall             - exportSRC buildRPM"         $(USAGE)"buildall             - exportSRC buildRPM"
         $(USAGE)"list                 - list the installed pegasus rpms"          $(USAGE)"list                 - list installed tog-pegasus rpms"
         $(USAGE)"clean                - cleans build and target directories"          $(USAGE)"tests                - runs sample tests and test rpm tests"
           $(USAGE)"install              - installs tog-pegasus core and devel rpms"
           $(USAGE)"world                - cleanRPM buildall install tests"
           $(USAGE)"cleanRPM             - uninstalls tog-pegasus rpms"
         $(USAGE)""         $(USAGE)""
         $(USAGE)"Input variables:"         $(USAGE)"Input variables:"
         $(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"
         $(USAGE)"PEGASUS_RPM_VERSION  - pegasus release version (Required)"  
         $(USAGE)"PEGASUS_SRC_RELEASE  - pegasus source release number"  CORE_PATTERN = \"core*\"
         $(USAGE)"                       defaults to 1 if not specified"  define checkForCores
         $(USAGE)"PEGASUS_RPM_DIRECTORY- path to target binary rpm directory"          @if [ "`find $1 $2  -name $(CORE_PATTERN)`" != "" ]; \
         $(USAGE)"                       if it is not defined"               then echo "*** One or more core files found:" \
         $(USAGE)"                       defaults to /usr/src/redhat"                  "`find $1 $2 -name $(CORE_PATTERN)`"; \
         $(USAGE)"                       for Red Hat distributions"                  exit 1; fi;
         $(USAGE)"                       defaults to /usr/src/packages"          @if [ "$(PEGASUS_CORE_DIR)" != "" ] && \
         $(USAGE)"                       for SUSE distributions"               [ "`find $(PEGASUS_CORE_DIR) -maxdepth 1 -name $(CORE_PATTERN)`" \
         $(USAGE)""                  != "" ]; 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_RPM_VERSION  ifndef PEGASUS_PRODUCT_VERSION
         @$(ECHO) "PEGASUS_RPM_VERSION is not defined"          @$(ECHO) "PEGASUS_PRODUCT_VERSION is not defined"
         @exit 2         @exit 2
 endif endif
         @$(MV) pegasus tog-pegasus-$(PEGASUS_RPM_VERSION)          @$(MV) pegasus $(RPM_SRC_DIR)
         @$(CP) tog-pegasus-$(PEGASUS_RPM_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_RPM_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
  
Line 174 
Line 213 
         @$(RPM) -i $(PEGASUS_RPM_DIRECTORY)/SRPMS/$(SRC_RPM)         @$(RPM) -i $(PEGASUS_RPM_DIRECTORY)/SRPMS/$(SRC_RPM)
         @$(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
  
 buildRPM: createSRCRPM createBINRPM  
   
 buildall: exportSRC buildRPM  
   
 list: list:
         @$(RPM) -qa|$(GREP) tog-pegasus         @$(RPM) -qa|$(GREP) tog-pegasus
  
 clean:  tests:
         -$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS))          # Start cimserver
         -$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS))          -$(call stopCIMServer)
         -$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS))          $(call startCIMServer)
         -$(RM) -rf $(PEGASUS_RPM_DIRECTORY)/BUILD/tog-pegasus-$(VERSION)          $(call checkForCores,./,-maxdepth 1)
         -$(REMOVE_PEGASUS_DIRECTORY)  
         -$(RM) -rf pegasus      tog-pegasus-*          # Run some sanity tests
         -$(RM) -rf /var/tmp/tog-pegasus-*          # osinfo, cimserver -v, cimprovider -l -s, cimconfig -l -c etc
           @$(ECHO) "+++++ Running sanity checks +++++"
           @$(ECHO) "+++++ Running osinfo +++++"
           $(PEGASUS_BIN_DIR)/osinfo
           $(call checkForCores,./,-maxdepth 1)
   
           @$(ECHO) "+++++ Running cimserver -v +++++"
           $(PEGASUS_SBIN_DIR)/cimserver -v
           $(call checkForCores,./,-maxdepth 1)
   
           @$(ECHO) "+++++ Running cimconfig +++++"
           $(PEGASUS_SBIN_DIR)/cimconfig -l -c
           $(call checkForCores,./,-maxdepth 1)
   
           @$(ECHO) "+++++ Running cimprovider +++++"
           $(PEGASUS_BIN_DIR)/cimprovider -l -s
           $(call checkForCores,./,-maxdepth 1)
   
           @$(ECHO) "+++++ Stopping cimserver +++++"
           @$(call stopCIMServer)
           $(call checkForCores,./,-maxdepth 1)
   
           @$(ECHO) "+++++ Starting cimserver +++++"
           $(call startCIMServer)
           $(call checkForCores,./,-maxdepth 1)
   
           # Run samples
           @$(ECHO) "+++++ Running samples +++++"
           $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile
           $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile setupSDK
           $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile testSDK
           $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile unsetupSDK
           $(call checkForCores,$(PEGASUS_SAMPLES_DIR),)
   
           # Install the test RPM after running SDK tests. This is because
           # the test RPM over-writes the repository.
           @$(ECHO) "+++++ Installing 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 tests
           $(call checkForCores,$(PEGASUS_TEST_DIR),)
   
   # Install rpms
   install:
           @$(ECHO) "+++++ Installing RPMs +++++"
           $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(CORE_RPM)
           $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(SDK_RPM)
           $(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts
   
   cleanRPM:
           $(call removeRPM,tog-pegasus-test);
           -$(call startCIMServer)
           $(call removeRPM,tog-pegasus-devel);
           $(call removeRPM,tog-pegasus);
           -$(RM) -Rf $(RPM_SRC_DIR).old
   ifneq ($(wildcard $(RPM_SRC_DIR)), )
           $(MV) $(RPM_SRC_DIR) $(RPM_SRC_DIR).old
   endif
   
   buildRPM: cleanRPM createSRCRPM createBINRPM
   
   buildall: exportSRC buildRPM
  
   world: buildall install tests


Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.16

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2