corosync/corosync.spec

326 lines
8.9 KiB
RPMSpec

#
# spec file for package corosync
#
# Copyright (c) 2013 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/
#
# Conditionals
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
# to disable or enable specific features
%bcond_with testagents
%bcond_with watchdog
%bcond_with monitoring
%bcond_with snmp
%bcond_with rdma
%bcond_with systemd
%bcond_with upstart
%bcond_with xmlconf
%bcond_with runautogen
%if 0%{?sles_version} == 11
%ifnarch s390 s390x
%define buildib 1
%endif
%endif
%if 0%{?suse_version}
%define _libexecdir %{_libdir}
%endif
Name: corosync
Summary: The Corosync Cluster Engine and Application Programming Interfaces
License: BSD-3-Clause
Group: Productivity/Clustering/HA
Version: 2.3.1
Release: 0
Url: http://www.corosync.org
Source0: http://build.clusterlabs.org/%{name}/releases/%{name}-%{version}.tar.gz
Source2: baselibs.conf
#Patch1: corosync-confexample-timestamp.patch
#Patch2: corosync-revert-cs2429.patch
#Patch4: corosync.conf.example.patch
#Patch5: corosync-cpg-procdown.patch
#Patch6: corosync_reduce_RR_priority.patch
#Patch7: fix-nodeid-conflicting.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Runtime bits
Requires: libcorosync4 = %{version}-%{release}
#Requires(pre): /usr/sbin/useradd
#Requires(post): /sbin/chkconfig
#Requires(preun): /sbin/chkconfig
#Conflicts: openais <= 0.89, openais-devel <= 0.89
BuildRequires: libqb-devel
BuildRequires: mozilla-nss
BuildRequires: mozilla-nss-devel
%if %{with runautogen}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%endif
%if %{with monitoring}
BuildRequires: libstatgrab-devel
%endif
%if %{with rdma}
BuildRequires: libibverbs-devel
BuildRequires: librdmacm-devel
%endif
%if %{with snmp}
BuildRequires: net-snmp-devel
%endif
#%if %{with systemd}
#BuildRequires: systemd-devel
BuildRequires: systemd
#Requires(post): systemd
#Requires(preun): systemd
#Requires(postun): systemd
#%endif
%if %{with xmlconf}
Requires: libxslt
%endif
%prep
%setup -q -n %{name}-%{version}
#%patch1 -p1
#%patch2 -p1
#%patch4 -p1
#%patch5 -p1
#%patch6 -p1
#%patch7 -p1
%build
%if 0%{?buildtrunk} == 1
./autogen.sh
%endif
%if %{with rdma}
export ibverbs_CFLAGS=-I/usr/include/infiniband \
export ibverbs_LIBS=-libverbs \
export rdmacm_CFLAGS=-I/usr/include/rdma \
export rdmacm_LIBS=-lrdmacm \
%endif
%{configure} \
%if %{with testagents}
--enable-testagents \
%endif
%if %{with watchdog}
--enable-watchdog \
%endif
%if %{with monitoring}
--enable-monitoring \
%endif
%if %{with snmp}
--enable-snmp \
%endif
%if %{with rdma}
--enable-rdma \
%endif
%if %{with upstart}
--enable-upstart \
%endif
%if %{with xmlconf}
--enable-xmlconf \
%endif
--with-initddir=%{_initrddir} \
--with-systemddir=%{_unitdir} \
--with-upstartdir=%{_sysconfdir}/init \
--enable-systemd
make %{_smp_mflags}
%install
make install DESTDIR=%{buildroot}
# removed to discourage use of init.d/corosync (openais should be
# used instead)
#%if 0%{?suse_version}
#ln -sf ../../etc/init.d/corosync %{buildroot}%{_sbindir}/rccorosync
#%endif
#rm -f %{buildroot}%{_initrddir}/corosync
#rm -f %{buildroot}%{_initrddir}/corosync-notifyd
#rm -f %{buildroot}/usr/sbin/corosync-notifyd
#rm -f %{buildroot}/usr/share/man/man8/corosync-notifyd.8
## tree fixup
# drop static libs
rm -f %{buildroot}%{_libdir}/*.a
rm -f %{buildroot}%{_libdir}/*.la
# drop docs and html docs for now
rm -rf %{buildroot}%{_docdir}/*
rm -rf %{buildroot}%{_datadir}/doc/*
# /etc/sysconfig/corosync-notifyd
#mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
#install -m 644 tools/corosync-notifyd.sysconfig.example \
# %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
#%{__install} -d -m 0755 %{buildroot}/usr/lib/tmpfiles.d/
#%{__install} -m 0644 %{buildroot}/usr/lib/tmpfiles.d/corosync-notifyd
mkdir -p %{buildroot}/usr/lib/tmpfiles.d/
install -m 0644 tools/corosync-notifyd.sysconfig.example %{buildroot}/usr/lib/tmpfiles.d/corosync-notifyd
%clean
rm -rf %{buildroot}
%description
This package contains the Corosync Cluster Engine Executive, several
default APIs and libraries, default configuration files, and an init
script.
%pre
#%if %{with systemd} && 0%{?systemd_post:1}
%service_add_pre corosync.service corosync-notifyd.service
%post
#%if %{with systemd} && 0%{?systemd_post:1}
#%systemd_post corosync.service corosync-notifyd.service
%service_add_post corosync.service corosync-notifyd.service
#%else
#if [ $1 -eq 1 ]; then
# /sbin/chkconfig --add corosync || :
#fi
#%endif
%preun
#%if %{with systemd} && 0%{?systemd_preun:1}
#%systemd_preun corosync.service corosync-notifyd.service
%service_del_preun corosync.service corosync-notifyd.service
#%else
#if [ $1 -eq 0 ]; then
# /sbin/service corosync stop &>/dev/null || :
# /sbin/chkconfig --del corosync || :
#fi
#%endif
%postun
#%if %{with systemd} && 0%{?systemd_postun:1}
#%systemd_postun corosync.service corosync-notifyd.service
%service_del_postun corosync.service corosync-notifyd.service
#%endif
%files
%defattr(-,root,root,-)
%doc LICENSE SECURITY
%{_sbindir}/corosync
%{_sbindir}/corosync-keygen
%{_sbindir}/corosync-cmapctl
%{_sbindir}/corosync-cfgtool
%{_sbindir}/corosync-cpgtool
%{_sbindir}/corosync-quorumtool
%{_sbindir}/corosync-notifyd
%{_bindir}/corosync-blackbox
%if %{with xmlconf}
%{_bindir}/corosync-xmlproc
%config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
%dir %{_datadir}/corosync
%{_datadir}/corosync/xml2conf.xsl
%{_mandir}/man8/corosync-xmlproc.8*
%{_mandir}/man5/corosync.xml.5*
%endif
%dir %{_sysconfdir}/corosync
%dir %{_sysconfdir}/corosync/uidgid.d
%config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
%config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
#%config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
%config(noreplace) /usr/lib/tmpfiles.d/corosync-notifyd
%if %{with snmp}
%{_datadir}/snmp/mibs/COROSYNC-MIB.txt
%endif
#%if %{with systemd}
%{_unitdir}/corosync.service
%{_unitdir}/corosync-notifyd.service
%dir %{_datadir}/corosync
%{_datadir}/corosync/corosync
%{_datadir}/corosync/corosync-notifyd
#%else
#%{_initrddir}/corosync
#%{_initrddir}/corosync-notifyd
#%endif
%if %{with upstart}
%{_sysconfdir}/init/corosync.conf
%{_sysconfdir}/init/corosync-notifyd.conf
%endif
%dir %{_localstatedir}/lib/corosync
%dir %{_localstatedir}/log/cluster
%{_mandir}/man8/*.8*
%{_mandir}/man5/*.5*
%{_mandir}/man3/*.3*
# library
#
%package -n libcorosync4
Summary: The Corosync Cluster Engine Libraries
Group: Productivity/Clustering/HA
#Requires: %{name} = %{version}-%{release}
%description -n libcorosync4
This package contains corosync libraries.
%files -n libcorosync4
%defattr(-,root,root,-)
%doc LICENSE
%{_libdir}/libcfg.so.*
%{_libdir}/libcpg.so.*
%{_libdir}/libcmap.so.*
%{_libdir}/libtotem_pg.so.*
%{_libdir}/libquorum.so.*
%{_libdir}/libvotequorum.so.*
%{_libdir}/libsam.so.*
%{_libdir}/libcorosync_common.so.*
%post -n libcorosync4 -p /sbin/ldconfig
%postun -n libcorosync4 -p /sbin/ldconfig
%package -n libcorosync-devel
Summary: The Corosync Cluster Engine Development Kit
Group: Productivity/Clustering/HA
Requires: libcorosync4 = %{version}-%{release}
Requires: libqb-devel
Requires: pkgconfig
Provides: corosync-devel = %{version}
Obsoletes: corosync-devel < 0.92-7
%description -n libcorosync-devel
This package contains include files and man pages used to develop using
The Corosync Cluster Engine APIs.
%files -n libcorosync-devel
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_includedir}/corosync/
%{_includedir}/corosync/corodefs.h
%{_includedir}/corosync/cfg.h
%{_includedir}/corosync/cmap.h
%{_includedir}/corosync/corotypes.h
%{_includedir}/corosync/cpg.h
%{_includedir}/corosync/hdb.h
%{_includedir}/corosync/sam.h
%{_includedir}/corosync/quorum.h
%{_includedir}/corosync/votequorum.h
%dir %{_includedir}/corosync/totem/
%{_includedir}/corosync/totem/totem.h
%{_includedir}/corosync/totem/totemip.h
%{_includedir}/corosync/totem/totempg.h
%{_libdir}/libcfg.so
%{_libdir}/libcpg.so
%{_libdir}/libcmap.so
%{_libdir}/libtotem_pg.so
%{_libdir}/libquorum.so
%{_libdir}/libvotequorum.so
%{_libdir}/libsam.so
%{_libdir}/libcorosync_common.so
%{_libdir}/pkgconfig/*.pc
%post -n libcorosync-devel -p /sbin/ldconfig
%postun -n libcorosync-devel -p /sbin/ldconfig
%changelog