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
|
66 w.otsuka 1.1
67 ifndef PEGASUS_SRC_RELEASE
68 PEGASUS_SRC_RELEASE:=1
69 endif
70
71 ifdef PEGASUS_BUILD_BRANCH
72 ifeq ($(PEGASUS_BUILD_BRANCH),MAIN)
73 PEGASUS_RPM_CVS_TAG:=HEAD
74 else
75 PEGASUS_RPM_CVS_TAG:=$(PEGASUS_BUILD_BRANCH)
76 endif
77 else
78 PEGASUS_RPM_CVS_TAG:=HEAD
79 endif
80
81 ifeq ($(IDISTRO),RedHatEnterpriseServer)
82 DISTRO:=REDHAT
83 export PEGASUS_DISTRO_SUFFIX:=$(if $(filter $(RELEASE),4.92 4.93 5),el5,\
84 xxx)
85 else
86 ifeq ($(findstring RedHat,$(IDISTRO)),RedHat)
87 w.otsuka 1.1 DISTRO:=REDHAT
88 ifeq ($(RELEASE),4)
89 export PEGASUS_DISTRO_SUFFIX=rhel4
90 else
91 ifeq ($(RELEASE),3)
92 export PEGASUS_DISTRO_SUFFIX=rhel3
93 else
94 export PEGASUS_DISTRO_SUFFIX=xxx
95 endif
96 endif
97 else
98 ifeq ($(findstring SUSE,$(IDISTRO)),SUSE)
99 DISTRO:=SUSE
100 ifeq ($(RELEASE),9)
101 export PEGASUS_DISTRO_SUFFIX=sles9
102 else
103 ifeq ($(RELEASE),10)
104 export PEGASUS_DISTRO_SUFFIX=sles10
105 else
106 export PEGASUS_DISTRO_SUFFIX=xxx
107 endif
108 w.otsuka 1.1 endif
109 endif
110 endif
111 endif
112
113 ###############################################################################
114 #
115 # The user may set PEGASUS_RPM_DIRECTORY to the path of their rpm build target.
116 # The source tar file will then be in
117 # PEGASUS_RPM_DIRECTORY/SOURCES/tog-pegasus.
118 # If PEGASUS_RPM_DIRECTORY is not defined the rpm build target path will be
119 # defaulted to the well-known locations on redhat and suse systems.
120 #
121 ###############################################################################
122 ifndef PEGASUS_RPM_DIRECTORY
123 ifeq ($(DISTRO),REDHAT)
124 PEGASUS_RPM_DIRECTORY:=/usr/src/redhat
125 else
126 ifeq ($(DISTRO),SUSE)
127 PEGASUS_RPM_DIRECTORY:=/usr/src/packages
128 endif
129 w.otsuka 1.1 endif
130 TOG_PEGASUS_DIR:=""
131 else
132 TOG_PEGASUS_DIR:=tog-pegasus
133 endif
134
135 VERSION:=$(PEGASUS_RPM_VERSION)-$(PEGASUS_SRC_RELEASE)
136 CORE_RPM:=tog-pegasus-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
137 SDK_RPM:=tog-pegasus-devel-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
138 TEST_RPM:=tog-pegasus-test-$(VERSION).$(PEGASUS_DISTRO_SUFFIX).$(PLATFORM).rpm
139 SRC_RPM:=tog-pegasus-$(VERSION).src.rpm
140
141 USAGE = @$(ECHO) $(1)
142
143 usage:
144 $(USAGE)
145 $(USAGE)"RPMMakefile targets:"
146 $(USAGE)""
147 $(USAGE)"exportSRC - cvs export of pegasus"
148 $(USAGE)"createSRCRPM - creates source rpm"
149 $(USAGE)"createBINRPM - creates binary rpms including the test"
150 w.otsuka 1.1 $(USAGE)" rpm from the source rpm"
151 $(USAGE)"buildRPM - createSRCRPM createBINRPM"
152 $(USAGE)"buildall - exportSRC buildRPM"
|
195 w.otsuka 1.3 tests:
196 # Start cimserver
197 -$(CIMSERVER_STOP_SERVICE)
198 $(CIMSERVER_START_SERVICE)
199 @$(HOME_DIR)/check_for_core
200
201 # Run some sanity tests
202 # osinfo, cimserver -v, cimprovider -l -s, cimconfig -l -c etc
203 @$(ECHO) "+++++ Running sanity checks +++++"
204 @$(ECHO) "+++++ Running osinfo +++++"
205 $(PEGASUS_BIN_DIR)/osinfo
206 -@$(HOME_DIR)/check_for_core
207
208 @$(ECHO) "+++++ Running cimserver -v +++++"
209 $(PEGASUS_SBIN_DIR)/cimserver -v
210 @$(HOME_DIR)/check_for_core
211
212 @$(ECHO) "+++++ Running cimconfig +++++"
213 $(PEGASUS_SBIN_DIR)/cimconfig -l -c
214 @$(HOME_DIR)/check_for_core
215
216 w.otsuka 1.3 @$(ECHO) "+++++ Running cimprovider +++++"
217 $(PEGASUS_BIN_DIR)/cimprovider -l -s
218 @$(HOME_DIR)/check_for_core
219
220 @$(ECHO) "+++++ Stopping cimserver +++++"
221 @$(CIMSERVER_STOP_SERVICE)
222 @$(HOME_DIR)/check_for_core
223
224 @$(ECHO) "+++++ Starting cimserver +++++"
225 $(CIMSERVER_START_SERVICE)
226 @$(HOME_DIR)/check_for_core
227
228 # Run samples
229 @$(ECHO) "+++++ Running samples +++++"
230 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile
231 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile setupSDK
232 $(MAKE) --directory=$(PEGASUS_SAMPLES_DIR) -f Makefile testSDK
233 @$(HOME_DIR)/check_for_core
234
235 # Install the test RPM after running SDK tests. This is because
236 # the test RPM over-writes the repository.
237 w.otsuka 1.3 @$(ECHO) "+++++ Installing Test RPM +++++"
238 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(TEST_RPM)
239 $(MAKE) --directory=$(PEGASUS_RPM_TEST_DIR) -f Makefile setupTEST
240 $(MAKE) --directory=$(PEGASUS_RPM_TEST_DIR) -f Makefile tests
241 @$(HOME_DIR)/check_for_core
242
243 # Install rpms
244 install:
245 @$(ECHO) "+++++ Installing RPMs +++++"
246 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(CORE_RPM)
247 $(RPM) -ih $(PEGASUS_RPM_DIRECTORY)/RPMS/$(PLATFORM)/$(SDK_RPM)
248 $(PEGASUS_SCRIPT_DIR)/genOpenPegasusSSLCerts
249
250 cleanRPM:
|
251 w.otsuka 1.1 -$(RPM) -e $(filter tog-pegasus-test%,$(TOG_INSTALLED_RPMS))
252 -$(RPM) -e $(filter tog-pegasus-devel%,$(TOG_INSTALLED_RPMS))
253 -$(RPM) -e $(filter tog-pegasus-2%,$(TOG_INSTALLED_RPMS))
|