tog-pegasus/tog-pegasus.spec
2005-10-14 10:36:16 +00:00

231 lines
8.5 KiB
RPMSpec

################################################################################
#
# OpenPegasus (Red Hat release) RPM .spec file
#
%{?!WITH_TEST: %define WITH_TEST 0}
# 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.
#
Summary: OpenPegasus WBEM Services for Linux
Name: tog-pegasus
Version: 2.5
Release: 1
Epoch: 2
Group: Systems Management/Base
License: Open Group Pegasus Open Source
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://www.openpegasus.org/
%define srcname pegasus
Source0: %{srcname}-%{version}.tar.gz
Source1: rpm_build_env
Source2: README.RedHat.Security
Source3: access.conf
Source4: genSSLcerts
Patch0: pegasus-2.5-redhat.patch
Patch1: pegasus-2.5-local-or-remote-auth.patch
Patch2: pegasus-2.5-make_install.patch
BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++, libstdc++, make, pam-devel, krb5-devel, krb5-libs, openssl-devel >= 0.9.6, e2fsprogs
Requires: bash, sed, grep, coreutils, procps, openssl >= 0.9.6, pam, krb5-libs, e2fsprogs, redhat-lsb, chkconfig, SysVinit, bind-utils, bind-libs, net-tools
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
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
%description
OpenPegasus WBEM Services for Linux enables management solutions that deliver
increased control of enterprise resources. WBEM is a platform and resource
independent DMTF standard that defines a common information model and
communication protocol for monitoring and controlling resources from diverse
sources.
%package devel
Summary: The OpenPegasus Software Development Kit
Group: Systems Management/Base
Requires: tog-pegasus >= 2.5
%description devel
The OpenPegasus WBEM Services for Linux SDK is the developer's kit for the OpenPegasus WBEM
Services for Linux release. It provides Linux C++ developers with the WBEM files required to
build WBEM Clients and Providers. It also supports C provider developers via the CMPI interface.
%if %{WITH_TEST}
%package test
Summary: The OpenPegasus Tests
Group: Systems Management/Base
Autoreq: 0
Requires: tog-pegasus >= 2.5
%description test
The OpenPegasus WBEM tests for the OpenPegasus 2.5 Linux rpm.
**********************************************************************************
*** DO NOT INSTALL THIS RPM ON A PRODUCTION SYSTEM - THIS IS FOR TESTING ONLY. ***
**********************************************************************************
%endif
%prep
%setup -q -n %{srcname}-%{version}
%patch0 -p1 -b .redhat
%patch1 -p1 -b .local_or_remote_auth
%patch2 -p1 -b .make_install
%build
rm -rf $RPM_BUILD_ROOT
export RPM_ARCH_LIB=%{_lib}
. %SOURCE1
make
export LD_LIBRARY_PATH=$PEGASUS_HOME/%{_lib}
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
%install
export RPM_ARCH_LIB=%{_lib}
. %SOURCE1
export PEGASUS_DESTDIR=$RPM_BUILD_ROOT
export PEGASUS_ENVVAR_FILE=${PEGASUS_ROOT}/env_var_Linux.status
export PATH=${PEGASUS_HOME}/bin:$PATH
export LD_LIBRARY_PATH=${PEGASUS_HOME}/%{_lib}:/%{_lib}:/usr/%{_lib}
unset PEGASUS_STAGING_DIR
export PEGASUS_SDK_STAGING_DIR=${PEGASUS_HOME}/stageSDK
make install
rm -rf $PEGASUS_HOME
mkdir -p $RPM_BUILD_ROOT{${PEGASUS_CONFIG_DIR},${PEGASUS_VARRUN_DIR},${PEGASUS_LOG_DIR},$PEGASUS_VARDATA_DIR}
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}
mkdir -p $RPM_BUILD_ROOT/var/lib/Pegasus/prev_repository
cp -fp %SOURCE2 ${PEGASUS_ROOT}/doc
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
:;
%files
%defattr(0640,root,pegasus,0750)
%dir /etc/Pegasus
%dir /var/lib/Pegasus
%attr(1750,root,pegasus) /var/run/tog-pegasus
%dir /var/log/Pegasus
%config %attr(750,root,root) /etc/rc.d/init.d/tog-pegasus
%ghost %config(noreplace) /etc/Pegasus/cimserver_current.conf
%ghost %config(noreplace) /etc/Pegasus/cimserver_planned.conf
%config(noreplace) /etc/Pegasus/access.conf
%config(noreplace) /etc/pam.d/wbem
%ghost /etc/Pegasus/ssl.cnf
%ghost /etc/Pegasus/client.pem
%ghost /etc/Pegasus/server.pem
%ghost /etc/Pegasus/file.pem
%ghost /etc/Pegasus/client_2048.pem
%ghost /etc/Pegasus/server_2048.pem
%ghost /etc/Pegasus/file_2048.pem
%ghost /var/log/Pegasus/install.log
%ghost /var/lib/Pegasus/prev_repository
/var/lib/Pegasus/repository
/var/lib/Pegasus/cache
%attr(0750,root,pegasus) /usr/sbin/*
%attr(0755,root,pegasus) /usr/bin/*
%attr(0755,root,pegasus) /usr/%{_lib}/*.so.*
%dir /usr/%{_lib}/Pegasus/providers
%attr(0755,root,pegasus) /usr/%{_lib}/Pegasus/providers/*.so.*
/usr/share/Pegasus/mof
%dir /usr/share/Pegasus/scripts
%attr(0755,root,pegasus) /usr/share/Pegasus/scripts/genSSLcerts
/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
%defattr(0644,root,pegasus,0755)
/usr/include/Pegasus
/usr/share/Pegasus/samples
/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
%files test
%defattr(-,root,root,-)
/var/lib/Pegasus/testrepository
/usr/share/Pegasus/test
%endif
%pre
if [ $1 -gt 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:
# By default, ONLY the "pegasus" user will be allowed to connect to cimserver over network
/usr/sbin/groupadd pegasus >/dev/null 2>&1 || :;
/usr/sbin/useradd -c "tog-pegasus OpenPegasus WBEM/CIM services" -g pegasus \
-s /sbin/nologin -r -d /var/lib/Pegasus pegasus >/dev/null 2>&1 || :;
fi
%post
if [ $1 -eq 1 ]; then
/sbin/ldconfig
%if %{AUTOSTART}
/sbin/chkconfig --add tog-pegasus
%endif
echo `date` >/var/log/Pegasus/install.log 2>&1
elif [ $1 -gt 0 ]; then
/sbin/service tog-pegasus condrestart
:;
fi
%preun
if [ $1 -eq 0 ]; then
service tog-pegasus stop >/dev/null 2>&1
/sbin/chkconfig --del tog-pegasus;
fi
%postun
if [ $1 -eq 0 ]; then
/usr/sbin/userdel pegasus >/dev/null 2>&1 || :;
/usr/sbin/groudel pegasus >/dev/null 2>&1 || :;
fi;
%clean
#rm -rf $RPM_BUILD_ROOT;
#rm -rf ${RPM_BUILD_DIR}/%{srcname}-%{version};
%changelog
* Fri Oct 14 2005 Tomas Mraz <tmraz@redhat.com>
- use include instead of pam_stack in pam config
* Fri Sep 30 2005 Jason Vas Dias <jvdias@redhat.com> - 2:tog-pegasus-2.5-1
- Implemented new 'make install' target.
- Re-wrote tog-pegasus.spec file from scratch.
- Ported BZ 167986 authentication code and BZ 167164 + BZ 167165 fixes from RHEL-4
* Wed Sep 28 2005 Jason Vas Dias <jvdias@redhat.com> - 2:tog-pegasus-2.5-0
- Initial build.