File sblim-sfcb.spec of Package sblim-sfcb

#
# spec file for package sblim-sfcb (Version 1.3.2)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Small Footprint CIM Broker

Name:           sblim-sfcb
Version:        1.3.2
Release:        9
Group:          System/Management
License:        Other uncritical OpenSource License; CPL 1.0
Url:            http://sblim.sf.net/
Source0:        %{name}-%{version}.tar.bz2
Source1:        autoconfiscate.sh
%if 0%{?suse_version}
Source2:        sblim-sfcb.init
%endif
Source3:        autoconfiscate.sh-mofc
Patch1:         0001-uds_auth.patch
Patch2:         0002-root_only_auth.patch
Patch3:         0003-align.patch
Patch6:         0006-Werror.patch
Patch7:         0007-automake.patch
Patch8:         0008-enable-hex-trace-mask.patch
Patch9:         0009-clean-up-semaphore-array-index-calculation.patch
Patch11:        0011-check-prevent-various-buffer-overflows.patch
Patch15:        0015-fix-potential-memory-leak.patch
Patch16:        0016-check-result-from-_methProvider.patch
Patch17:        0017-abort-on-socket-error-with-better-error-msg.patch
Patch18:        0018-buffer-size-check-in-localConnectServer.patch
Patch19:        0019-internal_provider.patch
Patch100:       0100-check_length_sanity.patch
Patch110:       0110-2164750-sfcb_handle_malformed_requests.patch
Patch120:       0120-max_content_length.patch
Patch130:       0130-2169514-check_malloc.patch
Patch140:       0140-2169527-attrsOk_alloca_fix.patch
Patch150:       0150-2169607-strcpy.patch
Patch160:       0160-2158198-syslog.patch
Patch170:       0170-2172023-mlogf.patch
Patch180:       0180-2175507-alloca_sockaddr.patch
Patch190:       0190-2189391-fix-fork-race-in-getProcess.patch
Patch200:       0200-2192023-Fix-nsHt-deadlock.patch
Patch210:       0210-2185304-shutdown_deadlock_remove_mlogf.patch
Patch220:       0220-2189234-minimal-provider-count-is-3-4-with-interOpProvider.patch
Patch230:       0230-2169807-435882-xml-char-ref.patch
Provides:       cimserver
Provides:       cim-server
%if 0%{?suse_version} >= 1030
BuildRequires:  libcurl-devel
%else
BuildRequires:  curl-devel
%endif
BuildRequires:  zlib-devel
BuildRequires:  openssl-devel
BuildRequires:  pam-devel
BuildRequires:  cim-schema
BuildRequires:  bison flex
Requires:       curl
Requires:       zlib
Requires:       openssl
Requires:       pam
# Added NWP - dependency on cim-schema instead of inbuilt schema
Requires:       cim-schema

%description
Small Footprint CIM Broker (sfcb) is a CIM server conforming to the CIM
Operations over HTTP protocol. It is robust, with low resource
consumption and therefore specifically suited for embedded and resource
constrained environments. sfcb supports providers written against the
Common Manageability Programming Interface (CMPI).



%prep
%setup -q
%patch1 -p1 -b .0001-uds_auth.patch
%patch2 -p1 -b .0002-root_only_auth.patch
%patch3 -p1 -b .0003-align.patch
%patch6 -p1 -b .0006-Werror.patch
%patch7 -p1 -b .0007-automake.patch
%patch8 -p1 -b .0008-enable-hex-trace-mask.patch
%patch9 -p1 -b .0009-clean-up-semaphore-array-index-calculation.patch
%patch11 -p1 -b .0011-check-prevent-various-buffer-overflows.patch
%patch15 -p1 -b .0015-fix-potential-memory-leak.patch
%patch16 -p1 -b .0016-check-result-from-_methProvider.patch
%patch17 -p1 -b .0017-abort-on-socket-error-with-better-error-msg.patch
%patch18 -p1 -b .0018-buffer-size-check-in-localConnectServer.patch
%patch19 -p0 -b .0019-internal_provider.patch
%patch100 -p0 -b .0100-check_length_sanity.patch
%patch110 -p0 -b .0110-2164750-sfcb_handle_malformed_requests.patch
%patch120 -p0 -b .0120-max_content_length.patch
%patch130 -p0 -b .0130-2169514-check_malloc.patch
%patch140 -p0 -b .0140-2169527-attrsOk_alloca_fix.patch
%patch150 -p0 -b .0150-2169607-strcpy.patch
%patch160 -p0 -b .0160-2158198-syslog.patch
%patch170 -p0 -b .0170-2172023-mlogf.patch
%patch180 -p0 -b .0180-2175507-alloca_sockaddr.patch
%patch190 -p1 -b .0190-2189391-fix-fork-race-in-getProcess.patch
%patch200 -p1 -b .0200-2192023-Fix-nsHt-deadlock.patch
%patch210 -p0 -b .0210-2185304
%patch220 -p1 -b .0220-2189234-minimal-provider-count-is-3-4-with-interOpProvider.patch
%patch230 -p0 -b .0230-2169807-435882-xml-char-ref.patch
export PATCH_GET=0

%build
#autoreconf -f -i
cp %SOURCE1 .
cp %SOURCE3 mofc/autoconfiscate.sh
chmod +x mofc/autoconfiscate.sh
sh ./autoconfiscate.sh
#if test -d mofc; then cd mofc && autoreconf -f -i; fi
#%%configure --enable-debug --enable-ssl --enable-pam --enable-ipv6 CIMSCHEMA_SOURCE=%{SOURCE1} CIMSCHEMA_MOF=cimv216.mof CIMSCHEMA_SUBDIRS=y
mkdir -p m4
%configure --enable-debug --enable-ssl --enable-pam --enable-ipv6
make

%install
%makeinstall
# comment out - NWP - removing schema pkg
#make DESTDIR=$RPM_BUILD_ROOT install-cimschema
# remove unused libtool files
rm -f $RPM_BUILD_ROOT/%{_libdir}/*a
# make the cmpi directory that sfcb will own - for SuSE Autobuild checks of rpm directory ownership
mkdir $RPM_BUILD_ROOT/%{_libdir}/cmpi
%if 0%{?suse_version}
# override the default-installed sfcb init script - use the one from Source2
# due to /etc/SuSE-release not available in autobuild, so won't install
# correct init script
install %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/sfcb
ln -s /etc/init.d/sfcb $RPM_BUILD_ROOT/usr/sbin/rcsfcb
%endif
# Added NWP 5/14/08 - transition to using cim-schema rpm instead of internal-built schema
ln -sf /usr/share/mof/cim-current $RPM_BUILD_ROOT/%{_datadir}/sfcb/CIM
echo "%defattr(-,root,root)" > _pkg_list
# Added NWP 5/14/08 - moved from 'files schema'
echo "%dir %{_datadir}/sfcb/" >> _pkg_list
find $RPM_BUILD_ROOT/%{_datadir}/sfcb -type f | grep -v $RPM_BUILD_ROOT/%{_datadir}/sfcb/CIM >> _pkg_list
# Added next line - NWP - declaring link to CIM as part of pkg
echo "%{_datadir}/sfcb/CIM" >> _pkg_list
# end add NWP
sed s?$RPM_BUILD_ROOT??g _pkg_list > _pkg_list_2
mv -f _pkg_list_2 _pkg_list
echo "%dir %{_libdir}/cmpi/" >> _pkg_list
echo "%dir %{_sysconfdir}/sfcb/" >> _pkg_list
echo "%config %{_sysconfdir}/sfcb/*" >> _pkg_list
echo "%config %{_sysconfdir}/pam.d/*" >> _pkg_list
echo "%doc %{_datadir}/doc/*" >> _pkg_list
echo "%doc %{_datadir}/man/man1/*" >> _pkg_list
echo "%{_sysconfdir}/init.d/sfcb" >> _pkg_list
echo "%{_localstatedir}/lib/sfcb" >> _pkg_list
echo "%{_bindir}/*" >> _pkg_list
echo "%{_sbindir}/*" >> _pkg_list
echo "%{_libdir}/*.so*" >> _pkg_list
echo =======================================
cat _pkg_list

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%post 
#removed NWP, placed into init script for first service startup
#%{_datadir}/sfcb/genSslCert.sh %{_sysconfdir}/sfcb
%if 0%{?suse_version}
%{fillup_and_insserv -f -y sfcb}
%endif
# Added NWP 5/14/08 - moved from 'post schema'
sfcbrepos -f 2> /dev/null
/sbin/ldconfig
exit 0

%preun
%stop_on_removal

%postun
/sbin/ldconfig
%insserv_cleanup
# comment out - NWP - removing schema pkg
#%post schema
#sfcbrepos -f 2> /dev/null
#exit 0
#%files schema
#%defattr(-,root,root)
#%dir %{_datadir}/sfcb/
#%{_datadir}/sfcb/CIM

%files -f _pkg_list

%changelog
* Fri Nov 07 2008 bwhiteley@suse.de
- Better patch for HTTP connection close -- sblim tracker #2193250
- Handle more escaped chars in XML (bnc#435882, sblim#2169807)
* Wed Oct 29 2008 bwhiteley@suse.de
- Better patch for shutdown deadlock -- sblim tracker #2185304
* Wed Oct 22 2008 bwhiteley@suse.de
- The following bugs from the sblim tracker address bnc#425457
 - [ 2164750 ] sfcb does not handle some malformed HTTP requests correctly
 - [ 2172888 ] http content-length is not constrained
 - [ 2169514 ] spRcvMsg doesn't check malloc return
 - [ 2169527 ] Some XML parsing error strings do not have sufficient space
 - [ 2169607 ] sqlLexer assumes line lengths under MAXBUF
 - [ 2175426 ] possible int overflow
 - [ 2158198 ] syslog call incorrect
 - [ 2172023 ] mlogf call cleanups
 - [ 2175507 ] sockaddr_un not allocated for localconnect server
- Some code cleanup.
- SBLIM tracker #2189391 fork() race condition in providerDrv.c:getProcess()
- SBLIM tracker #2192023 sfcb deadlocks on nsHt initialization
- SBLIM tracker #2185304 SFCB doesn't shut down properly a good portion
  of the time.
- bnc:438758, SBLIM tracker #2189234 wrong minimal provider check
* Wed Oct 15 2008 kkaempf@suse.de
- help Buildservice executing shell scripts.
* Tue Oct 14 2008 kkaempf@suse.de
- Fix compiler warnings (on 64bit systems) (bnc#435043)
- Adapt for latest autotools
- Fix rpmlint warnings in .spec (%%preun/%%postun)
* Tue Oct 07 2008 schwab@suse.de
- Fix alignment.
- Rebuild configure to get fixed AC_FUNC_MKTIME.
- Don't run configure twice.
* Mon Oct 06 2008 bwhiteley@suse.de
- Update to official 1.3.2 release.
* Wed Aug 27 2008 bwhiteley@suse.de
- update to 1.3.2preview
- Added RTLD_GLOBAL to ldflags when loading providers.
* Mon Aug 18 2008 bwhiteley@suse.de
- don't remove buildroot in %%install
* Mon Aug 11 2008 bwhiteley@suse.de
- Added RequiredStart and RequiredStop to init script.
* Tue Jul 22 2008 bwhiteley@suse.de
- Fix SSL options to disable SSLv2 and weak ciphers.
- Fix XML parser to unescape newlines.
* Mon Jul 21 2008 bwhiteley@suse.de
- Fixed limited length error strings in XML.
* Thu May 29 2008 bwhiteley@suse.de
- Enhanced to support HTTP connections over unix domain sockets,
  including unix socket peer credential authentication without
  passwords.
- Changed authentication module to only allow users with uid 0
  to log in.
* Fri May 16 2008 bwhiteley@suse.de
- Moved back to 1.3.0.  1.3.1 has problems.  Removed schema
  package, and placed a dependency on cim-schema package
  instead.
* Tue May 13 2008 bwhiteley@suse.de
- Updated to 1.3.1.  Other packaging changes.
* Fri May 02 2008 bwhiteley@suse.de
- Initial checkin
openSUSE Build Service is sponsored by