File openais.spec of Package openais

#
# spec file for package openais (Version 0.80.3)
#
# 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/
#

# norootforbuild

%if 0%{?suse_version}
%define _libexecdir %{_libdir}
%endif
%define ais_uid         39
%define ais_user	ais
%if 0%{?fedora_version}
%define pkg_group System Environment/Base
%else
%define pkg_group Productivity/Clustering/HA
%endif

Name:           openais
Summary:        The OpenAIS Standards-Based Cluster Framework executive and APIs
Version:        0.80.3
Release:        14
License:        BSD 3-Clause
Group:          Productivity/Clustering/HA
Url:            http://www.openais.org/
Source:         openais.tar.gz
Patch1:         pacemaker.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(pre):   /usr/sbin/useradd
Requires(post):  /sbin/chkconfig
Requires(preun): /sbin/chkconfig

%description 
This package contains the openais executive, openais service handlers,
default configuration files and init script.



Authors:
--------
    Steven Dake
    Mark Haverkamp
    Muni Bajpai
    Daniel McNiel
    Miyotaka Sakai
    Daniel Stodden
    Kristen Smith
    Patrick Caulfield
    Fabien Thomas
    Hans Feldt
    Lars Holm
    Anders Eriksson
    Renaud Metrich
    Frederic Hermann
    Alejandro Lopez
    David Teigland
    Robert Peterson
    Abhijith Das

%package -n libopenais2
License:        BSD 3-Clause
Summary:        The OpenAIS Standards-Based Cluster Framework executive and APIs
Group:          Productivity/Clustering/HA

%description -n libopenais2
This package contains the openais executive, openais service handlers,
default configuration files and init script.



Authors:
--------
    Steven Dake
    Mark Haverkamp
    Muni Bajpai
    Daniel McNiel
    Miyotaka Sakai
    Daniel Stodden
    Kristen Smith
    Patrick Caulfield
    Fabien Thomas
    Hans Feldt
    Lars Holm
    Anders Eriksson
    Renaud Metrich
    Frederic Hermann
    Alejandro Lopez
    David Teigland
    Robert Peterson
    Abhijith Das

%package -n libopenais-devel
License:        BSD 3-Clause
Summary:        The openais Standards-Based Cluster Framework libraries
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}
Requires:       libopenais2 = %{version}-%{release}

%description -n libopenais-devel
This package contains the libraries and include files used to develop
using openais APIs.



Authors:
--------
    Steven Dake
    Mark Haverkamp
    Muni Bajpai
    Daniel McNiel
    Miyotaka Sakai
    Daniel Stodden
    Kristen Smith
    Patrick Caulfield
    Fabien Thomas
    Hans Feldt
    Lars Holm
    Anders Eriksson
    Renaud Metrich
    Frederic Hermann
    Alejandro Lopez
    David Teigland
    Robert Peterson
    Abhijith Das

%prep
%setup -n openais
%patch1 -p1

%build
# -O3 required for performance reasons
# So we get proper debug output, for now we don't compile with O3
#CFLAGS="$(echo '%{optflags}' | sed -e 's/-O[0-9]*//') -O3"
#CFLAGS="$(echo '%{optflags}')"
make CFLAGS="$RPM_OPT_FLAGS" LCRSODIR=%{_libexecdir}/lcrso PREFIX=%{_prefix} OPENAIS_BUILD=DEBUG

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} LCRSODIR=%{_libexecdir}/lcrso STATICLIBS=NO OPENAIS_BUILD=DEBUG install
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -m 644 CHANGELOG LICENSE SECURITY README.devmap README.amf \
	$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/
install -m 755 init/generic $RPM_BUILD_ROOT%{_initrddir}/openais
install -m 755 test/openais-cfgtool $RPM_BUILD_ROOT%{_sbindir}
find $RPM_BUILD_ROOT -name '*.a' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
%if 0%{?suse_version}
ln -sf ../../etc/init.d/openais $RPM_BUILD_ROOT/%{_sbindir}/rcopenais
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%if 0%{?fedora_version}
/usr/sbin/fedora-useradd %{ais_uid} -r -s /sbin/nologin -d '/' -M \
        -c 'openais Standards Based Cluster Framework' %{ais_user} &>/dev/null || :
%else
if
  getent passwd %{ais_user} >/dev/null
then
  : OK hacluster user already present
else
  /usr/sbin/useradd -c "openais Standards Based Cluster Framework" \
      -r -d '/' -u %{ais_uid} %{ais_user} 2>/dev/null || :
fi
%endif

%post
%if 0%{?suse_version}
  %{fillup_and_insserv -n heartbeat}
%else
  /sbin/chkconfig --add openais || :
%endif

%preun
%if 0%{?suse_version}
  %stop_on_removal openais
%else
if [ $1 -eq 0 ]; then
  %{_initrddir}/openais stop &>/dev/null || :
fi
%endif
/sbin/chkconfig --del openais || :

%postun
%if 0%{?suse_version}
  %restart_on_update openais
  %{insserv_cleanup}
%else
[ "$1" -ge "1" ] && %{_initrddir}/openais condrestart &>/dev/null || :
%endif

%post -n libopenais2 -p /sbin/ldconfig

%postun -n libopenais2 -p /sbin/ldconfig

%files 
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/LICENSE
%doc %{_docdir}/%{name}-%{version}/SECURITY
%doc %{_docdir}/%{name}-%{version}/README.amf
%{_sbindir}/aisexec
%{_sbindir}/ais-keygen
%{_sbindir}/openais-cfgtool
%dir /etc/ais
%config(noreplace) /etc/ais/openais.conf
%config(noreplace) /etc/ais/amf.conf
%config /etc/ld.so.conf.d/openais-*.conf
%{_initrddir}/openais
%if 0%{?suse_version}
%{_sbindir}/rcopenais
%endif
%dir %{_libexecdir}/lcrso
%{_libexecdir}/lcrso/*.lcrso
%{_mandir}/man8/*.8*
%{_mandir}/man5/openais.conf.5*

%files -n libopenais2
%defattr(-,root,root,-)
%dir %{_libdir}/openais
%{_libdir}/openais/lib*.so.*

%files -n libopenais-devel
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/CHANGELOG
%doc %{_docdir}/%{name}-%{version}/README.devmap
%dir %{_includedir}/openais/
%dir %{_includedir}/openais/lcr/
%dir %{_includedir}/openais/totem/
%dir %{_includedir}/openais/service
%{_libdir}/openais/lib*.so
%{_includedir}/openais/*.h
%{_includedir}/openais/lcr/*.h
%{_includedir}/openais/totem/*.h
%{_includedir}/openais/service/*.h
%{_mandir}/man3/cpg_*.3*
%{_mandir}/man3/evs_*.3*

%changelog
* Fri Nov 21 2008 abeekhof@suse.de
- Update patch level to aae387a6e5fd
- Fix Bug bnc#444376 - openais segafults in lcr_ifact_release during shutdown
  + Prevent corruption at shutdown by fixing plugin loading at startup
  + Extend the objdb API to allow search cursors to be saved and restored
  + Simplify startup since load order doesn't affect shutdown order
  + Don't create (duplicate) objdb entries for additional services
  + Wrap the openais_service_link_and_init() call with the new objdb
  api calls for saving and restoring search cursors
  Allows services to make use of the objdb passed to them
* Wed Nov 19 2008 abeekhof@suse.de
- Update patch level to 26c4af74cac1
  + Fix nodeid generation to use the node's full ip address (not network address) to ensure uniqueness
  + Start additional services after the default ones
  + Correctly compare addresses with bindnetaddr
* Tue Nov 11 2008 abeekhof@suse.de
- Update source tarball to r1661
  - Fix rare problem where checkpoint synchronization database could be thrown away.
  - Fix commit token recieved_flg being incorrect in some rare circumstances
  which caused message corruption.
  - Fix a message lost during delivery which resulted in checkpoint segfault
* Thu Oct 09 2008 abeekhof@suse.de
- Update source tarball to r1655
  - Remove IPC scheduling starvation
  - Fix Library queue full messages in some conditions
  - Make sanitizing generated nodeid's optional
* Mon Sep 15 2008 abeekhof@suse.de
- Create a libopenais2 subpackage as per policy
* Thu Sep 11 2008 abeekhof@suse.de
- Update source tarball to r1649
  - Add backports of objdb and service shutdown patches
  - Modify the nodeid generation function to never return a negative value
  - Include changes as a diff against upstream tarball
* Wed Aug 20 2008 abeekhof@suse.de
- Ensure generated nodeid's are always positive integers
* Mon Jul 21 2008 abeekhof@suse.de
- Switch to the stable series of OpenAIS (Whitetank 0.80) which
  behaves significantly better for clusters larger than 4 nodes
- Upstream version is 0.80.3 (SVN 1551)
- Tarball includes 8 patches backported from the development series
  that are required to support Pacemaker.  Patch summary:
  - a generic init-script
  - Fix DESTDIR, PREFIX and LCRSODIR
  - Repair loading of external services
  - Add some new calls into objdb
  - Patch to remove segfault on the exiting of a service.
  - Patch to allow controlled exit of a service.
  - load and unload service engines at runtime
* Sun Jun 29 2008 abeekhof@suse.de
- Enable encryption
* Sat May 03 2008 abeekhof@suse.de
- Set a libexedir that makes sense on 64-bit archs
* Tue Apr 22 2008 abeekhof@suse.de
- Fix build for new glibc
* Wed Apr 16 2008 abeekhof@suse.de
- Disable crypto-related code to prevent issues with US export restrictions
  Will be re-enabled for 11.1 once proper permits have been requested/granted
* Sat Apr 12 2008 abeekhof@suse.de
- Initial package check-in
- Upstream version: 0.82+ (SVN version: 1495)
- Two addtional patches for co-ordinated shutdown and loading of the pacemaker plugin
openSUSE Build Service is sponsored by