upgrade to 2.5.1

This commit is contained in:
jvdias 2006-04-07 02:40:20 +00:00
parent 714eca2b40
commit e48b9b75ad

View File

@ -1,45 +1,81 @@
################################################################################ #==============================================================================
# #
# OpenPegasus (Red Hat release) RPM .spec file # OpenPegasus (Red Hat release) RPM .spec file
# #
%{?!WITH_TEST: %define WITH_TEST 0} # tog-pegasus.spec
# do "rpmbuild --define 'WITH_TEST 1'" to build test RPM .
# NOTE: Must use "rpm -[iU]vh --define 'WITH_TEST 1'" for all RPMs if test rpm
# is to be installed.
# DO NOT install test rpm for production use.
%{?!AUTOSTART: %define AUTOSTART 0}
# Use "rpm -[iU]vh --define 'AUTOSTART 1'" in order to have cimserver enabled
# (chkconfig --level=345 tog-pegasus on) after installation.
# #
#%define debug_package %{nil} # Copyright (c) 2000 - 2006,
Summary: OpenPegasus WBEM Services for Linux # The Open Group; Hewlett-Packard Development Company, L.P.; IBM Corp.;
Name: tog-pegasus # BMC Software; Tivoli Systems.
Version: 2.5 # Licensed under the "Open Group Pegasus Open Source" license
Release: 9 # shipped with this software.
Epoch: 2 #
Group: Systems Management/Base # Upstream tog-pegasus.spec file modified for Red Hat build -
License: Open Group Pegasus Open Source # April 2006, Jason Vas Dias <jvdias@redhat.com>, Red Hat Inc.
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root #
URL: http://www.openpegasus.org/ #==============================================================================
%define srcname pegasus
Source0: %{srcname}-%{version}.tar.gz %{?!LINUX_VERSION: %define LINUX_VERSION FC6}
Source1: rpm_build_env #
Source2: README.RedHat.Security %{?!PEGASUS_BUILD_TEST_RPM: %define PEGASUS_BUILD_TEST_RPM 0}
Source3: access.conf # do "rpmbuild --define 'PEGASUS_BUILD_TEST_RPM 1'" to build test RPM.
Source4: genSSLcerts #
Patch0: pegasus-2.5-redhat.patch %{?!NOCLEAN: %define NOCLEAN 0}
Patch1: pegasus-2.5-local-or-remote-auth.patch # ^- 1: don't do %clean
Patch2: pegasus-2.5-make_install.patch %{?!NODEBUGINFO: %define NODEBUGINFO 0}
Patch3: pegasus-2.5-add_cmpi_provider_lib.patch # ^- 1: don't generate debuginfo or strip binaries
Patch4: pegasus-2.5-enable_cql.patch %if %{NODEBUGINFO}
Patch5: pegasus-2.5-bz173401.patch %define debug_package %{nil}
Patch6: pegasus-2.5-syslog_h.patch %endif
Patch7: pegasus-2.5-install_id.patch %define srcname pegasus
BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++, libstdc++, make, pam-devel, krb5-devel, krb5-libs, openssl-devel >= 0.9.6, e2fsprogs %define pegasus_gid 65
Requires: bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam, krb5-libs, e2fsprogs, redhat-lsb, chkconfig, SysVinit, bind-utils, bind-libs, net-tools %define pegasus_uid 66
Requires(post): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam, krb5-libs, e2fsprogs, redhat-lsb, chkconfig, SysVinit, bind-utils, bind-libs, net-tools
Requires(pre): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam, krb5-libs, e2fsprogs, redhat-lsb, chkconfig, SysVinit, bind-utils, bind-libs, net-tools Version: 2.5.1
Requires(postun): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam, krb5-libs, e2fsprogs, redhat-lsb, chkconfig, SysVinit, bind-utils, bind-libs, net-tools Release: 1%{?LINUX_VERSION:.%{LINUX_VERSION}}
Epoch: 2
#
Summary: OpenPegasus WBEM Services for Linux
Name: tog-pegasus
Group: Systems Management/Base
URL: http://www.openpegasus.org
#
License: Open Group Pegasus Open Source
#
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#
Source: http://www.openpegasus.org/uploads/40/10123/%{srcname}-%{version}.tar.gz
Source1: pegasus_rpm_build_env.sh
Source2: README.RedHat.Security
#
Patch0: pegasus-2.5.1-initscript.patch
Patch1: pegasus-2.5.1-no-rpath.patch
Patch2: pegasus-2.5.1-linkflags.patch
Patch3: pegasus-2.5.1-PIE.patch
Patch4: pegasus-2.5.1-warnings.patch
Patch5: pegasus-2.5.1-redhat-config.patch
Patch6: pegasus-2.5.1-cmpi-provider-lib.patch
Patch7: pegasus-2.5.1-local-or-remote-auth.patch
Patch8: pegasus-2.5.1-pam-wbem.patch
#
Conflicts: openwbem
Provides: tog-pegasus-cimserver
#
BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++
BuildRequires: libstdc++, make, pam-devel
BuildRequires: openssl-devel >= 0.9.6, e2fsprogs
Requires: bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
Requires: redhat-lsb, chkconfig, SysVinit
Requires: e2fsprogs, bind-utils, net-tools
Requires(post): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
Requires(post): redhat-lsb, chkconfig, SysVinit
Requires(post): e2fsprogs, bind-utils, net-tools
Requires(pre): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
Requires(pre): redhat-lsb, chkconfig, SysVinit
Requires(pre): e2fsprogs, bind-utils, net-tools
Requires(postun): bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam
Requires(postun): redhat-lsb, chkconfig, SysVinit
Requires(postun): e2fsprogs, bind-utils, net-tools
%description %description
OpenPegasus WBEM Services for Linux enables management solutions that deliver OpenPegasus WBEM Services for Linux enables management solutions that deliver
@ -49,93 +85,89 @@ communication protocol for monitoring and controlling resources from diverse
sources. sources.
%package devel %package devel
Summary: The OpenPegasus Software Development Kit Summary: The OpenPegasus Software Development Kit
Group: Systems Management/Base Group: Systems Management/Base
Requires: tog-pegasus >= 2.5 Requires: tog-pegasus >= %{version}
Obsoletes: tog-pegasus-sdk
Requires: make, gcc, gcc-c++
Requires(preun): make
%description devel %description devel
The OpenPegasus WBEM Services for Linux SDK is the developer's kit for the OpenPegasus WBEM The OpenPegasus WBEM Services for Linux SDK is the developer's kit for the
Services for Linux release. It provides Linux C++ developers with the WBEM files required to OpenPegasus WBEM Services for Linux release. It provides Linux C++ developers
build WBEM Clients and Providers. It also supports C provider developers via the CMPI interface. with the WBEM files required to build WBEM Clients and Providers. It also
supports C provider developers via the CMPI interface.
%if %{PEGASUS_BUILD_TEST_RPM}
%if %{WITH_TEST}
%package test %package test
Summary: The OpenPegasus Tests Summary: The OpenPegasus Tests
Group: Systems Management/Base Group: Systems Management/Base
Autoreq: 0 Requires: tog-pegasus >= %{version}
Requires: tog-pegasus >= 2.5 Requires(post): make
Requires(postun): make
%description test %description test
The OpenPegasus WBEM tests for the OpenPegasus 2.5 Linux rpm. The OpenPegasus WBEM tests for the OpenPegasus %{version} Linux rpm.
********************************************************************************** **********************************************************************************
*** DO NOT INSTALL THIS RPM ON A PRODUCTION SYSTEM - THIS IS FOR TESTING ONLY. *** *** DO NOT INSTALL THIS RPM ON A PRODUCTION SYSTEM - THIS IS FOR TESTING ONLY. ***
********************************************************************************** **********************************************************************************
%endif %endif
%prep %prep
%setup -q -n %{srcname}-%{version} %setup -q -n %{srcname}
%patch0 -p1 -b .redhat %patch0 -p1 -b .initscript
%patch1 -p1 -b .local_or_remote_auth %patch1 -p1 -b .no-rpath
%patch2 -p1 -b .make_install %patch2 -p1 -b .linkflags
%patch3 -p1 -b .add_cmpi_provider_lib %patch3 -p1 -b .PIE
%patch4 -p1 -b .enable_cql %patch4 -p1 -b .warnings
# %patch5 -p1 -b .bz173401 %patch5 -p1 -b .redhat-config
# now fixed with openssl-0.9.8a-3+ %patch6 -p1 -b .cmpi-provider-lib
%patch6 -p1 -b .syslog_h %patch7 -p1 -b .local-or-remote-auth
%patch7 -p1 -b .install_id %patch8 -p1 -b .pam-wbem
%build %build
rm -rf $RPM_BUILD_ROOT rm -rf ${RPM_BUILD_ROOT} || :;
export RPM_ARCH_LIB=%{_lib} export RPM_ARCH_LIB=%{_lib}
. %SOURCE1 . %SOURCE1
make %if %{PEGASUS_BUILD_TEST_RPM}
export LD_LIBRARY_PATH=$PEGASUS_HOME/%{_lib} export PEGASUS_DISPLAYCONSUMER_DIR=/var/lib/Pegasus/log
export PATH=$PEGASUS_HOME/bin:$PATH
make repository
make --directory=mak -f SDKMakefile stageSDK
%if %{WITH_TEST}
export PEGASUS_ENVVAR_FILE=${PEGASUS_ROOT}/env_var_Linux.status
export PEGASUS_STAGING_DIR=$RPM_BUILD_ROOT
make --directory=$PEGASUS_ROOT -f Makefile.ReleaseTest stageTEST
unset PEGASUS_STAGING_DIR
%endif %endif
make -f $PEGASUS_ROOT/Makefile.Release create_ProductVersionFile
make -f $PEGASUS_ROOT/Makefile.Release create_CommonProductDirectoriesInclude
make -f $PEGASUS_ROOT/Makefile.Release create_ConfigProductDirectoriesInclude
make -f $PEGASUS_ROOT/Makefile.Release all
make -f $PEGASUS_ROOT/Makefile.Release repository
%install %install
export RPM_ARCH_LIB=%{_lib}
. %SOURCE1 . %SOURCE1
export PEGASUS_DESTDIR=$RPM_BUILD_ROOT export PEGASUS_STAGING_DIR=$RPM_BUILD_ROOT;
export PEGASUS_ENVVAR_FILE=${PEGASUS_ROOT}/env_var_Linux.status %if %{PEGASUS_BUILD_TEST_RPM}
export PATH=${PEGASUS_HOME}/bin:$PATH export PEGASUS_BUILD_TEST_RPM=%{PEGASUS_BUILD_TEST_RPM};
export LD_LIBRARY_PATH=${PEGASUS_HOME}/%{_lib}:/%{_lib}:/usr/%{_lib} %endif
unset PEGASUS_STAGING_DIR make -f $PEGASUS_ROOT/Makefile.Release stage;
export PEGASUS_SDK_STAGING_DIR=${PEGASUS_HOME}/stageSDK cp -fp %SOURCE2 doc
# why oh why did they make /usr/bin/install fail on the chown!!! : mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d;
export INSTALL_USER=`id -un` mkdir -p ${RPM_BUILD_ROOT}/var/run/tog-pegasus/socket;
export INSTALL_GROUP=`id -gn` mv ${RPM_BUILD_ROOT}/etc/init.d ${RPM_BUILD_ROOT}/etc/rc.d ||:;
# cp -fp rpm/tog-pegasus.rc ${RPM_BUILD_ROOT}/etc/rc.d/init.d/tog-pegasus;
make install touch ${RPM_BUILD_ROOT}{/etc/Pegasus/{cimserver_current.conf,cimserver_planned.conf,cimserver_trust,indication_trust,crl},/var/run/tog-pegasus/{socket/cimxml.socket,cimserver.pid,cimserver_start.lock}}
rm -rf $PEGASUS_HOME rm -rf ${RPM_BUILD_ROOT}/usr/share/doc/%{name}-2.5
mkdir -p $RPM_BUILD_ROOT{${PEGASUS_CONFIG_DIR},${PEGASUS_VARRUN_DIR},${PEGASUS_LOG_DIR},$PEGASUS_VARDATA_DIR} %if %{NODEBUGINFO}
touch $RPM_BUILD_ROOT{${PEGASUS_CONFIG_DIR}/{cimserver_{current,planned}.conf,ssl.cnf,client.pem,server.pem,file.pem,client_2048.pem,server_2048.pem,file_2048.pem},${PEGASUS_LOG_DIR}/install.log,${PEGASUS_VARRUN_DIR}/cimxml.socket} /usr/lib/rpm/brp-compress;
mkdir -p $RPM_BUILD_ROOT/var/lib/Pegasus/prev_repository exit 0;
cp -fp %SOURCE2 ${PEGASUS_ROOT}/doc %endif
cp -fp %SOURCE3 $RPM_BUILD_ROOT/${PEGASUS_CONFIG_DIR}/access.conf
chmod 640 $RPM_BUILD_ROOT/${PEGASUS_CONFIG_DIR}/access.conf
mkdir -p $RPM_BUILD_ROOT/${PEGASUS_PRODSHARE_DIR}/scripts
cp -fp %SOURCE4 $RPM_BUILD_ROOT/${PEGASUS_PRODSHARE_DIR}/scripts
chmod 750 $RPM_BUILD_ROOT/${PEGASUS_PRODSHARE_DIR}/scripts/genSSLcerts
mkdir -p $R$RPM_BUILD_ROOT/usr/%{_lib}/cmpi
#/usr/lib/rpm/brp-compress
#exit 0
:;
%files %files
%defattr(0640,root,pegasus,0750) %defattr(0750, root, pegasus, 0750)
%dir /etc/Pegasus /usr/%{_lib}/*
%dir /var/lib/Pegasus /usr/sbin/*
%attr(1750,root,pegasus) /var/run/tog-pegasus /usr/bin/*
%dir /var/log/Pegasus /usr/share/Pegasus/scripts
%config %attr(750,root,root) /etc/rc.d/init.d/tog-pegasus %config /etc/rc.d/init.d/tog-pegasus
%defattr(0640, root, pegasus, 0750)
%dir /etc/Pegasus
%ghost %config(noreplace) /etc/Pegasus/cimserver_current.conf %ghost %config(noreplace) /etc/Pegasus/cimserver_current.conf
%ghost %config(noreplace) /etc/Pegasus/cimserver_planned.conf %ghost %config(noreplace) /etc/Pegasus/cimserver_planned.conf
%config(noreplace) /etc/Pegasus/access.conf %config(noreplace) /etc/Pegasus/access.conf
@ -144,101 +176,116 @@ mkdir -p $R$RPM_BUILD_ROOT/usr/%{_lib}/cmpi
%ghost /etc/Pegasus/client.pem %ghost /etc/Pegasus/client.pem
%ghost /etc/Pegasus/server.pem %ghost /etc/Pegasus/server.pem
%ghost /etc/Pegasus/file.pem %ghost /etc/Pegasus/file.pem
%ghost /etc/Pegasus/client_2048.pem %ghost /etc/Pegasus/cimserver_trust
%ghost /etc/Pegasus/server_2048.pem %ghost /etc/Pegasus/indication_trust
%ghost /etc/Pegasus/file_2048.pem %ghost /etc/Pegasus/crl
%ghost /var/log/Pegasus/install.log %dir /var/lib/Pegasus
%ghost /var/lib/Pegasus/prev_repository
/var/lib/Pegasus/repository /var/lib/Pegasus/repository
/var/lib/Pegasus/cache /var/lib/Pegasus/cache
%attr(0750,root,pegasus) /usr/sbin/* %dir /var/lib/Pegasus/log
%attr(0755,root,pegasus) /usr/bin/* %ghost /var/lib/Pegasus/log/install.log
%attr(0755,root,pegasus) /usr/%{_lib}/*.so.* %dir %attr(1750,root,pegasus) /var/run/tog-pegasus
%dir /usr/%{_lib}/Pegasus/providers %ghost /var/run/tog-pegasus/cimserver.pid
%dir /usr/%{_lib}/cmpi %ghost /var/run/tog-pegasus/cimserver_start.lock
%attr(0755,root,pegasus) /usr/%{_lib}/Pegasus/providers/*.so.* %dir %attr(1750,root,pegasus) /var/run/tog-pegasus/socket
%ghost %attr(1640,root,pegasus) /var/run/tog-pegasus/socket/cimxml.socket
/usr/share/man/man8/*
%defattr(0644, root, pegasus, 0755)
%dir /usr/share/Pegasus
/usr/share/Pegasus/mof /usr/share/Pegasus/mof
%dir /usr/share/Pegasus/scripts /usr/share/man/man1/*
%attr(0755,root,pegasus) /usr/share/Pegasus/scripts/genSSLcerts %doc doc/license.txt doc/Admin_Guide_Release.pdf doc/PegasusSSLGuidelines.htm doc/SecurityGuidelinesForDevelopers.html doc/README.RedHat.Security src/Clients/repupgrade/doc/repupgrade.html
/usr/share/man/man*/*
%doc doc/license.txt doc/Admin_Guide_Release.pdf doc/README.RedHat.Security doc/SecurityGuidelinesForDevelopers.html doc/PegasusSSLGuidelines.htm doc/MessageQueueService.html doc/ProviderLoading.txt
%files devel %files devel
%defattr(0644,root,pegasus,0755) %defattr(0644,root,pegasus,0755)
/usr/include/Pegasus /usr/include/Pegasus
/usr/share/Pegasus/samples /usr/share/Pegasus/samples
/usr/share/Pegasus/html /usr/share/Pegasus/html
%attr(0755,root,pegasus) /usr/%{_lib}/*.so
%attr(0755,root,pegasus) /usr/%{_lib}/Pegasus/providers/*.so
%if %{WITH_TEST}
%post test
/etc/init.d/tog-pegasus stop
cd /var/lib/Pegasus
mv repository repository.bak
mv testrepository repository
/usr/share/Pegasus/scripts/genSSLcerts
cd /usr/share/Pegasus/test
make create_providerlinks
make tests
%if %{PEGASUS_BUILD_TEST_RPM}
%files test %files test
%defattr(-,root,root,-) %defattr(0640,root,pegasus,0750)
%dir /usr/share/Pegasus/test
/usr/share/Pegasus/test/Makefile
/var/lib/Pegasus/testrepository /var/lib/Pegasus/testrepository
/usr/share/Pegasus/test %defattr(0750,root,pegasus,0750)
/usr/share/Pegasus/test/bin
/usr/share/Pegasus/test/lib
%endif
%clean
%if !%{NOCLEAN}
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf $RPM_BUILD_ROOT;
[ "${RPM_BUILD_DIR}" != "/" ] && rm -rf ${RPM_BUILD_DIR}/%{name}-%{version};
%endif %endif
%pre %pre
if [ $1 -gt 1 ]; then if [ $1 -eq 1 ]; then
if [ -d /var/lib/Pegasus/repository/root\#PG_Internal ]; then
#
# Save the current repository to prev_repository.
#
if [ -d /var/lib/Pegasus/prev_repository ]; then
/bin/mv /var/lib/Pegasus/prev_repository /var/lib/Pegasus/prev_repository_`date '+%Y-%m-%d-%s.%N'`.rpmsave;
fi
/bin/mv /var/lib/Pegasus/repository /var/lib/Pegasus/prev_repository
fi;
elif [ $1 -eq 1 ]; then
# first install: create the 'pegasus' user and group: # first install: create the 'pegasus' user and group:
# By default, ONLY the "pegasus" user will be allowed to connect to cimserver over network /usr/sbin/groupadd -g %{pegasus_gid} -f -r pegasus >/dev/null 2>&1 || :;
/usr/sbin/groupadd -g 65 -f -r pegasus >/dev/null 2>&1 || :; /usr/sbin/useradd -u %{pegasus_uid} -r -n -M -g pegasus -s /sbin/nologin -d /var/lib/Pegasus \
/usr/sbin/useradd -u 66 -r -n -M -g pegasus -s /sbin/nologin -d /var/lib/Pegasus \
-c "tog-pegasus OpenPegasus WBEM/CIM services" pegasus >/dev/null 2>&1 || :; -c "tog-pegasus OpenPegasus WBEM/CIM services" pegasus >/dev/null 2>&1 || :;
elif [ $1 -gt 1 ]; then
if [ -d /var/lib/Pegasus/repository ]; then
if [ -d /var/lib/Pegasus/prev_repository ]; then
mv /var/lib/Pegasus/prev_repository /var/lib/Pegasus/prev_repository_`date '+%Y-%m-%d-%s.%N'`.rpmsave;
fi;
mv /var/lib/Pegasus/repository /var/lib/Pegasus/prev_repository;
fi
fi fi
:;
%post %post
ldconfig;
chkconfig --add tog-pegasus;
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
/sbin/ldconfig echo `date` > /var/lib/Pegasus/log/install.log 2>&1
%if %{AUTOSTART} elif [ $1 -gt 1 ]; then
/sbin/chkconfig --add tog-pegasus echo `date` >> /var/lib/Pegasus/log/install.log 2>&1 || :;
%endif if [ -d /var/lib/Pegasus/prev_repository ]; then
echo `date` >/var/log/Pegasus/install.log 2>&1 # The user's old repository was moved to /var/lib/Pegasus/prev_repository, which
elif [ $1 -gt 0 ]; then # now must be upgraded to the new repository in /var/lib/Pegasus/repository:
/sbin/service tog-pegasus condrestart /usr/sbin/repupgrade /var/lib/Pegasus/prev_repository /var/lib/Pegasus/repository \
:; 2>> /var/lib/Pegasus/log/install.log || :;
mv /var/lib/Pegasus/prev_repository /var/lib/Pegasus/prev_repository_`date '+%Y-%m-%d-%s.%N'`.rpmsave;
fi;
/sbin/service tog-pegasus condrestart >/dev/null 2>&1 || :;
fi fi
:;
%preun %preun
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
service tog-pegasus stop >/dev/null 2>&1 /sbin/service tog-pegasus stop >/dev/null 2>&1 || :;
/sbin/chkconfig --del tog-pegasus; /sbin/chkconfig --del tog-pegasus >/dev/null 2>&1 || :;
fi fi
:;
%postun %postun
if [ $1 -eq 0 ]; then ldconfig
# /usr/sbin/userdel pegasus >/dev/null 2>&1 || :;
# /usr/sbin/groudel pegasus >/dev/null 2>&1 || :;
:;
fi;
%clean %preun devel
rm -rf $RPM_BUILD_ROOT; if [ $1 -eq 0 ] ; then
#rm -rf ${RPM_BUILD_DIR}/%{srcname}-%{version}; make --directory /usr/share/Pegasus/samples -s clean >/dev/null 2>&1 || :;
fi
:;
%if %{PEGASUS_BUILD_TEST_RPM}
%preun test
if [ $1 -eq 0 ]; then
make --directory /usr/share/Pegasus/test -s unsetupTEST >/dev/null 2>&1 || :;
if [ -d /var/lib/Pegasus/testrepository ]; then
mv /var/lib/Pegasus/testrepository_`date '+%Y-%m-%d-%s.%N'`.rpmsave;
fi;
fi;
:;
%endif
%changelog %changelog
* Thu Apr 06 2006 Jason Vas Dias <jvdias@redhat.com> - 2:2.5.1-1
- Upgrade to version 2.5.1 (including new upstream .spec file).
* Tue Mar 7 2006 Bill Nottingham <notting@redhat.com> - 2:2.5-9 * Tue Mar 7 2006 Bill Nottingham <notting@redhat.com> - 2:2.5-9
- use an assigned uid/gid, do not loop over user ids looking for a free one - use an assigned uid/gid, do not loop over user ids looking for a free one