1 w.otsuka 1.1 #//%2006////////////////////////////////////////////////////////////////////////
2 #//
3 #// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 #// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 #// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 #// IBM Corp.; EMC Corporation, The Open Group.
7 #// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 #// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 #// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 #// EMC Corporation; VERITAS Software Corporation; The Open Group.
11 #// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 #// EMC Corporation; Symantec Corporation; The Open Group.
13 #//
14 #// Permission is hereby granted, free of charge, to any person obtaining a copy
15 #// of this software and associated documentation files (the "Software"), to
16 #// deal in the Software without restriction, including without limitation the
17 #// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 #// sell copies of the Software, and to permit persons to whom the Software is
19 #// furnished to do so, subject to the following conditions:
20 #//
21 #// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 w.otsuka 1.1 #// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 #// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 #// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 #// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 #// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 #// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #//
30 #//==============================================================================
31 ###############################################################################
32 ##
33 ## RPM Makefile for building tog-pegasus rpms
34 ##
35 ## see the usage rule for documentation of rules etc.
36 ##
37 ##
38 ###############################################################################
39
40
|
62 w.otsuka 1.1
63 ifndef PEGASUS_SRC_RELEASE
64 PEGASUS_SRC_RELEASE:=1
65 endif
66
67 ifdef PEGASUS_BUILD_BRANCH
68 ifeq ($(PEGASUS_BUILD_BRANCH),MAIN)
69 PEGASUS_RPM_CVS_TAG:=HEAD
70 else
71 PEGASUS_RPM_CVS_TAG:=$(PEGASUS_BUILD_BRANCH)
72 endif
73 else
74 PEGASUS_RPM_CVS_TAG:=HEAD
75 endif
76
77 ifeq ($(IDISTRO),RedHatEnterpriseServer)
78 DISTRO:=REDHAT
79 export PEGASUS_DISTRO_SUFFIX:=$(if $(filter $(RELEASE),4.92 4.93 5),el5,\
80 xxx)
81 else
82 ifeq ($(findstring RedHat,$(IDISTRO)),RedHat)
83 w.otsuka 1.1 DISTRO:=REDHAT
84 ifeq ($(RELEASE),4)
85 export PEGASUS_DISTRO_SUFFIX=rhel4
86 else
87 ifeq ($(RELEASE),3)
88 export PEGASUS_DISTRO_SUFFIX=rhel3
89 else
90 export PEGASUS_DISTRO_SUFFIX=xxx
91 endif
92 endif
93 else
94 ifeq ($(findstring SUSE,$(IDISTRO)),SUSE)
95 DISTRO:=SUSE
96 ifeq ($(RELEASE),9)
97 export PEGASUS_DISTRO_SUFFIX=sles9
98 else
99 ifeq ($(RELEASE),10)
100 export PEGASUS_DISTRO_SUFFIX=sles10
101 else
102 export PEGASUS_DISTRO_SUFFIX=xxx
103 endif
104 w.otsuka 1.1 endif
105 endif
106 endif
107 endif
108
109 ###############################################################################
110 #
111 # The user may set PEGASUS_RPM_DIRECTORY to the path of their rpm build target.
112 # The source tar file will then be in
113 # PEGASUS_RPM_DIRECTORY/SOURCES/tog-pegasus.
114 # If PEGASUS_RPM_DIRECTORY is not defined the rpm build target path will be
115 # defaulted to the well-known locations on redhat and suse systems.
116 #
117 ###############################################################################
118 ifndef PEGASUS_RPM_DIRECTORY
119 ifeq ($(DISTRO),REDHAT)
120 PEGASUS_RPM_DIRECTORY:=/usr/src/redhat
121 else
122 ifeq ($(DISTRO),SUSE)
123 PEGASUS_RPM_DIRECTORY:=/usr/src/packages
124 endif
125 w.otsuka 1.1 endif
126 TOG_PEGASUS_DIR:=""
127 else
128 TOG_PEGASUS_DIR:=tog-pegasus
129 endif
130
131 VERSION:=$(PEGASUS_RPM_VERSION)-$(PEGASUS_SRC_RELEASE)
132 CORE_RPM:=tog-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
133 SDK_RPM:=tog-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
134 TEST_RPM:=tog-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
135 SRC_RPM:=tog-pegasus-$(VERSION).src.rpm
136
137 USAGE = @$(ECHO) $(1)
138
139 usage:
140 $(USAGE)
141 $(USAGE)"RPMMakefile targets:"
142 $(USAGE)""
143 $(USAGE)"exportSRC - cvs export of pegasus"
144 $(USAGE)"createSRCRPM - creates source rpm"
145 $(USAGE)"createBINRPM - creates binary rpms including the test"
146 w.otsuka 1.1 $(USAGE)" rpm from the source rpm"
147 $(USAGE)"buildRPM - createSRCRPM createBINRPM"
148 $(USAGE)"buildall - exportSRC buildRPM"
|
191 w.otsuka 1.3 tests:
192 # Start cimserver
193 -$(CIMSERVER_STOP_SERVICE)
194 $(CIMSERVER_START_SERVICE)
195 @$(HOME_DIR)/check_for_core
196
197 # Run some sanity tests
198 # osinfo, cimserver -v, cimprovider -l -s, cimconfig -l -c etc
199 @$(ECHO) "+++++ Running sanity checks +++++"
200 @$(ECHO) "+++++ Running osinfo +++++"
201 $(PEGASUS_BIN_DIR)/osinfo
202 -@$(HOME_DIR)/check_for_core
203
204 @$(ECHO) "+++++ Running cimserver -v +++++"
205 $(PEGASUS_SBIN_DIR)/cimserver -v
206 @$(HOME_DIR)/check_for_core
207
208 @$(ECHO) "+++++ Running cimconfig +++++"
209 $(PEGASUS_SBIN_DIR)/cimconfig -l -c
210 @$(HOME_DIR)/check_for_core
211
212 w.otsuka 1.3 @$(ECHO) "+++++ Running cimprovider +++++"
213 $(PEGASUS_BIN_DIR)/cimprovider -l -s
214 @$(HOME_DIR)/check_for_core
215
216 @$(ECHO) "+++++ Stopping cimserver +++++"
217 @$(CIMSERVER_STOP_SERVICE)
218 @$(HOME_DIR)/check_for_core
219
220 @$(ECHO) "+++++ Starting cimserver +++++"
221 $(CIMSERVER_START_SERVICE)
222 @$(HOME_DIR)/check_for_core
223
224 # Run samples
225 @$(ECHO) "+++++ Running samples +++++"
226 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile
227 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile setupSDK
228 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile testSDK
229 @$(HOME_DIR)/check_for_core
230
231 # Install the test RPM after running SDK tests. This is because
232 # the test RPM over-writes the repository.
233 w.otsuka 1.3 @$(ECHO) "+++++ Installing Test RPM +++++"
234 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(TEST_RPM)
235 $(MAKE) --directory=$(PEGASUS_RPM_TEST_DIR) -f Makefile setupTEST
236 $(MAKE) --directory=$(PEGASUS_RPM_TEST_DIR) -f Makefile tests
237 @$(HOME_DIR)/check_for_core
238
239 # Install rpms
240 install:
241 @$(ECHO) "+++++ Installing RPMs +++++"
242 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(CORE_RPM)
243 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(SDK_RPM)
244 $(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts
245
246 cleanRPM:
|
247 w.otsuka 1.1 -$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS))
248 -$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS))
249 -$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS))
|