BUG#: 8757
[tpot/pegasus/.git] / rpm / tog-pegasus.spec
1 #//%LICENSE////////////////////////////////////////////////////////////////
2 #//
3 #// Licensed to The Open Group (TOG) under one or more contributor license
4 #// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
5 #// this work for additional information regarding copyright ownership.
6 #// Each contributor licenses this file to you under the OpenPegasus Open
7 #// Source License; you may not use this file except in compliance with the
8 #// License.
9 #//
10 #// Permission is hereby granted, free of charge, to any person obtaining a
11 #// copy of this software and associated documentation files (the "Software"),
12 #// to deal in the Software without restriction, including without limitation
13 #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 #// and/or sell copies of the Software, and to permit persons to whom the
15 #// Software is furnished to do so, subject to the following conditions:
16 #//
17 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
19 #//
20 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #//
28 #//////////////////////////////////////////////////////////////////////////
29 #%/////////////////////////////////////////////////////////////////////////////
30 #
31 # tog-pegasus.spec
32 #
33 #%/////////////////////////////////////////////////////////////////////////////
34
35 #
36 # WARNING: This file is automatically generated by executing
37 #   make -f pegasus/Makefile.Release create_OpenPegasusRPMSpecFile
38 # Any changes made directly to this file in the OpenPegasus source will
39 # be lost the next time this file is regenerated and submitted to CVS.
40 #
41
42 %define Flavor  tog
43 %define packageVersion 1
44 Version: 2.11.0
45 Release: %{packageVersion}%{?LINUX_VERSION:.%{LINUX_VERSION}}
46 Epoch:   1
47
48 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-intro.spec
49 #
50 %{?!PEGASUS_BUILD_TEST_RPM:   %define PEGASUS_BUILD_TEST_RPM        0}
51 # do "rpmbuild --define 'PEGASUS_BUILD_TEST_RPM 1'" to build test RPM.
52 #
53 %{?!AUTOSTART:   %define AUTOSTART        0}
54 # Use "rpm -[iU]vh --define 'AUTOSTART 1'" in order to have cimserver enabled
55 # (chkconfig --level=345 tog-pegasus on) after installation.
56 #
57 # Use "rpmbuild --define 'JMPI_PROVIDER_REQUESTED 1'" to include JMPI support.
58 %{?!JMPI_PROVIDER_REQUESTED: %define JMPI_PROVIDER_REQUESTED 0}
59
60 Summary:   OpenPegasus WBEM Services for Linux
61 Name:      %{Flavor}-pegasus
62 Group:     Systems Management/Base
63 License:   Open Group Pegasus Open Source
64 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
65 URL:       http://www.openpegasus.org
66
67 Source:    %{name}-%{version}-%{packageVersion}.tar.gz
68 #
69 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-intro.spec
70
71 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-buildRequires.spec
72 #
73 BuildRequires:      bash, sed, grep, coreutils, procps, gcc, gcc-c++
74 BuildRequires:      libstdc++, make, pam-devel
75 BuildRequires:      openssl-devel >= 0.9.6, e2fsprogs
76 %if %{JMPI_PROVIDER_REQUESTED}
77 BuildRequires:      gcc-java, libgcj-devel, libgcj, java-1.4.2-gcj-compat
78 Requires:           libgcj, java-1.4.2-gcj-compat
79 %endif
80 BuildRequires:      net-snmp-devel
81 #
82 # End of section  pegasus/rpm/tog-specfiles/tog-pegasus-buildRequires.spec
83
84 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-requires.spec
85 #
86 Requires:           bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
87 #Requires:          krb5-libs, redhat-lsb, chkconfig, SysVinit, bind-libs
88 Requires:           e2fsprogs, bind-utils, net-tools
89 Requires(post):     bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
90 #Requires(post):    krb5-libs, redhat-lsb, chkconfig, SysVinit, bind-libs
91 Requires(post):     e2fsprogs, bind-utils, net-tools
92 Requires(pre):      bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
93 #Requires(pre):     krb5-libs, redhat-lsb, chkconfig, SysVinit, bind-libs
94 Requires(pre):      e2fsprogs, bind-utils, net-tools
95 Requires(postun):   bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
96 #Requires(postun):  krb5-libs, redhat-lsb, chkconfig, SysVinit, bind-libs
97 Requires(postun):   e2fsprogs, bind-utils, net-tools
98 Requires:           net-snmp
99 #
100 # End of section  pegasus/rpm/tog-specfiles/tog-pegasus-requires.spec
101
102 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-desc.spec
103 #
104 Conflicts: openwbem
105 Provides: %{Flavor}-pegasus-cimserver
106 BuildConflicts: %{Flavor}-pegasus
107
108 %description
109 OpenPegasus WBEM Services for Linux enables management solutions that deliver
110 increased control of enterprise resources. WBEM is a platform and resource
111 independent DMTF standard that defines a common information model and
112 communication protocol for monitoring and controlling resources from diverse
113 sources.
114 #
115 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-desc.spec
116
117 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-arch.spec
118 #
119 %ifarch ia64
120 %global PEGASUS_HARDWARE_PLATFORM LINUX_IA64_GNU
121 %else
122 %ifarch x86_64
123 %global PEGASUS_HARDWARE_PLATFORM LINUX_X86_64_GNU
124 %else
125 %ifarch ppc
126 %global PEGASUS_HARDWARE_PLATFORM LINUX_PPC_GNU
127 %else
128 %ifarch ppc64 pseries
129 %global PEGASUS_HARDWARE_PLATFORM LINUX_PPC64_GNU
130 %else
131 %ifarch s390
132 %global PEGASUS_HARDWARE_PLATFORM LINUX_ZSERIES_GNU
133 %else
134 %ifarch s390x zseries
135 %global PEGASUS_HARDWARE_PLATFORM LINUX_ZSERIES64_GNU
136 %else
137 %global PEGASUS_HARDWARE_PLATFORM LINUX_IX86_GNU
138 %endif
139 %endif
140 %endif
141 %endif
142 %endif
143 %endif
144 #
145 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-arch.spec
146
147 %global PEGASUS_ARCH_LIB %{_lib}
148 %global OPENSSL_HOME /usr
149 %global OPENSSL_BIN /usr/bin
150 %global PEGASUS_PEM_DIR /etc/Pegasus
151 %global PEGASUS_SSL_CERT_FILE server.pem
152 %global PEGASUS_SSL_KEY_FILE file.pem
153 %global PEGASUS_SSL_TRUSTSTORE client.pem
154 %global PAM_CONFIG_DIR /etc/pam.d
155 %global PEGASUS_CONFIG_DIR /etc/Pegasus
156 %global PEGASUS_VARDATA_DIR /var/lib/Pegasus
157 %global PEGASUS_VARDATA_CACHE_DIR /var/lib/Pegasus/cache
158 %global PEGASUS_LOCAL_DOMAIN_SOCKET_PATH  /var/run/tog-pegasus/socket/cimxml.socket
159 %global PEGASUS_CIMSERVER_START_FILE /var/run/tog-pegasus/cimserver.pid
160 %global PEGASUS_TRACE_FILE_PATH /var/lib/Pegasus/cache/trace/cimserver.trc
161 %global PEGASUS_CIMSERVER_START_LOCK_FILE /var/run/tog-pegasus/cimserver_start.lock
162 %global PEGASUS_REPOSITORY_DIR /var/lib/Pegasus/repository
163 %global PEGASUS_PREV_REPOSITORY_DIR_NAME prev_repository
164 %global PEGASUS_REPOSITORY_PARENT_DIR /var/lib/Pegasus
165 %global PEGASUS_PREV_REPOSITORY_DIR /var/lib/Pegasus/prev_repository
166 %global PEGASUS_SBIN_DIR /usr/sbin
167 %global PEGASUS_DOC_DIR /usr/share/doc/tog-pegasus-2.11
168
169 %global PEGASUS_RPM_ROOT  $RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION
170 %global PEGASUS_RPM_HOME %PEGASUS_RPM_ROOT/build
171 %global PEGASUS_INSTALL_LOG /var/lib/Pegasus/log/install.log
172
173 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-packages.spec
174 #
175 %package devel
176 Summary: The OpenPegasus Software Development Kit
177 Group: Systems Management/Base
178 Requires: %{Flavor}-pegasus >= %{version}
179 Obsoletes: %{Flavor}-pegasus-sdk
180
181 %description devel
182 The OpenPegasus WBEM Services for Linux SDK is the developer's kit for the
183 OpenPegasus WBEM Services for Linux release. It provides Linux C++ developers
184 with the WBEM files required to build WBEM Clients and Providers. It also
185 supports C provider developers via the CMPI interface.
186
187 %if %{PEGASUS_BUILD_TEST_RPM}
188 %package test
189 Summary: The OpenPegasus Tests
190 Group: Systems Management/Base
191 Requires: %{Flavor}-pegasus >= %{version}
192
193 %description test
194 The OpenPegasus WBEM tests for the OpenPegasus %{version} Linux rpm.
195 %endif
196 #
197 #End of section pegasus/rpm/tog-specfiles/tog-pegasus-packages.spec
198
199 %prep
200 %setup -q -n %{name}-%{version}
201
202 %build
203 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-build.spec
204 #
205 export PEGASUS_ROOT=%PEGASUS_RPM_ROOT
206 export PEGASUS_HOME=%PEGASUS_RPM_HOME
207 export PEGASUS_PLATFORM=%PEGASUS_HARDWARE_PLATFORM
208 export PEGASUS_ARCH_LIB=%PEGASUS_ARCH_LIB
209 export PEGASUS_ENVVAR_FILE=$PEGASUS_ROOT/env_var_Linux.status
210
211 export OPENSSL_HOME=%OPENSSL_HOME
212 export OPENSSL_BIN=%OPENSSL_BIN
213 export LD_LIBRARY_PATH=$PEGASUS_HOME/lib
214 export PATH=$PEGASUS_HOME/bin:$PATH
215
216 export PEGASUS_EXTRA_C_FLAGS="$RPM_OPT_FLAGS -g -Wno-unused"
217 export PEGASUS_EXTRA_CXX_FLAGS="$PEGASUS_EXTRA_C_FLAGS"
218 export PEGASUS_EXTRA_LINK_FLAGS="$RPM_OPT_FLAGS"
219 #export PEGASUS_EXTRA_LINK_FLAGS="$RPM_OPT_FLAGS -g -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack"
220
221 %if %{PEGASUS_BUILD_TEST_RPM}
222 export PEGASUS_TMP=/usr/share/Pegasus/test/tmp
223 export PEGASUS_DISPLAYCONSUMER_DIR="$PEGASUS_TMP"
224 %endif
225
226 %if %{JMPI_PROVIDER_REQUESTED}
227 sed -i 's/PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=.*$/PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=true/' $PEGASUS_ENVVAR_FILE
228 %else
229 sed -i 's/PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=.*$/PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=false/' $PEGASUS_ENVVAR_FILE
230 %endif
231
232 make -f $PEGASUS_ROOT/Makefile.Release create_ProductVersionFile
233 make -f $PEGASUS_ROOT/Makefile.Release create_CommonProductDirectoriesInclude
234 make -f $PEGASUS_ROOT/Makefile.Release create_ConfigProductDirectoriesInclude
235 make %{?_smp_mflags} -f $PEGASUS_ROOT/Makefile.Release all
236 chmod 777 %PEGASUS_RPM_HOME
237 make -f $PEGASUS_ROOT/Makefile.Release repository
238 #
239 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-build.spec
240
241 %install
242 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-install.spec
243 #
244 export PEGASUS_ROOT=%PEGASUS_RPM_ROOT
245 export PEGASUS_HOME=%PEGASUS_RPM_HOME
246 export PEGASUS_PLATFORM=%PEGASUS_HARDWARE_PLATFORM
247 export PEGASUS_ARCH_LIB=%PEGASUS_ARCH_LIB
248 export PEGASUS_ENVVAR_FILE=$PEGASUS_ROOT/env_var_Linux.status
249
250 export OPENSSL_BIN=%OPENSSL_BIN
251 export LD_LIBRARY_PATH=$PEGASUS_HOME/lib
252 export PATH=$PEGASUS_HOME/bin:$PATH
253
254 export PEGASUS_STAGING_DIR=$RPM_BUILD_ROOT
255
256 %if %{PEGASUS_BUILD_TEST_RPM}
257 make -f $PEGASUS_ROOT/Makefile.Release stage \
258     PEGASUS_STAGING_DIR=$PEGASUS_STAGING_DIR \
259     PEGASUS_BUILD_TEST_RPM=%{PEGASUS_BUILD_TEST_RPM}
260 %else
261 make -f $PEGASUS_ROOT/Makefile.Release stage \
262     PEGASUS_STAGING_DIR=$PEGASUS_STAGING_DIR
263 %endif
264
265 [ "$PEGASUS_HOME" != "/" ] && [ -d $PEGASUS_HOME ] && rm -rf $PEGASUS_HOME;
266 #
267 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-install.spec
268
269 %clean
270 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-clean.spec
271 #
272 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT;
273 [ "${RPM_BUILD_DIR}" != "/" ] && rm -rf ${RPM_BUILD_DIR}/%{name}-%{version};
274 #
275 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-clean.spec
276
277 %pre
278 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-pre.spec
279 #           install   remove   upgrade  reinstall
280 # pre          1        -         2         2
281 #
282 # If it exists, the active OpenPegasus Repository
283 #    directory, %PEGASUS_REPOSITORY_DIR is renamed
284 #    to %PEGASUS_PREV_REPOSITORY_DIR.  If
285 #    %PEGASUS_PREV_REPOSITORY_DIR already exists,
286 #    it is saved as an archive file.
287
288 if [ -d %PEGASUS_REPOSITORY_DIR"/root#PG_Internal" ]; then
289    #
290    # Save the current repository to prev_repository
291    #
292    if [ -d %PEGASUS_PREV_REPOSITORY_DIR ]; then
293         /bin/tar -C %PEGASUS_REPOSITORY_PARENT_DIR -cf \
294             %PEGASUS_PREV_REPOSITORY_DIR`date '+%Y-%m-%d-%s.%N'`.tar \
295             %PEGASUS_PREV_REPOSITORY_DIR_NAME
296         rm -rf %PEGASUS_PREV_REPOSITORY_DIR
297    fi
298    /bin/mv %PEGASUS_REPOSITORY_DIR %PEGASUS_PREV_REPOSITORY_DIR
299 fi
300 if [ $1 -gt 0 ]; then
301    #  Create the 'pegasus' user and group:
302    /usr/sbin/groupadd pegasus > /dev/null 2>&1 || :;
303    /usr/sbin/useradd -c "%{Flavor}-pegasus OpenPegasus WBEM/CIM services" \
304         -g pegasus -s /sbin/nologin -r -d %PEGASUS_VARDATA_DIR pegasus \
305          > /dev/null 2>&1 || :;
306 fi
307 if [ $1 -eq 2 ]; then
308     rm -f %PEGASUS_LOCAL_DOMAIN_SOCKET_PATH;
309     rm -f %PEGASUS_CIMSERVER_START_FILE;
310     rm -f %PEGASUS_CIMSERVER_START_LOCK_FILE;
311 fi
312 #
313 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-pre.spec
314
315 # When Privilege Separation is enabled, create the 'cimsrvr' user and
316 # 'cimsrvr' group which are used as the context of the cimservermain process
317 if [ $1 -gt 0 ]; then
318     /usr/sbin/groupadd cimsrvr > /dev/null 2>&1 || :;
319     /usr/sbin/useradd -c "tog-pegasus OpenPegasus WBEM/CIM services" \
320         -g cimsrvr -s /sbin/nologin -r -d %PEGASUS_VARDATA_DIR cimsrvr \
321         > /dev/null 2>&1 || :;
322 fi
323
324 %post
325 if [ $1 -eq 1 ]; then
326    echo `date` > %PEGASUS_INSTALL_LOG 2>&1
327    %define PEGASUS_CONFIG_DIR /etc/Pegasus
328    %define PEGASUS_PEM_DIR /etc/Pegasus
329    %define PEGASUS_SSL_CERT_FILE server.pem
330    %define PEGASUS_SSL_KEY_FILE file.pem
331    %define PEGASUS_SSL_TRUSTSTORE client.pem
332
333    # Create Symbolic Links for SDK Libraries
334    #
335    ln -sf libpegclient.so.1 /usr/%PEGASUS_ARCH_LIB/libpegclient.so
336    ln -sf libpegcommon.so.1 /usr/%PEGASUS_ARCH_LIB/libpegcommon.so
337    ln -sf libpegprovider.so.1 /usr/%PEGASUS_ARCH_LIB/libpegprovider.so
338    ln -sf libDefaultProviderManager.so.1 /usr/%PEGASUS_ARCH_LIB/libDefaultProviderManager.so
339    ln -sf libCIMxmlIndicationHandler.so.1 /usr/%PEGASUS_ARCH_LIB/libCIMxmlIndicationHandler.so
340    ln -sf libsnmpIndicationHandler.so.1 /usr/%PEGASUS_ARCH_LIB/libsnmpIndicationHandler.so
341
342    # Create Symbolic Links for Packaged Provider Libraries
343    #
344    ln -sf libComputerSystemProvider.so.1 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libComputerSystemProvider.so
345    ln -sf libOSProvider.so.1 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libOSProvider.so
346    ln -sf libProcessProvider.so.1 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libProcessProvider.so
347
348    # Create Symbolic Links for Packaged Provider Managers
349    #
350    ln -sf libCMPIProviderManager.so.1 /usr/%PEGASUS_ARCH_LIB/Pegasus/providerManagers/libCMPIProviderManager.so
351
352
353 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-post.spec
354 #
355 #           install   remove   upgrade  reinstall
356 # %post        1        -         2         2
357 #
358    export PEGASUS_ARCH_LIB=%PEGASUS_ARCH_LIB
359
360    if [ $1 -eq 1 ]; then
361 %if %{AUTOSTART}
362        /sbin/chkconfig --add %{Flavor}-pegasus
363 %endif
364    :;
365    elif [ $1 -gt 0 ]; then
366        /etc/init.d/%{Flavor}-pegasus condrestart
367    :;
368    fi
369 #
370 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-post.spec
371
372 elif [ $1 -gt 1 ]; then
373    # Check if the cimserver is running
374    isRunning=`ps -el | grep cimserver | grep -v "grep cimserver"`
375    if [ "$isRunning" ]; then
376        /etc/init.d/tog-pegasus stop
377    fi
378    if [ -d %PEGASUS_PREV_REPOSITORY_DIR ]; then
379        # The old repository was moved to /var/lib/Pegasus/prev_repository. It should now be upgraded to the new repository /var/lib/Pegasus/repository.
380        %PEGASUS_SBIN_DIR/repupgrade >> %PEGASUS_INSTALL_LOG 2>&1
381        chown -R cimsrvr %PEGASUS_REPOSITORY_DIR
382        chgrp -R cimsrvr %PEGASUS_REPOSITORY_DIR
383    fi
384    if [ -f %PEGASUS_TRACE_FILE_PATH ]; then
385      /bin/mv %PEGASUS_TRACE_FILE_PATH %PEGASUS_TRACE_FILE_PATH-`date '+%Y-%m-%d-%R'`
386    fi
387    if [ "$isRunning" ]; then
388        /etc/init.d/tog-pegasus start
389    fi
390 fi
391
392 %preun
393 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-preun.spec
394 #           install   remove   upgrade  reinstall
395 #  preun       -        0         1         -
396 if [ $1 -eq 0 ]; then
397    # Check if the cimserver is running
398    isRunning=`ps -el | grep cimserver |  grep -v "grep cimserver"`
399    if [ "$isRunning" ]; then
400       %PEGASUS_SBIN_DIR/cimserver -s
401    fi
402    /sbin/chkconfig --del %{Flavor}-pegasus;
403    rm -f %PEGASUS_VARDATA_DIR/cimserver_current.conf;
404    [ -d %PEGASUS_REPOSITORY_DIR ]  && rm -rf %PEGASUS_REPOSITORY_DIR;
405    [ -d %PEGASUS_VARDATA_CACHE_DIR ]  && rm -rf %PEGASUS_VARDATA_CACHE_DIR;
406    rm -f %PEGASUS_LOCAL_DOMAIN_SOCKET_PATH;
407    rm -f %PEGASUS_CIMSERVER_START_FILE;
408    rm -f %PEGASUS_CIMSERVER_START_LOCK_FILE;
409 fi
410 #
411 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-preun.spec
412
413 %preun devel
414 # Check if the SDK has been setup
415 if [ -f /usr/share/Pegasus/samples/SDKIsSetup ]; then
416    make --directory /usr/share/Pegasus/samples -s unsetupSDK
417    if [ $? != 0 ]; then
418       echo "++++++++++++++++++++++++++++++++++++++++++++++" >&2
419       echo "ERROR: Failed to deregister sample providers." >&2
420       echo "To remove the SDK rpm without deregistering" >&2
421       echo "the sample providers, first remove file" >&2
422       echo "/usr/share/Pegasus/samples/SDKIsSetup," >&2
423       echo "then remove SDK rpm." >&2
424       echo "++++++++++++++++++++++++++++++++++++++++++++++" >&2
425       exit 1
426    fi
427 fi
428 make --directory /usr/share/Pegasus/samples -s clean
429
430 %if %{PEGASUS_BUILD_TEST_RPM}
431 %preun test
432 make --directory /usr/share/Pegasus/test -s unsetupTEST
433 [ -d /var/lib/Pegasus/testrepository ] &&  rm -rf /var/lib/Pegasus/testrepository;
434
435 %endif
436 %postun
437 if [ $1 -eq 0 ]; then
438    export LC_ALL=C
439 fi
440 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-postun.spec
441 #
442 #           install   remove   upgrade  reinstall
443 #  postun      -        0         1         -
444 if [ $1 -eq 0 ]; then
445    /usr/sbin/userdel pegasus > /dev/null 2>&1 || :;
446    /usr/sbin/groupdel pegasus > /dev/null 2>&1 || :;
447 fi;
448 #
449 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-postun.spec
450
451 # When Privilege Separation is enabled, delete the 'cimsrvr' user and
452 # 'cimsrvr' group which are used as the context of the cimservermain process
453 if [ $1 -eq 0 ]; then
454     /usr/sbin/userdel cimsrvr > /dev/null 2>&1 || :;
455     /usr/sbin/groupdel cimsrvr > /dev/null 2>&1 || :;
456 fi
457
458 %files
459 %defattr(600,cimsrvr,cimsrvr,700)
460 /var/lib/Pegasus/repository
461
462 %defattr(644,root,pegasus,755)
463 /usr/share/Pegasus/mof
464
465 %defattr(600,root,pegasus,755)
466 %dir /usr/share/doc/tog-pegasus-2.11
467 %dir /usr/share/Pegasus
468 %dir /usr/share/Pegasus/scripts
469 %dir /var/lib/Pegasus
470 %dir /var/lib/Pegasus/cache
471 %dir /var/lib/Pegasus/log
472 %dir /var/lib/Pegasus/cache/localauth
473 %dir /usr/%PEGASUS_ARCH_LIB/Pegasus
474 %dir /usr/%PEGASUS_ARCH_LIB/Pegasus/providers
475 %dir /usr/%PEGASUS_ARCH_LIB/Pegasus/providerManagers
476
477 %dir %attr(755,root,pegasus) /etc/Pegasus
478 %dir %attr(755,cimsrvr,cimsrvr) /var/run/tog-pegasus
479 %dir %attr(1755,cimsrvr,cimsrvr) /var/run/tog-pegasus/socket
480 %dir %attr(1777,root,pegasus) /var/lib/Pegasus/cache/trace
481
482 %config %attr(750,root,pegasus) /etc/init.d/tog-pegasus
483 %config(noreplace) %attr(644,root,root) /var/lib/Pegasus/cimserver_planned.conf
484 %config(noreplace) /etc/Pegasus/access.conf
485 %config(noreplace) /etc/pam.d/wbem
486
487 %ghost %config(noreplace) /etc/Pegasus/ssl.cnf
488 %ghost %config(noreplace) /etc/Pegasus/client.pem
489 %ghost %config(noreplace) /etc/Pegasus/server.pem
490 %ghost %config(noreplace) /etc/Pegasus/file.pem
491 %ghost /var/lib/Pegasus/log/install.log
492
493 %attr(755,root,pegasus) /usr/sbin/*
494 %attr(755,root,pegasus) /usr/bin/*
495 %attr(755,root,pegasus) /usr/%PEGASUS_ARCH_LIB/*.so.1
496 %if %{JMPI_PROVIDER_REQUESTED}
497 %attr(755,root,pegasus) /usr/%PEGASUS_ARCH_LIB/*.jar
498 /usr/%PEGASUS_ARCH_LIB/libJMPIProviderManager.so
499 %endif
500 %attr(755,root,pegasus) /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/*.so.1
501 %attr(755,root,pegasus) /usr/%PEGASUS_ARCH_LIB/Pegasus/providerManagers/*.so.1
502 %attr(750,root,pegasus) /usr/share/Pegasus/scripts/*
503 %attr(644,root,pegasus) /usr/share/man/man1/*
504 %attr(644,root,pegasus) /usr/share/man/man8/*
505
506 %doc %attr(444,root,pegasus) /usr/share/doc/tog-pegasus-2.11/Admin_Guide_Release.pdf
507 %doc %attr(444,root,pegasus) /usr/share/doc/tog-pegasus-2.11/PegasusSSLGuidelines.htm
508 %doc %attr(444,root,pegasus) /usr/share/doc/tog-pegasus-2.11/license.txt
509 %doc %attr(444,root,pegasus) /usr/share/doc/tog-pegasus-2.11/OpenPegasusNOTICE.txt
510 /usr/%PEGASUS_ARCH_LIB/libpegclient.so
511 /usr/%PEGASUS_ARCH_LIB/libpegcommon.so
512 /usr/%PEGASUS_ARCH_LIB/libpegprovider.so
513 /usr/%PEGASUS_ARCH_LIB/libDefaultProviderManager.so
514 /usr/%PEGASUS_ARCH_LIB/libCIMxmlIndicationHandler.so
515 /usr/%PEGASUS_ARCH_LIB/libsnmpIndicationHandler.so
516 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libComputerSystemProvider.so
517 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libOSProvider.so
518 /usr/%PEGASUS_ARCH_LIB/Pegasus/providers/libProcessProvider.so
519 /usr/%PEGASUS_ARCH_LIB/Pegasus/providerManagers/libCMPIProviderManager.so
520
521 %files devel
522 %defattr(644,root,pegasus,755)
523 /usr/share/Pegasus/samples
524 /usr/include/Pegasus
525 %doc %attr(444,root,pegasus) /usr/share/doc/tog-pegasus-2.11/SecurityGuidelinesForDevelopers.html
526 /usr/share/Pegasus/html
527
528 %if %{PEGASUS_BUILD_TEST_RPM}
529 %files test
530 %defattr(-,root,pegasus,-)
531
532 %dir /usr/share/Pegasus/test
533 %dir /usr/share/Pegasus/test/bin
534 %dir /usr/share/Pegasus/test/%PEGASUS_ARCH_LIB
535 %dir /usr/share/Pegasus/test/mak
536 %dir /usr/share/Pegasus/test/tmp
537
538 %ghost /usr/share/Pegasus/test/tmp/procIdFile
539 %ghost /usr/share/Pegasus/test/tmp/trapLogFile
540 %ghost /usr/share/Pegasus/test/tmp/IndicationStressTestLog
541 %ghost /usr/share/Pegasus/test/tmp/oldIndicationStressTestLog
542
543 %attr(744,root,pegasus) /usr/share/Pegasus/test/bin/*
544 %attr(744,root,pegasus) /usr/share/Pegasus/test/%PEGASUS_ARCH_LIB/*
545 %attr(744,root,pegasus) /usr/share/Pegasus/test/mak/*
546 %attr(644,root,pegasus) /usr/share/Pegasus/test/Makefile
547
548 %defattr(600,cimsrvr, cimsrvr,700)
549 /var/lib/Pegasus/testrepository
550 %endif