File pacemaker-mgmt.spec of Package pacemaker-mgmt

#
# spec file for package pacemaker-mgmt (Version 2.0)
#
# Copyright (c) 2009 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 with_extra_warnings   	0
%define with_debugging  	0
%define without_fatal_warnings 	1
%define with_ais_support        1
%define with_heartbeat_support  1
%define enable_snmp_subagent	1
%define gname haclient		
%define uname hacluster
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
%define pkg_group System Environment/Daemons
%else
%define pkg_group Productivity/Clustering/HA
%endif

Name:           pacemaker-mgmt
Summary:        Pacemaker Management Tools
Version:        1.99.2
Release:        4
License:        GPL v2 or later; LGPL v2.1 or later
Url:            http://hg.clusterlabs.org/pacemaker/pygui
Group:          %{pkg_group}
Source:         pacemaker-mgmt.tar.gz
Source1:        pacemaker_starter.py
Source2:        pacemaker-starter.glade
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
AutoReqProv:    on
Conflicts:      heartbeat < 2.99
Obsoletes:      pacemaker-pygui
Requires:       cluster-glue pacemaker findutils
%if 0%{?suse_version}
BuildRequires:  libglue-devel libpacemaker-devel
%else
BuildRequires:  cluster-glue-libs-devel pacemaker-libs-devel
%endif
#BuildRequires:  e2fsprogs-devel glib2-devel gnutls-devel libxml2-devel ncurses-devel pam-devel python-devel swig
BuildRequires:  glib2-devel gnutls-devel libxml2-devel ncurses-devel pam-devel python-devel swig intltool
%if %enable_snmp_subagent
BuildRequires:  net-snmp-devel
Requires:       net-snmp
%endif
%if %with_ais_support
BuildRequires:  libopenais-devel
Requires:       openais
%endif
%if %with_heartbeat_support
BuildRequires:  heartbeat-devel
Requires:       heartbeat
%endif
%if 0%{?suse_version}
BuildRequires: tcpd-devel
#%if 0%{?suse_version} == 930
#BuildRequires:  rpm-devel
#%endif
#%if 0%{?suse_version} == 1000
#BuildRequires:  lzo lzo-devel
#%endif

#%if 0%{?sles_version} == 9
#BuildRequires:  pkgconfig
#%endif
%endif

%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
BuildRequires:  which
#BuildRequires:  rpm-devel
#BuildRequires:  tcp_wrappers-devel
BuildRequires:  openssl-devel lm_sensors-devel
%endif

%if 0%{?fedora_version} >= 11
BuildRequires:  libtool-ltdl-devel
%endif

%if 0%{?rhel_version} == 406
BuildRequires:  gcc-c++ libselinux-devel
%endif

%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif

%description
A client/server GUI and a SNMP subagent for configuring, managing and monitoring
the Pacemaker High-Availability cluster resource manager



Authors:
--------
    Yan Gao <ygao@novell.com>

%package client
License:        GPL v2 or later; LGPL v2.1 or later
Summary:        Pacemaker Management Tools (frontend of GUI)
Group:          %{pkg_group}
Obsoletes:      pacemaker-pygui

%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
Requires:       PyXML
Requires:       pygtk2
%else
Requires:       pyxml
Requires:       python-gtk
%endif

%if 0%{?centos_version} == 0 && 0%{?rhel_version} == 0
Requires:	python-lxml
%endif

#%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?sles_version} > 10
%if 0%{?suse_version} || 0%{?fedora_version}
Requires :      graphviz-python
%endif

%if 0%{?mandriva_version}
Requires:       libgraphvizpython0
%endif

%description client
The frontend of GUI for configuring, managing and monitoring
the Pacemaker High-Availability cluster resource manager



Authors:
--------
    Yan Gao <ygao@novell.com>

%package devel 
License:        GPL v2 or later; LGPL v2.1 or later
Summary:        Pacemaker Management Tools (development package)
Group:          Development/Libraries/C and C++
Obsoletes:      pacemaker-pygui-devel
Requires:       %{name} = %{version}-%{release}

%description devel
Header files and shared libraries needed for developing programs based on
pacemaker-mgmt



Authors:
--------
    Yan Gao <ygao@novell.com>

%prep
###########################################################
%setup -n pacemaker-mgmt
###########################################################

%build
# TODO: revisit -all
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
# Feature-dependent CFLAGS:
%if %with_extra_warnings
# CFLAGS="${CFLAGS} -Wshadow -Wfloat-equal -Waggregate-return -Wnested-externs -Wunreachable-code -Wendif-labels -Winline"
CFLAGS="${CFLAGS} -Wfloat-equal -Wendif-labels -Winline"
%endif
%if %with_debugging
CFLAGS="${CFLAGS} -O0"
%endif
# Distribution specific settings:
%if 0%{?suse_version} > 1001
CFLAGS="${CFLAGS} -fstack-protector-all"
%endif
%if 0%{?suse_version} < 1001
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/gnome/%{_lib}/pkgconfig:/opt/gnome/share/pkgconfig"
%endif
%if 0%{?suse_version} > 1020
CFLAGS="$CFLAGS -fgnu89-inline"
%endif
%if 0%{?fedora_version} > 6
CFLAGS="$CFLAGS -fgnu89-inline"
%endif
export CFLAGS
./ConfigureMe configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} \
	--localstatedir=%{_var} --infodir=%{_infodir} 		\
	--mandir=%{_mandir} --libdir=%{_libdir} 		\
	--libexecdir=%{_libexecdir} 				\
	--with-ais-prefix=%{_prefix}				\
%if %without_fatal_warnings
	--enable-fatal-warnings=no 			        \
%endif
%if %enable_snmp_subagent
	--enable-snmp-subagent					\
	--with-mibsdir=%{_datadir}/snmp/mibs			\
%endif
	--with-hapkgversion=%{version}

%if %enable_snmp_subagent
%if %with_heartbeat_support
pushd snmp_subagent
ln -sf /usr/lib/libclm.so.1.0.0 libclm.so
ln -sf /usr/lib/libccmclient.so.1.0.0 libccmclient.so
ln -sf /usr/lib/libhbclient.so.1.0.0 libhbclient.so
popd
%endif
%endif

export MAKE="make %{?jobs:-j%jobs}"
make %{?jobs:-j%jobs}
###########################################################

%install
###########################################################
#make DESTDIR=$RPM_BUILD_ROOT install-strip
make DESTDIR=$RPM_BUILD_ROOT install
#install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/share/heartbeat-gui
#install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/heartbeat-gui
#pushd $RPM_BUILD_ROOT/usr/bin
#ln -sf ../share/heartbeat-gui/pacemaker_starter.py pacemaker_starter
#popd

%find_lang haclient

%if 0%{?suse_version}
%suse_update_desktop_file crm_gui
%endif

# Cleanup
[ -d $RPM_BUILD_ROOT/usr/man ] && rm -rf $RPM_BUILD_ROOT/usr/man
[ -d $RPM_BUILD_ROOT/usr/share/libtool ] && rm -rf $RPM_BUILD_ROOT/usr/share/libtool
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
find $RPM_BUILD_ROOT -name '*.pyc' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.pyo' -type f -print0 | xargs -0 rm -f
###########################################################

%clean
###########################################################
if
  [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]
then
  rm -rf $RPM_BUILD_ROOT
fi
rm -rf $RPM_BUILD_DIR/pacemaker-mgmt
###########################################################

#%pre

#%preun
# Use the following if more commands need to be executed
# %post
# /sbin/ldconfig
# [...]
# http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
###########################################################
%defattr(-,root,root)
%config %{_sysconfdir}/pam.d/hbmgmtd
#%{_bindir}/pacemaker_starter
%{_libdir}/heartbeat/mgmtd
%{_libdir}/heartbeat/mgmtdtest
%{_libdir}/libhbmgmt.so.*
%{_libdir}/libhbmgmtclient.so.*
%{_libdir}/libhbmgmtcommon.so.*
%{_libdir}/libhbmgmttls.so.*
#%{_datadir}/heartbeat-gui/*.glade
#%dir %{_docdir}/pacemaker-mgmt
#%doc %{_docdir}/pacemaker-mgmt/*
%dir %{_datadir}/doc/packages/pacemaker-mgmt
%doc %{_datadir}/doc/packages/pacemaker-mgmt/*
%if %enable_snmp_subagent
%{_libdir}/heartbeat/hbagent
%{_datadir}/snmp/mibs/LINUX-HA-MIB.txt
%{_datadir}/heartbeat/SNMPAgentSanityCheck
%endif

%files client -f haclient.lang
%defattr(-,root,root)
%{_bindir}/crm_gui
%{_bindir}/hb_gui
%dir %{_libdir}/heartbeat-gui
%{_libdir}/heartbeat-gui/haclient.py
%{_libdir}/heartbeat-gui/pymgmt.py
%{_libdir}/heartbeat-gui/_pymgmt.so*
%dir %{_datadir}/heartbeat-gui
%{_datadir}/heartbeat-gui/*.py
%{_datadir}/heartbeat-gui/*.png
%{_datadir}/applications/*.desktop
#%lang(zh_CN) %{_datadir}/locale/zh_CN/LC_MESSAGES/haclient.mo

%files devel
%defattr(-,root,root)
%dir %{_includedir}/heartbeat/mgmt	
%{_includedir}/heartbeat/mgmt/mgmt.h
%{_includedir}/heartbeat/mgmt/mgmt_client.h
%{_includedir}/heartbeat/mgmt/mgmt_common.h
%{_includedir}/heartbeat/mgmt/mgmt_tls.h
%{_includedir}/heartbeat/mgmt_config.h
%{_libdir}/*.so

%changelog
Thu Nov 05 2009 ygao@novell.com
- Update source tarball to revision: 1a20774cb1e6 tip
  + Low: mgmt: (LF#2202) Set node attributes via crm_attribute
* Wed Oct 21 2009 ygao@novell.com
- Update source tarball to revision: a4d84893fb6e tip
  + Low: Build: Compile against corosync
  + Medium: haclient: (bnc#540704) Allow to add a "date_expression" when an "expression" exists in a "rule"
  + Medium: mgmt: (bnc#541702) Cleaning up fail-count should be correctly done through attrd now
* Tue Aug 25 2009 ygao@novell.com
- Update source tarball to revision: 4fd4b0353d04+ tip
  + Dev: haclient: Automatically try to reconnect to cluster nodes if disconnected
  + Dev: haclient: Check whether the value of an "ID" or "IDREF" type of attribute is valid before doing validating
  + Dev: po: Update Japanese po
  + Low: Build: Avoid a macro redefinition
  + Low: Build: Compile against cluster-glue
  + Low: Build: Fix configure.in for compiling against cluster-glue
  + Low: haclient: Adopt extract_int() in TransitionInfoDlg()
  + Low: haclient: Avoid the error if "rsc_type" command returns "None"
  + Low: haclient: Determine if the current view exists before updating it
  + Low: snmp_subagent: (LF#2184) Add the description of LHAIFStatus
  + Low: snmp_subagent: Add the description about how to work with openAIS
  + Medium: haclient: Show the correct "[+|-]INFINITY" value of an integer cluster property
  + Medium: snmp_subagent: Improved for openais support
* Mon Jun 29 2009 ygao@novell.com
- Update source tarball to revision: pacemaker-mgmt-1.99.2 (1f7d1be39d34 tip)
  + Dev: haclient: Add "About"
  + Dev: haclient: Add accelerators
  + Dev: haclient: Add Japanese translation
  + Dev: haclient: Improve thread synchronization
  + Dev: haclient: Provide the progress pulse when generating the transition information
  + Dev: haclient: Set default response for dialogs
  + Dev: haclient: Show progress pulse when generating shadow diff
  + Dev: haclient: Support viewing/editing/importing/exporting the whole cib xml or the configuration section
  + Dev: mgmt: Improve the performance and the user interface of "Transition Information"
  + Dev: mgmt: Provide more details of nodes
  + Dev: po: Add the translation of the license
  + Dev: po: Update pot and po
  + High: lib: Fix huge memory leak due to the behavior of swig
  + Low: Build: Add libgv-python dependency for Debian
  + Low: Build: Update the release number and the changelog
  + Low: haclient: Avoid an error if there's no pengine input exists
  + Low: haclient: Avoid the possible key error of Manager.get_node_config()
  + Low: haclient: Concatenate error messages with the proper type
  + Low: haclient: Consider the possibility of IOError when creating temporary files
  + Low: haclient: Determine labels's width and align the following widgets properly
  + Low: haclient: Do not continue updating if the client is disconnected
  + Low: haclient: Fill the limited number of transitions into the drop-down list
  + Low: haclient: Make python-lxml optional
  + Low: haclient: Make sure the variable is assigned before referenced
  + Low: haclient: Make the marks of meta_attributes's default values consistent
  + Low: haclient: Set the default focus on "password" entry in the login dialog
  + Low: haclient: Set widgets's initial sizes to appropriate values for low resolutions
  + Low: mgmt: Log version details
  + Low: mgmt: Show its unclean resources if a node is uncleanly offline
  + Low: mgmtd: (LF#2142) Avoid redefinitions
  + Low: mgmtd: Add and adopt a new macro gen_msg_from_fstream()
  + Low: mgmtd: Adopt append_str() macro in on_get_pe_inputs()
  + Low: mgmtd: Can be compiled and work against pacemaker < 1.0.3
  + Low: mgmtd: Optimize for tranferring schemas
  + Low: mgmtd: Optimize message generating for transferring cluster reports
  + Low: mgmtd: Optimize message generating for transferring crm DTD
  + Low: mgmtd: Optimize message generating for transferring transition information
  + Low: mgmtd: Use the variable instead of the macro directly
  + Low: snmp_subagent: Allow specifying the cache timeout through the argument if not SUPPORT_HEARTBEAT
  + Medium: haclient: Avoid hanging when getting or parsing CIB/schemas fail
  + Medium: haclient: Do manager.update() via gobject timeout
  + Medium: haclient: Increase the interval of gobject timeout to avoid consuming excessive CPU when update fails
  + Medium: haclient: Remove the graph when it's no longer needed
  + Medium: haclient: Set gobject timeout for manager.update() in the consistent way
  + Medium: haclient: Update crm metadata via gobject timeout (Optimize connecting time)
  + Medium: mgmt: Display the proper status of resources on the node which is uncleanly offline
  + Medium: mgmtd: Destroy the crmd channel in the end of on_cleanup_rsc()
  + Medium: mgmtd: Fix memory leaks
* Mon Apr 27 2009 ygao@novell.com
- Update source tarball to revision: pacemaker-mgmt-1.99.1 (8b0a4cc4ac22 tip)
  + Dev: haclient: Automatically generate meaningful unique IDs instead of UUIDs
  + Dev: haclient: Automatically generate unique IDs for "op"s in "Simple Mode"
  + Dev: haclient: Improved for i18n
  + Dev: haclient: Make sure a generated ID is valid against schema
  + Dev: haclient: Propose ID for objects for which users may not want to set ID themselves
  + Dev: po: Maintain po in a separate directory.
  + Low: Build: Improve i18n support for compatibility
  + Low: haclient: Make sure a created intermediate object's ID is unique
  + Low: haclient: Rename some terms
  + Low: haclient: Support objects with unicode IDs
  + Low: mgmtd: Try to stat the cluster report file directly
  + Medium: haclient: Generate an UUID first (since there are objects for which we could not generate a meaningful ID)
  + Medium: haclient: Set the focus back after dynamically tuning the layout
  + Medium: mgmtd: Avoid segmentation faults caused by missing the required user or group
* Fri Mar 27 2009 ygao@novell.com
- Update source tarball to revision: 5ea4e654a8fa tip
  + Build: (bnc#487697) Add copies of licenses
  + High: mgmtd: Replace the adoptions of dirent->d_type which is not supported by some filesystems such as reiserfs
  + High: mgmt: The path that keeps PEngine outputs has been changed!
  + Low: haclient: (bnc#484169) Add desktop file
  + Medium: haclient: (bnc#486866) Check whether a specified time is valid
  + Medium: haclient: (bnc#488594) Additional prechecks for "primitive"
  + Medium: mgmt: Optimize viewing transition information
* Fri Mar 20 2009 ygao@novell.com
- Update source tarball to revision: 65fb5e7dca2b
  + Dev: mgmt: Implement shadow configuration support
  + Low: haclient: Change the layout of buttons for TransitionInfoDlg()
  + Low: haclient: Do not set "target-role" in add wizard if working on a shadow CIB
  + Low: haclient: Fix file filters for saving transition graph
  + Medium: haclient: Get and cache CRM metadata in advance
* Sat Mar 14 2009 ygao@novell.com
- Update source tarball to revision: 106c5122a39d
  + Dev: haclient: Hide less used attributes of "op" in simple mode
  + Low: Build: Improve debian/control file
  + Low: haclient: Add "interleave" setting in wizard
  + Low: haclient: Hide optional attributes for "rsc_order" in simple mode
  + Medium: Build: Fix compilation
* Mon Mar 02 2009 ygao@novell.com
- Update to pacemaker-mgmt-1.99.0
* Tue Feb 10 2009 xwhu@suse.de
- Fix configure problem with latest openais update
* Fri Feb 06 2009 xwhu@suse.de
- bnc#466787, do validation to the frontend
* Fri Jan 23 2009 xwhu@suse.de
- bnc#467964, instance attributes for stonith
- bnc#467967, long description makes window too long
- bnc#468418, hbagent crash on uninitialized fdset
- bnc#467977, document for SNMP agent
* Wed Jan 21 2009 xwhu@suse.de
- bnc#467809, pacemaker-pygui depends on python-gtk
* Thu Dec 11 2008 xwhu@suse.de
- bnc#456430, add a wizard for adding new resources
* Thu Dec 04 2008 xwhu@suse.de
- bnc#455988, GUI should only add provider for ocf resources
- bnc#456380, GUI segfault on wrong DISPLAY setting
- Add support for transition graph
- GUI for node local openais configuration
- Enable snmp agent for pacemaker on openais
* Fri Sep 12 2008 xwhu@suse.de
- First checking
openSUSE Build Service is sponsored by